stackValue.cpp revision 1472
5346N/A * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 5346N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5346N/A * This code is free software; you can redistribute it and/or modify it 5346N/A * under the terms of the GNU General Public License version 2 only, as 5346N/A * published by the Free Software Foundation. 5346N/A * This code is distributed in the hope that it will be useful, but WITHOUT 5346N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 5346N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 5346N/A * version 2 for more details (a copy is included in the LICENSE file that 5346N/A * You should have received a copy of the GNU General Public License version 5346N/A * 2 along with this work; if not, write to the Free Software Foundation, 5346N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 5346N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 5346N/A#
include "incls/_precompiled.incl" 5346N/A // %%%%% Callee-save floats will NOT be working on a Sparc until we 5346N/A // handle the case of a 2 floats in a single double register. 5346N/A // First find address of value 5346N/A // Value was in a callee-save register 5346N/A // Else value was directly saved on the stack. The frame's original stack pointer, 5346N/A // before any extension by its callee (due to Compiler1 linkage on SPARC), must be used. 5346N/A // Then package it right depending on type 5346N/A // Note: the transfer of the data is thru a union that contains 5346N/A // an intptr_t. This is because an interpreter stack slot is 5346N/A // really an intptr_t. The use of a union containing an intptr_t 5346N/A // ensures that on a 64 bit platform we have proper alignment 5346N/A // and that we store the value where the interpreter will expect 5346N/A // to find it (i.e. proper endian). Similarly on a 32bit platform 5346N/A // using the intptr_t ensures that when a value is larger than 5346N/A // of the value for the stack slot in question. 5346N/A // The callee has no clue whether the register holds a float, 5346N/A // double or is unused. He always saves a double. Here we know 5346N/A // a double was saved, but we only want a float back. Narrow the 5346N/A // saved double to the float that the JVM wants. 5346N/A // The callee has no clue whether the register holds an int, 5346N/A // long or is unused. He always saves a long. Here we know 5346N/A // a long was saved, but we only want an int back. Narrow the 5346N/A // saved long to the int that the JVM wants. 5346N/A // Double value in an aligned adjacent pair 5346N/A // Long value in an aligned adjacent pair 5346N/A // The callee has no clue whether the register holds an int, 5346N/A // long or is unused. He always saves a long. Here we know 5346N/A // a long was saved, but we only want an int back. Narrow the 5346N/A // saved long to the int that the JVM wants. 5346N/A // Decode narrowoop and wrap a handle around the oop // Compiled code may produce decoded oop = narrow_oop_base // when a narrow oop implicit null check is used. // The narrow_oop_base could be NULL or be the address // of the page below heap. Use NULL value for both cases. Handle h(
val);
// Wrap a handle around the oop // Just copy all other bits straight through // Constant int: treat same as register int. // Constant double in a single stack slot // Constant long in a single stack slot }
else if (
sv->
is_object()) {
// Scalar replaced object in compiled frame // Unknown ScopeValue type // high: [ ] word_offset + 1 // the word_offset is the distance from the stack pointer to the lowest address // The frame's original stack pointer, before any extension by its callee // (due to Compiler1 linkage on SPARC), must be used. st->
print(
"%d (int) %f (float) %x (hex)", *(
int *)&
_i, *(
float *)&
_i, *(
int *)&
_i);