提交 feb753d4 编写于 作者: D duke

Merge

......@@ -67,3 +67,4 @@ cf26288a114be67c39f2758959ce50b60f5ae330 jdk7-b85
425ba3efabbfe0b188105c10aaf7c3c8fa8d1a38 jdk7-b90
97d8b6c659c29c8493a8b2b72c2796a021a8cf79 jdk7-b91
5f5c33d417f3a14706b09a4a95e65fa7b6fa54d6 jdk7-b92
5fc102ff48f0e787ce9cc77249841d5ff0941b75 jdk7-b93
......@@ -970,9 +970,9 @@ including non-open portions.
So for now you should be able to build with either VS2003 or VS2010.
We do not guarantee that VS2008 will work, although there is sufficient
makefile support to make at least basic JDK builds plausible.
Visual Studio 2010 Express compilers are likely to be able to build all the
"open" sources, with only small adjustments, but this has yet to be made
to work. Also we have not yet seen the 7.1 Windows SDK with the 64 bit
Visual Studio 2010 Express compilers are now able to build all the
open source repositories, but this is 32 bit only, since
we have not yet seen the 7.1 Windows SDK with the 64 bit
compilers. <b>END WARNING.</b>
<p>
The 32-bit OpenJDK Windows build
......
......@@ -67,3 +67,4 @@ bb4424c5e778b842c064a8b1aa902b35f4397654 jdk7-b89
56ce07b0eb47b93a98a72adef0f21e602c460623 jdk7-b90
bcd2fc089227559ac5be927923609fac29f067fa jdk7-b91
930582f667a13391cd0b3e41e8cb760f55e3a5c0 jdk7-b92
9718d624864c29dca44373d541e93cdd309a994f jdk7-b93
......@@ -30,8 +30,7 @@
BUILDDIR = ../..
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = org core
SUBDIRS = org
all build clean clobber::
$(SUBDIRS-loop)
$(RM) -r $(CLASSBINDIR)/com/sun/corba/se/internal/io
#
# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
# Define library interface.
SUNWprivate_1.1 {
global:
Java_com_sun_corba_se_internal_io_IIOPInputStream_allocateNewObject;
Java_com_sun_corba_se_internal_io_IIOPInputStream_loadClass;
Java_com_sun_corba_se_internal_io_IIOPInputStream_readObject;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setBooleanField;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setBooleanFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setByteField;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setByteFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setCharField;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setCharFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setDoubleField;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setDoubleFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setFloatField;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setFloatFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setIntField;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setIntFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setLongField;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setLongFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setObjectField;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setObjectFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setShortField;
Java_com_sun_corba_se_internal_io_IIOPInputStream_setShortFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPInputStream_throwExceptionType;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getBooleanField;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getBooleanFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getByteField;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getByteFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getCharField;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getCharFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getDoubleField;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getDoubleFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getFloatField;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getFloatFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getIntField;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getIntFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getLongField;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getLongFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getObjectField;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getObjectFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getShortField;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_getShortFieldOpt;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_throwExceptionType;
Java_com_sun_corba_se_internal_io_IIOPOutputStream_writeObject;
Java_com_sun_corba_se_internal_io_LibraryManager_getMajorVersion;
Java_com_sun_corba_se_internal_io_LibraryManager_getMinorVersion;
Java_com_sun_corba_se_internal_io_LibraryManager_setEnableOverride;
Java_com_sun_corba_se_internal_io_ObjectStreamClass_hasStaticInitializer;
Java_com_sun_corba_se_internal_io_ObjectStreamField_getFieldIDNative;
Java_com_sun_corba_se_internal_util_JDKClassLoader_specialLoadClass;
local:
*;
};
/*
* Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.corba.se.internal.io;
public class IIOPInputStream {
private static native Object allocateNewObject(Class aclass,
Class initclass)
throws InstantiationException, IllegalAccessException;
/* Create a pending exception. This is needed to get around
* the fact that the *Delegate methods do not explicitly
* declare that they throw exceptions.
*
* This native methods creates an exception of the given type with
* the given message string and posts it to the pending queue.
*/
private static native void throwExceptionType(Class c, String message);
/* The following native methods of the form set*Field are used
* to set private, protected, and package private fields
* of an Object.
*/
private static native void setObjectField(Object o, Class c, String fieldName, String fieldSig, Object v);
private static native void setBooleanField(Object o, Class c, String fieldName, String fieldSig, boolean v);
private static native void setByteField(Object o, Class c, String fieldName, String fieldSig, byte v);
private static native void setCharField(Object o, Class c, String fieldName, String fieldSig, char v);
private static native void setShortField(Object o, Class c, String fieldName, String fieldSig, short v);
private static native void setIntField(Object o, Class c, String fieldName, String fieldSig, int v);
private static native void setLongField(Object o, Class c, String fieldName, String fieldSig, long v);
private static native void setFloatField(Object o, Class c, String fieldName, String fieldSig, float v);
private static native void setDoubleField(Object o, Class c, String fieldName, String fieldSig, double v);
private static native void readObject(Object obj, Class asClass, Object ois);
private static native void setObjectFieldOpt(Object o, long fieldID, Object v);
private static native void setBooleanFieldOpt(Object o, long fieldID, boolean v);
private static native void setByteFieldOpt(Object o, long fieldID, byte v);
private static native void setCharFieldOpt(Object o, long fieldID, char v);
private static native void setShortFieldOpt(Object o, long fieldID, short v);
private static native void setIntFieldOpt(Object o, long fieldID, int v);
private static native void setLongFieldOpt(Object o, long fieldID, long v);
private static native void setFloatFieldOpt(Object o, long fieldID, float v);
private static native void setDoubleFieldOpt(Object o, long fieldID, double v);
}
......@@ -93,3 +93,5 @@ e7e7e36ccdb5d56edd47e5744351202d38f3b7ad jdk7-b87
e0a1a502e402dbe7bf2d9102b4084a7e79a99a9b jdk7-b91
25f53b53aaa3eb8b2d5391a1e8de9a76ae1dd8a2 hs18-b03
3221d1887d30341bedfdac1dbf365ea41beff20f jdk7-b92
310cdbc355355a13aa53c002b6bde4a8c5ba67ff hs18-b04
9d865fc2f644fdd9a0108fd6407944ee610aadd9 jdk7-b93
......@@ -28,5 +28,5 @@
# Don't put quotes (fail windows build).
HOTSPOT_VM_DISTRO=Java HotSpot(TM)
COMPANY_NAME=Sun Microsystems, Inc.
COMPANY_NAME=Oracle Corporation
PRODUCT_NAME=Java(TM) Platform SE
......@@ -33,9 +33,9 @@
# Don't put quotes (fail windows build).
HOTSPOT_VM_COPYRIGHT=Copyright 2010
HS_MAJOR_VER=18
HS_MAJOR_VER=19
HS_MINOR_VER=0
HS_BUILD_NUMBER=04
HS_BUILD_NUMBER=01
JDK_MAJOR_VER=1
JDK_MINOR_VER=7
......
......@@ -51,6 +51,8 @@ jprt.my.solaris.sparc.jdk6=solaris_sparc_5.8
jprt.my.solaris.sparc.jdk6perf=solaris_sparc_5.8
jprt.my.solaris.sparc.jdk6u10=solaris_sparc_5.8
jprt.my.solaris.sparc.jdk6u14=solaris_sparc_5.8
jprt.my.solaris.sparc.jdk6u18=solaris_sparc_5.8
jprt.my.solaris.sparc.jdk6u20=solaris_sparc_5.8
jprt.my.solaris.sparc=${jprt.my.solaris.sparc.${jprt.tools.default.release}}
jprt.my.solaris.sparcv9.jdk7=solaris_sparcv9_5.10
......@@ -58,6 +60,8 @@ jprt.my.solaris.sparcv9.jdk6=solaris_sparcv9_5.8
jprt.my.solaris.sparcv9.jdk6perf=solaris_sparcv9_5.8
jprt.my.solaris.sparcv9.jdk6u10=solaris_sparcv9_5.8
jprt.my.solaris.sparcv9.jdk6u14=solaris_sparcv9_5.8
jprt.my.solaris.sparcv9.jdk6u18=solaris_sparcv9_5.8
jprt.my.solaris.sparcv9.jdk6u20=solaris_sparcv9_5.8
jprt.my.solaris.sparcv9=${jprt.my.solaris.sparcv9.${jprt.tools.default.release}}
jprt.my.solaris.i586.jdk7=solaris_i586_5.10
......@@ -65,6 +69,8 @@ jprt.my.solaris.i586.jdk6=solaris_i586_5.8
jprt.my.solaris.i586.jdk6perf=solaris_i586_5.8
jprt.my.solaris.i586.jdk6u10=solaris_i586_5.8
jprt.my.solaris.i586.jdk6u14=solaris_i586_5.8
jprt.my.solaris.i586.jdk6u18=solaris_i586_5.8
jprt.my.solaris.i586.jdk6u20=solaris_i586_5.8
jprt.my.solaris.i586=${jprt.my.solaris.i586.${jprt.tools.default.release}}
jprt.my.solaris.x64.jdk7=solaris_x64_5.10
......@@ -72,6 +78,8 @@ jprt.my.solaris.x64.jdk6=solaris_x64_5.10
jprt.my.solaris.x64.jdk6perf=solaris_x64_5.10
jprt.my.solaris.x64.jdk6u10=solaris_x64_5.10
jprt.my.solaris.x64.jdk6u14=solaris_x64_5.10
jprt.my.solaris.x64.jdk6u18=solaris_x64_5.10
jprt.my.solaris.x64.jdk6u20=solaris_x64_5.10
jprt.my.solaris.x64=${jprt.my.solaris.x64.${jprt.tools.default.release}}
jprt.my.linux.i586.jdk7=linux_i586_2.6
......@@ -79,6 +87,8 @@ jprt.my.linux.i586.jdk6=linux_i586_2.4
jprt.my.linux.i586.jdk6perf=linux_i586_2.4
jprt.my.linux.i586.jdk6u10=linux_i586_2.4
jprt.my.linux.i586.jdk6u14=linux_i586_2.4
jprt.my.linux.i586.jdk6u18=linux_i586_2.4
jprt.my.linux.i586.jdk6u20=linux_i586_2.4
jprt.my.linux.i586=${jprt.my.linux.i586.${jprt.tools.default.release}}
jprt.my.linux.x64.jdk7=linux_x64_2.6
......@@ -86,6 +96,8 @@ jprt.my.linux.x64.jdk6=linux_x64_2.4
jprt.my.linux.x64.jdk6perf=linux_x64_2.4
jprt.my.linux.x64.jdk6u10=linux_x64_2.4
jprt.my.linux.x64.jdk6u14=linux_x64_2.4
jprt.my.linux.x64.jdk6u18=linux_x64_2.4
jprt.my.linux.x64.jdk6u20=linux_x64_2.4
jprt.my.linux.x64=${jprt.my.linux.x64.${jprt.tools.default.release}}
jprt.my.windows.i586.jdk7=windows_i586_5.0
......@@ -93,6 +105,8 @@ jprt.my.windows.i586.jdk6=windows_i586_5.0
jprt.my.windows.i586.jdk6perf=windows_i586_5.0
jprt.my.windows.i586.jdk6u10=windows_i586_5.0
jprt.my.windows.i586.jdk6u14=windows_i586_5.0
jprt.my.windows.i586.jdk6u18=windows_i586_5.0
jprt.my.windows.i586.jdk6u20=windows_i586_5.0
jprt.my.windows.i586=${jprt.my.windows.i586.${jprt.tools.default.release}}
jprt.my.windows.x64.jdk7=windows_x64_5.2
......@@ -100,6 +114,8 @@ jprt.my.windows.x64.jdk6=windows_x64_5.2
jprt.my.windows.x64.jdk6perf=windows_x64_5.2
jprt.my.windows.x64.jdk6u10=windows_x64_5.2
jprt.my.windows.x64.jdk6u14=windows_x64_5.2
jprt.my.windows.x64.jdk6u18=windows_x64_5.2
jprt.my.windows.x64.jdk6u20=windows_x64_5.2
jprt.my.windows.x64=${jprt.my.windows.x64.${jprt.tools.default.release}}
# Standard list of jprt build targets for this source tree
......
/*
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -2333,6 +2333,18 @@ void MacroAssembler::lcmp( Register Ra, Register Rb, Register Rresult) {
#endif
void MacroAssembler::load_sized_value(Address src, Register dst,
size_t size_in_bytes, bool is_signed) {
switch (size_in_bytes) {
case 8: ldx(src, dst); break;
case 4: ld( src, dst); break;
case 2: is_signed ? ldsh(src, dst) : lduh(src, dst); break;
case 1: is_signed ? ldsb(src, dst) : ldub(src, dst); break;
default: ShouldNotReachHere();
}
}
void MacroAssembler::float_cmp( bool is_float, int unordered_result,
FloatRegister Fa, FloatRegister Fb,
Register Rresult) {
......@@ -2625,40 +2637,103 @@ RegisterOrConstant MacroAssembler::delayed_value_impl(intptr_t* delayed_value_ad
}
void MacroAssembler::regcon_inc_ptr( RegisterOrConstant& dest, RegisterOrConstant src, Register temp ) {
assert(dest.register_or_noreg() != G0, "lost side effect");
if ((src.is_constant() && src.as_constant() == 0) ||
(src.is_register() && src.as_register() == G0)) {
// do nothing
} else if (dest.is_register()) {
add(dest.as_register(), ensure_simm13_or_reg(src, temp), dest.as_register());
} else if (src.is_constant()) {
intptr_t res = dest.as_constant() + src.as_constant();
dest = RegisterOrConstant(res); // side effect seen by caller
RegisterOrConstant MacroAssembler::regcon_andn_ptr(RegisterOrConstant s1, RegisterOrConstant s2, RegisterOrConstant d, Register temp) {
assert(d.register_or_noreg() != G0, "lost side effect");
if ((s2.is_constant() && s2.as_constant() == 0) ||
(s2.is_register() && s2.as_register() == G0)) {
// Do nothing, just move value.
if (s1.is_register()) {
if (d.is_constant()) d = temp;
mov(s1.as_register(), d.as_register());
return d;
} else {
return s1;
}
}
if (s1.is_register()) {
assert_different_registers(s1.as_register(), temp);
if (d.is_constant()) d = temp;
andn(s1.as_register(), ensure_simm13_or_reg(s2, temp), d.as_register());
return d;
} else {
if (s2.is_register()) {
assert_different_registers(s2.as_register(), temp);
if (d.is_constant()) d = temp;
set(s1.as_constant(), temp);
andn(temp, s2.as_register(), d.as_register());
return d;
} else {
intptr_t res = s1.as_constant() & ~s2.as_constant();
return res;
}
}
}
RegisterOrConstant MacroAssembler::regcon_inc_ptr(RegisterOrConstant s1, RegisterOrConstant s2, RegisterOrConstant d, Register temp) {
assert(d.register_or_noreg() != G0, "lost side effect");
if ((s2.is_constant() && s2.as_constant() == 0) ||
(s2.is_register() && s2.as_register() == G0)) {
// Do nothing, just move value.
if (s1.is_register()) {
if (d.is_constant()) d = temp;
mov(s1.as_register(), d.as_register());
return d;
} else {
return s1;
}
}
if (s1.is_register()) {
assert_different_registers(s1.as_register(), temp);
if (d.is_constant()) d = temp;
add(s1.as_register(), ensure_simm13_or_reg(s2, temp), d.as_register());
return d;
} else {
assert(temp != noreg, "cannot handle constant += register");
add(src.as_register(), ensure_simm13_or_reg(dest, temp), temp);
dest = RegisterOrConstant(temp); // side effect seen by caller
}
}
void MacroAssembler::regcon_sll_ptr( RegisterOrConstant& dest, RegisterOrConstant src, Register temp ) {
assert(dest.register_or_noreg() != G0, "lost side effect");
if (!is_simm13(src.constant_or_zero()))
src = (src.as_constant() & 0xFF);
if ((src.is_constant() && src.as_constant() == 0) ||
(src.is_register() && src.as_register() == G0)) {
// do nothing
} else if (dest.is_register()) {
sll_ptr(dest.as_register(), src, dest.as_register());
} else if (src.is_constant()) {
intptr_t res = dest.as_constant() << src.as_constant();
dest = RegisterOrConstant(res); // side effect seen by caller
if (s2.is_register()) {
assert_different_registers(s2.as_register(), temp);
if (d.is_constant()) d = temp;
add(s2.as_register(), ensure_simm13_or_reg(s1, temp), d.as_register());
return d;
} else {
intptr_t res = s1.as_constant() + s2.as_constant();
return res;
}
}
}
RegisterOrConstant MacroAssembler::regcon_sll_ptr(RegisterOrConstant s1, RegisterOrConstant s2, RegisterOrConstant d, Register temp) {
assert(d.register_or_noreg() != G0, "lost side effect");
if (!is_simm13(s2.constant_or_zero()))
s2 = (s2.as_constant() & 0xFF);
if ((s2.is_constant() && s2.as_constant() == 0) ||
(s2.is_register() && s2.as_register() == G0)) {
// Do nothing, just move value.
if (s1.is_register()) {
if (d.is_constant()) d = temp;
mov(s1.as_register(), d.as_register());
return d;
} else {
return s1;
}
}
if (s1.is_register()) {
assert_different_registers(s1.as_register(), temp);
if (d.is_constant()) d = temp;
sll_ptr(s1.as_register(), ensure_simm13_or_reg(s2, temp), d.as_register());
return d;
} else {
assert(temp != noreg, "cannot handle constant <<= register");
set(dest.as_constant(), temp);
sll_ptr(temp, src, temp);
dest = RegisterOrConstant(temp); // side effect seen by caller
if (s2.is_register()) {
assert_different_registers(s2.as_register(), temp);
if (d.is_constant()) d = temp;
set(s1.as_constant(), temp);
sll_ptr(temp, s2.as_register(), d.as_register());
return d;
} else {
intptr_t res = s1.as_constant() << s2.as_constant();
return res;
}
}
}
......@@ -2708,8 +2783,8 @@ void MacroAssembler::lookup_interface_method(Register recv_klass,
// Adjust recv_klass by scaled itable_index, so we can free itable_index.
RegisterOrConstant itable_offset = itable_index;
regcon_sll_ptr(itable_offset, exact_log2(itableMethodEntry::size() * wordSize));
regcon_inc_ptr(itable_offset, itableMethodEntry::method_offset_in_bytes());
itable_offset = regcon_sll_ptr(itable_index, exact_log2(itableMethodEntry::size() * wordSize), itable_offset);
itable_offset = regcon_inc_ptr(itable_offset, itableMethodEntry::method_offset_in_bytes(), itable_offset);
add(recv_klass, ensure_simm13_or_reg(itable_offset, sethi_temp), recv_klass);
// for (scan = klass->itable(); scan->interface() != NULL; scan += scan_step) {
......@@ -2805,7 +2880,7 @@ void MacroAssembler::check_klass_subtype_fast_path(Register sub_klass,
assert_different_registers(sub_klass, super_klass, temp_reg);
if (super_check_offset.is_register()) {
assert_different_registers(sub_klass, super_klass,
assert_different_registers(sub_klass, super_klass, temp_reg,
super_check_offset.as_register());
} else if (must_load_sco) {
assert(temp2_reg != noreg, "supply either a temp or a register offset");
......@@ -2855,6 +2930,8 @@ void MacroAssembler::check_klass_subtype_fast_path(Register sub_klass,
// The super check offset is always positive...
lduw(super_klass, sco_offset, temp2_reg);
super_check_offset = RegisterOrConstant(temp2_reg);
// super_check_offset is register.
assert_different_registers(sub_klass, super_klass, temp_reg, super_check_offset.as_register());
}
ld_ptr(sub_klass, super_check_offset, temp_reg);
cmp(super_klass, temp_reg);
......@@ -3014,11 +3091,10 @@ void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass,
}
void MacroAssembler::check_method_handle_type(Register mtype_reg, Register mh_reg,
Register temp_reg,
Label& wrong_method_type) {
if (UseCompressedOops) unimplemented("coop"); // field accesses must decode
assert_different_registers(mtype_reg, mh_reg, temp_reg);
// compare method type against that of the receiver
RegisterOrConstant mhtype_offset = delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg);
......@@ -3029,10 +3105,33 @@ void MacroAssembler::check_method_handle_type(Register mtype_reg, Register mh_re
}
void MacroAssembler::jump_to_method_handle_entry(Register mh_reg, Register temp_reg) {
// A method handle has a "vmslots" field which gives the size of its
// argument list in JVM stack slots. This field is either located directly
// in every method handle, or else is indirectly accessed through the
// method handle's MethodType. This macro hides the distinction.
void MacroAssembler::load_method_handle_vmslots(Register vmslots_reg, Register mh_reg,
Register temp_reg) {
assert_different_registers(vmslots_reg, mh_reg, temp_reg);
if (UseCompressedOops) unimplemented("coop"); // field accesses must decode
// load mh.type.form.vmslots
if (java_dyn_MethodHandle::vmslots_offset_in_bytes() != 0) {
// hoist vmslots into every mh to avoid dependent load chain
ld( Address(mh_reg, delayed_value(java_dyn_MethodHandle::vmslots_offset_in_bytes, temp_reg)), vmslots_reg);
} else {
Register temp2_reg = vmslots_reg;
ld_ptr(Address(mh_reg, delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg)), temp2_reg);
ld_ptr(Address(temp2_reg, delayed_value(java_dyn_MethodType::form_offset_in_bytes, temp_reg)), temp2_reg);
ld( Address(temp2_reg, delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, temp_reg)), vmslots_reg);
}
}
void MacroAssembler::jump_to_method_handle_entry(Register mh_reg, Register temp_reg, bool emit_delayed_nop) {
assert(mh_reg == G3_method_handle, "caller must put MH object in G3");
assert_different_registers(mh_reg, temp_reg);
if (UseCompressedOops) unimplemented("coop"); // field accesses must decode
// pick out the interpreted side of the handler
ld_ptr(mh_reg, delayed_value(java_dyn_MethodHandle::vmentry_offset_in_bytes, temp_reg), temp_reg);
......@@ -3043,17 +3142,18 @@ void MacroAssembler::jump_to_method_handle_entry(Register mh_reg, Register temp_
// for the various stubs which take control at this point,
// see MethodHandles::generate_method_handle_stub
// (Can any caller use this delay slot? If so, add an option for supression.)
delayed()->nop();
// Some callers can fill the delay slot.
if (emit_delayed_nop) {
delayed()->nop();
}
}
RegisterOrConstant MacroAssembler::argument_offset(RegisterOrConstant arg_slot,
int extra_slot_offset) {
// cf. TemplateTable::prepare_invoke(), if (load_receiver).
int stackElementSize = Interpreter::stackElementWords() * wordSize;
int offset = Interpreter::expr_offset_in_bytes(extra_slot_offset+0);
int offset1 = Interpreter::expr_offset_in_bytes(extra_slot_offset+1);
assert(offset1 - offset == stackElementSize, "correct arithmetic");
int stackElementSize = Interpreter::stackElementSize;
int offset = extra_slot_offset * stackElementSize;
if (arg_slot.is_constant()) {
offset += arg_slot.as_constant() * stackElementSize;
return offset;
......@@ -3067,6 +3167,11 @@ RegisterOrConstant MacroAssembler::argument_offset(RegisterOrConstant arg_slot,
}
Address MacroAssembler::argument_address(RegisterOrConstant arg_slot,
int extra_slot_offset) {
return Address(Gargs, argument_offset(arg_slot, extra_slot_offset));
}
void MacroAssembler::biased_locking_enter(Register obj_reg, Register mark_reg,
Register temp_reg,
......@@ -4082,7 +4187,7 @@ static int EnqueueCodeSize = 128 DEBUG_ONLY( + 256); // Instructions?
// make it work.
static void check_index(int ind) {
assert(0 <= ind && ind <= 64*K && ((ind % oopSize) == 0),
"Invariants.")
"Invariants.");
}
static void generate_satb_log_enqueue(bool with_frame) {
......
/*
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -1062,7 +1062,7 @@ class Assembler : public AbstractAssembler {
}
void assert_not_delayed(const char* msg) {
#ifdef CHECK_DELAY
assert_msg ( delay_state == no_delay, msg);
assert(delay_state == no_delay, msg);
#endif
}
......@@ -1380,24 +1380,25 @@ public:
// pp 181
void and3( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(and_op3 ) | rs1(s1) | rs2(s2) ); }
void and3( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(and_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
void and3( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(and_op3 ) | rs1(s1) | rs2(s2) ); }
void and3( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(and_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
void andcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(and_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
void andcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(and_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
void andn( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(andn_op3 ) | rs1(s1) | rs2(s2) ); }
void andn( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(andn_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
void andn( Register s1, RegisterOrConstant s2, Register d);
void andncc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
void andncc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
void or3( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(or_op3 ) | rs1(s1) | rs2(s2) ); }
void or3( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(or_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
void or3( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(or_op3 ) | rs1(s1) | rs2(s2) ); }
void or3( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(or_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
void orcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(or_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
void orcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(or_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
void orn( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(orn_op3) | rs1(s1) | rs2(s2) ); }
void orn( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(orn_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
void orncc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(orn_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
void orncc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(orn_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
void xor3( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xor_op3 ) | rs1(s1) | rs2(s2) ); }
void xor3( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xor_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
void xor3( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xor_op3 ) | rs1(s1) | rs2(s2) ); }
void xor3( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xor_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
void xorcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xor_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
void xorcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xor_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
void xnor( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xnor_op3 ) | rs1(s1) | rs2(s2) ); }
......@@ -2026,8 +2027,8 @@ public:
inline void st_ptr(Register d, Register s1, ByteSize simm13a);
#endif
// ld_long will perform ld for 32 bit VM's and ldx for 64 bit VM's
// st_long will perform st for 32 bit VM's and stx for 64 bit VM's
// ld_long will perform ldd for 32 bit VM's and ldx for 64 bit VM's
// st_long will perform std for 32 bit VM's and stx for 64 bit VM's
inline void ld_long(Register s1, Register s2, Register d);
inline void ld_long(Register s1, int simm13a, Register d);
inline void ld_long(Register s1, RegisterOrConstant s2, Register d);
......@@ -2038,23 +2039,19 @@ public:
inline void st_long(Register d, const Address& a, int offset = 0);
// Helpers for address formation.
// They update the dest in place, whether it is a register or constant.
// They emit no code at all if src is a constant zero.
// If dest is a constant and src is a register, the temp argument
// is required, and becomes the result.
// If dest is a register and src is a non-simm13 constant,
// the temp argument is required, and is used to materialize the constant.
void regcon_inc_ptr( RegisterOrConstant& dest, RegisterOrConstant src,
Register temp = noreg );
void regcon_sll_ptr( RegisterOrConstant& dest, RegisterOrConstant src,
Register temp = noreg );
RegisterOrConstant ensure_simm13_or_reg(RegisterOrConstant roc, Register Rtemp) {
guarantee(Rtemp != noreg, "constant offset overflow");
if (is_simm13(roc.constant_or_zero()))
return roc; // register or short constant
set(roc.as_constant(), Rtemp);
return RegisterOrConstant(Rtemp);
// - They emit only a move if s2 is a constant zero.
// - If dest is a constant and either s1 or s2 is a register, the temp argument is required and becomes the result.
// - If dest is a register and either s1 or s2 is a non-simm13 constant, the temp argument is required and used to materialize the constant.
RegisterOrConstant regcon_andn_ptr(RegisterOrConstant s1, RegisterOrConstant s2, RegisterOrConstant d, Register temp = noreg);
RegisterOrConstant regcon_inc_ptr( RegisterOrConstant s1, RegisterOrConstant s2, RegisterOrConstant d, Register temp = noreg);
RegisterOrConstant regcon_sll_ptr( RegisterOrConstant s1, RegisterOrConstant s2, RegisterOrConstant d, Register temp = noreg);
RegisterOrConstant ensure_simm13_or_reg(RegisterOrConstant src, Register temp) {
if (is_simm13(src.constant_or_zero()))
return src; // register or short constant
guarantee(temp != noreg, "constant offset overflow");
set(src.as_constant(), temp);
return temp;
}
// --------------------------------------------------
......@@ -2303,6 +2300,9 @@ public:
void lcmp( Register Ra, Register Rb, Register Rresult);
#endif
// Loading values by size and signed-ness
void load_sized_value(Address src, Register dst, size_t size_in_bytes, bool is_signed);
void float_cmp( bool is_float, int unordered_result,
FloatRegister Fa, FloatRegister Fb,
Register Rresult);
......@@ -2421,12 +2421,16 @@ public:
void check_method_handle_type(Register mtype_reg, Register mh_reg,
Register temp_reg,
Label& wrong_method_type);
void jump_to_method_handle_entry(Register mh_reg, Register temp_reg);
void load_method_handle_vmslots(Register vmslots_reg, Register mh_reg,
Register temp_reg);
void jump_to_method_handle_entry(Register mh_reg, Register temp_reg, bool emit_delayed_nop = true);
// offset relative to Gargs of argument at tos[arg_slot].
// (arg_slot == 0 means the last argument, not the first).
RegisterOrConstant argument_offset(RegisterOrConstant arg_slot,
int extra_slot_offset = 0);
// Address of Gargs and argument_offset.
Address argument_address(RegisterOrConstant arg_slot,
int extra_slot_offset = 0);
// Stack overflow checking
......
......@@ -206,12 +206,17 @@ inline void Assembler::ld( Register s1, RegisterOrConstant s2, Register d) { ld
inline void Assembler::ldd( Register s1, RegisterOrConstant s2, Register d) { ldd( Address(s1, s2), d); }
// form effective addresses this way:
inline void Assembler::add( Register s1, RegisterOrConstant s2, Register d, int offset) {
if (s2.is_register()) add(s1, s2.as_register(), d);
inline void Assembler::add(Register s1, RegisterOrConstant s2, Register d, int offset) {
if (s2.is_register()) add(s1, s2.as_register(), d);
else { add(s1, s2.as_constant() + offset, d); offset = 0; }
if (offset != 0) add(d, offset, d);
}
inline void Assembler::andn(Register s1, RegisterOrConstant s2, Register d) {
if (s2.is_register()) andn(s1, s2.as_register(), d);
else andn(s1, s2.as_constant(), d);
}
inline void Assembler::ldstub( Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(ldstub_op3) | rs1(s1) | rs2(s2) ); }
inline void Assembler::ldstub( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldstub_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
......
/*
* Copyright 2002 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2002-2010 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -26,7 +26,7 @@
// fail with a guarantee ("not enough space for interpreter generation");
// if too small.
// Run with +PrintInterpreter to get the VM to print out the size.
// Max size with JVMTI and TaggedStackInterpreter
// Max size with JVMTI
// QQQ this is proably way too large for c++ interpreter
......
......@@ -620,7 +620,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
// stack frames shouldn't be much larger than max_stack elements
if (fp() - sp() > 1024 + m->max_stack()*Interpreter::stackElementSize()) {
if (fp() - sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
return false;
}
......
......@@ -149,7 +149,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
void push_i( Register r = Otos_i);
void push_ptr( Register r = Otos_i);
void push_ptr( Register r, Register tag);
void push_l( Register r = Otos_l1);
void push_f(FloatRegister f = Ftos_f);
void push_d(FloatRegister f = Ftos_d1);
......@@ -159,17 +158,9 @@ class InterpreterMacroAssembler: public MacroAssembler {
void push(TosState state); // transition state -> vtos
void empty_expression_stack(); // resets both Lesp and SP
// Support for Tagged Stacks
void tag_stack(frame::Tag t, Register r);
void tag_stack(Register tag);
void tag_local(frame::Tag t, Register src, Register base, int n = 0);
#ifdef ASSERT
void verify_sp(Register Rsp, Register Rtemp);
void verify_esp(Register Resp); // verify that Lesp points to a word in the temp stack
void verify_stack_tag(frame::Tag t, Register r, Register scratch = G0);
void verify_local_tag(frame::Tag t, Register base, Register scr, int n = 0);
#endif // ASSERT
public:
......@@ -191,8 +182,9 @@ class InterpreterMacroAssembler: public MacroAssembler {
Register Rdst,
setCCOrNot should_set_CC = dont_set_CC );
void get_cache_and_index_at_bcp(Register cache, Register tmp, int bcp_offset);
void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset);
void get_cache_and_index_at_bcp(Register cache, Register tmp, int bcp_offset, bool giant_index = false);
void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset, bool giant_index = false);
void get_cache_index_at_bcp(Register cache, Register tmp, int bcp_offset, bool giant_index = false);
// common code
......@@ -241,17 +233,17 @@ class InterpreterMacroAssembler: public MacroAssembler {
void check_for_regarea_stomp( Register Rindex, int offset, Register Rlimit, Register Rscratch, Register Rscratch1);
#endif // ASSERT
void store_local_int( Register index, Register src );
void store_local_ptr( Register index, Register src, Register tag = Otos_l2 );
void store_local_ptr( int n, Register src, Register tag = Otos_l2 );
void store_local_ptr( Register index, Register src );
void store_local_ptr( int n, Register src );
void store_local_long( Register index, Register src );
void store_local_float( Register index, FloatRegister src );
void store_local_double( Register index, FloatRegister src );
// Tagged stack helpers for swap and dup
void load_ptr_and_tag(int n, Register val, Register tag);
void store_ptr_and_tag(int n, Register val, Register tag);
// Helpers for swap and dup
void load_ptr(int n, Register val);
void store_ptr(int n, Register val);
// Tagged stack helper for getting receiver in register.
// Helper for getting receiver in register.
void load_receiver(Register param_count, Register recv);
static int top_most_monitor_byte_offset(); // offset in bytes to top of monitor block
......@@ -304,7 +296,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
void profile_not_taken_branch(Register scratch);
void profile_call(Register scratch);
void profile_final_call(Register scratch);
void profile_virtual_call(Register receiver, Register scratch);
void profile_virtual_call(Register receiver, Register scratch, bool receiver_can_be_null = false);
void profile_ret(TosState state, Register return_bci, Register scratch);
void profile_null_seen(Register scratch);
void profile_typecheck(Register klass, Register scratch);
......
/*
* Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1998-2010 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -43,19 +43,6 @@ void InterpreterRuntime::SignatureHandlerGenerator::pass_long() {
Argument jni_arg(jni_offset(), false);
Register Rtmp = O0;
#ifdef ASSERT
if (TaggedStackInterpreter) {
// check at least one tag is okay
Label ok;
__ ld_ptr(Llocals, Interpreter::local_tag_offset_in_bytes(offset() + 1), Rtmp);
__ cmp(Rtmp, G0);
__ brx(Assembler::equal, false, Assembler::pt, ok);
__ delayed()->nop();
__ stop("Native object has bad tag value");
__ bind(ok);
}
#endif // ASSERT
#ifdef _LP64
__ ldx(Llocals, Interpreter::local_offset_in_bytes(offset() + 1), Rtmp);
__ store_long_argument(Rtmp, jni_arg);
......@@ -107,18 +94,6 @@ void InterpreterRuntime::SignatureHandlerGenerator::pass_object() {
Address h_arg = Address(Llocals, Interpreter::local_offset_in_bytes(offset()));
__ ld_ptr(h_arg, Rtmp1);
#ifdef ASSERT
if (TaggedStackInterpreter) {
// check we have the obj and not the tag
Label ok;
__ mov(frame::TagReference, Rtmp3);
__ cmp(Rtmp1, Rtmp3);
__ brx(Assembler::notEqual, true, Assembler::pt, ok);
__ delayed()->nop();
__ stop("Native object passed tag by mistake");
__ bind(ok);
}
#endif // ASSERT
if (!do_NULL_check) {
__ add(h_arg.base(), h_arg.disp(), Rtmp2);
} else {
......@@ -168,17 +143,9 @@ class SlowSignatureHandler: public NativeSignatureIterator {
long_sig = 3
};
#ifdef ASSERT
void verify_tag(frame::Tag t) {
assert(!TaggedStackInterpreter ||
*(intptr_t*)(_from+Interpreter::local_tag_offset_in_bytes(0)) == t, "wrong tag");
}
#endif // ASSERT
virtual void pass_int() {
*_to++ = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
debug_only(verify_tag(frame::TagValue));
_from -= Interpreter::stackElementSize();
_from -= Interpreter::stackElementSize;
add_signature( non_float );
}
......@@ -186,31 +153,27 @@ class SlowSignatureHandler: public NativeSignatureIterator {
// pass address of from
intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0));
*_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
debug_only(verify_tag(frame::TagReference));
_from -= Interpreter::stackElementSize();
_from -= Interpreter::stackElementSize;
add_signature( non_float );
}
#ifdef _LP64
virtual void pass_float() {
*_to++ = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
debug_only(verify_tag(frame::TagValue));
_from -= Interpreter::stackElementSize();
_from -= Interpreter::stackElementSize;
add_signature( float_sig );
}
virtual void pass_double() {
*_to++ = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
debug_only(verify_tag(frame::TagValue));
_from -= 2*Interpreter::stackElementSize();
_from -= 2*Interpreter::stackElementSize;
add_signature( double_sig );
}
virtual void pass_long() {
_to[0] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
debug_only(verify_tag(frame::TagValue));
_to += 1;
_from -= 2*Interpreter::stackElementSize();
_from -= 2*Interpreter::stackElementSize;
add_signature( long_sig );
}
#else
......@@ -218,9 +181,8 @@ class SlowSignatureHandler: public NativeSignatureIterator {
virtual void pass_long() {
_to[0] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
_to[1] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(0));
debug_only(verify_tag(frame::TagValue));
_to += 2;
_from -= 2*Interpreter::stackElementSize();
_from -= 2*Interpreter::stackElementSize;
add_signature( non_float );
}
#endif // _LP64
......
......@@ -235,17 +235,15 @@ address InterpreterGenerator::generate_abstract_entry(void) {
}
// Method handle invoker
// Dispatch a method of the form java.dyn.MethodHandles::invoke(...)
address InterpreterGenerator::generate_method_handle_entry(void) {
if (!EnableMethodHandles) {
return generate_abstract_entry();
}
return generate_abstract_entry(); //6815692//
}
return MethodHandles::generate_method_handle_interpreter_entry(_masm);
}
//----------------------------------------------------------------------------------------------------
......
/*
* Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -24,33 +24,13 @@
public:
// Support for Tagged Stacks
static int expr_offset_in_bytes(int i) { return stackElementSize * i + wordSize; }
// Stack index relative to tos (which points at value)
static int expr_index_at(int i) {
return stackElementWords() * i;
}
static int expr_tag_index_at(int i) {
assert(TaggedStackInterpreter, "should not call this");
// tag is one word above java stack element
return stackElementWords() * i + 1;
}
static int expr_offset_in_bytes(int i) { return stackElementSize()*i + wordSize; }
static int expr_tag_offset_in_bytes (int i) {
assert(TaggedStackInterpreter, "should not call this");
return expr_offset_in_bytes(i) + wordSize;
}
static int expr_index_at(int i) { return stackElementWords * i; }
// Already negated by c++ interpreter
static int local_index_at(int i) {
assert(i<=0, "local direction already negated");
return stackElementWords() * i + (value_offset_in_bytes()/wordSize);
}
static int local_tag_index_at(int i) {
assert(i<=0, "local direction already negated");
assert(TaggedStackInterpreter, "should not call this");
return stackElementWords() * i + (tag_offset_in_bytes()/wordSize);
static int local_index_at(int i) {
assert(i <= 0, "local direction already negated");
return stackElementWords * i;
}
......@@ -547,17 +547,11 @@ class AdapterGenerator {
void set_Rdisp(Register r) { Rdisp = r; }
void patch_callers_callsite();
void tag_c2i_arg(frame::Tag t, Register base, int st_off, Register scratch);
// base+st_off points to top of argument
int arg_offset(const int st_off) { return st_off + Interpreter::value_offset_in_bytes(); }
int arg_offset(const int st_off) { return st_off; }
int next_arg_offset(const int st_off) {
return st_off - Interpreter::stackElementSize() + Interpreter::value_offset_in_bytes();
}
int tag_offset(const int st_off) { return st_off + Interpreter::tag_offset_in_bytes(); }
int next_tag_offset(const int st_off) {
return st_off - Interpreter::stackElementSize() + Interpreter::tag_offset_in_bytes();
return st_off - Interpreter::stackElementSize;
}
// Argument slot values may be loaded first into a register because
......@@ -565,9 +559,6 @@ class AdapterGenerator {
RegisterOrConstant arg_slot(const int st_off);
RegisterOrConstant next_arg_slot(const int st_off);
RegisterOrConstant tag_slot(const int st_off);
RegisterOrConstant next_tag_slot(const int st_off);
// Stores long into offset pointed to by base
void store_c2i_long(Register r, Register base,
const int st_off, bool is_stack);
......@@ -653,23 +644,6 @@ void AdapterGenerator::patch_callers_callsite() {
__ bind(L);
}
void AdapterGenerator::tag_c2i_arg(frame::Tag t, Register base, int st_off,
Register scratch) {
if (TaggedStackInterpreter) {
RegisterOrConstant slot = tag_slot(st_off);
// have to store zero because local slots can be reused (rats!)
if (t == frame::TagValue) {
__ st_ptr(G0, base, slot);
} else if (t == frame::TagCategory2) {
__ st_ptr(G0, base, slot);
__ st_ptr(G0, base, next_tag_slot(st_off));
} else {
__ mov(t, scratch);
__ st_ptr(scratch, base, slot);
}
}
}
RegisterOrConstant AdapterGenerator::arg_slot(const int st_off) {
RegisterOrConstant roc(arg_offset(st_off));
......@@ -682,17 +656,6 @@ RegisterOrConstant AdapterGenerator::next_arg_slot(const int st_off) {
}
RegisterOrConstant AdapterGenerator::tag_slot(const int st_off) {
RegisterOrConstant roc(tag_offset(st_off));
return __ ensure_simm13_or_reg(roc, Rdisp);
}
RegisterOrConstant AdapterGenerator::next_tag_slot(const int st_off) {
RegisterOrConstant roc(next_tag_offset(st_off));
return __ ensure_simm13_or_reg(roc, Rdisp);
}
// Stores long into offset pointed to by base
void AdapterGenerator::store_c2i_long(Register r, Register base,
const int st_off, bool is_stack) {
......@@ -718,19 +681,16 @@ void AdapterGenerator::store_c2i_long(Register r, Register base,
}
#endif // COMPILER2
#endif // _LP64
tag_c2i_arg(frame::TagCategory2, base, st_off, r);
}
void AdapterGenerator::store_c2i_object(Register r, Register base,
const int st_off) {
__ st_ptr (r, base, arg_slot(st_off));
tag_c2i_arg(frame::TagReference, base, st_off, r);
}
void AdapterGenerator::store_c2i_int(Register r, Register base,
const int st_off) {
__ st (r, base, arg_slot(st_off));
tag_c2i_arg(frame::TagValue, base, st_off, r);
}
// Stores into offset pointed to by base
......@@ -745,13 +705,11 @@ void AdapterGenerator::store_c2i_double(VMReg r_2,
__ stf(FloatRegisterImpl::S, r_1->as_FloatRegister(), base, next_arg_slot(st_off));
__ stf(FloatRegisterImpl::S, r_2->as_FloatRegister(), base, arg_slot(st_off) );
#endif
tag_c2i_arg(frame::TagCategory2, base, st_off, G1_scratch);
}
void AdapterGenerator::store_c2i_float(FloatRegister f, Register base,
const int st_off) {
__ stf(FloatRegisterImpl::S, f, base, arg_slot(st_off));
tag_c2i_arg(frame::TagValue, base, st_off, G1_scratch);
}
void AdapterGenerator::gen_c2i_adapter(
......@@ -786,14 +744,14 @@ void AdapterGenerator::gen_c2i_adapter(
// Since all args are passed on the stack, total_args_passed*wordSize is the
// space we need. Add in varargs area needed by the interpreter. Round up
// to stack alignment.
const int arg_size = total_args_passed * Interpreter::stackElementSize();
const int arg_size = total_args_passed * Interpreter::stackElementSize;
const int varargs_area =
(frame::varargs_offset - frame::register_save_words)*wordSize;
const int extraspace = round_to(arg_size + varargs_area, 2*wordSize);
int bias = STACK_BIAS;
const int interp_arg_offset = frame::varargs_offset*wordSize +
(total_args_passed-1)*Interpreter::stackElementSize();
(total_args_passed-1)*Interpreter::stackElementSize;
Register base = SP;
......@@ -814,7 +772,7 @@ void AdapterGenerator::gen_c2i_adapter(
// First write G1 (if used) to where ever it must go
for (int i=0; i<total_args_passed; i++) {
const int st_off = interp_arg_offset - (i*Interpreter::stackElementSize()) + bias;
const int st_off = interp_arg_offset - (i*Interpreter::stackElementSize) + bias;
VMReg r_1 = regs[i].first();
VMReg r_2 = regs[i].second();
if (r_1 == G1_scratch->as_VMReg()) {
......@@ -831,7 +789,7 @@ void AdapterGenerator::gen_c2i_adapter(
// Now write the args into the outgoing interpreter space
for (int i=0; i<total_args_passed; i++) {
const int st_off = interp_arg_offset - (i*Interpreter::stackElementSize()) + bias;
const int st_off = interp_arg_offset - (i*Interpreter::stackElementSize) + bias;
VMReg r_1 = regs[i].first();
VMReg r_2 = regs[i].second();
if (!r_1->is_valid()) {
......@@ -900,7 +858,7 @@ void AdapterGenerator::gen_c2i_adapter(
#endif // _LP64
__ mov((frame::varargs_offset)*wordSize -
1*Interpreter::stackElementSize()+bias+BytesPerWord, G1);
1*Interpreter::stackElementSize+bias+BytesPerWord, G1);
// Jump to the interpreter just as if interpreter was doing it.
__ jmpl(G3_scratch, 0, G0);
// Setup Lesp for the call. Cannot actually set Lesp as the current Lesp
......@@ -1051,7 +1009,7 @@ void AdapterGenerator::gen_i2c_adapter(
// ldx/lddf optimizations.
// Load in argument order going down.
const int ld_off = (total_args_passed-i)*Interpreter::stackElementSize();
const int ld_off = (total_args_passed-i)*Interpreter::stackElementSize;
set_Rdisp(G1_scratch);
VMReg r_1 = regs[i].first();
......@@ -1120,7 +1078,7 @@ void AdapterGenerator::gen_i2c_adapter(
for (int i=0; i<total_args_passed; i++) {
if (regs[i].first()->is_Register() && regs[i].second()->is_valid()) {
// Load in argument order going down
int ld_off = (total_args_passed-i)*Interpreter::stackElementSize();
int ld_off = (total_args_passed-i)*Interpreter::stackElementSize;
// Need to marshal 64-bit value from misaligned Lesp loads
Register r = regs[i].first()->as_Register()->after_restore();
if (r == G1 || r == G4) {
......@@ -3062,7 +3020,7 @@ int Deoptimization::last_frame_adjust(int callee_parameters, int callee_locals)
"test and remove; got more parms than locals");
if (callee_locals < callee_parameters)
return 0; // No adjustment for negative locals
int diff = (callee_locals - callee_parameters) * Interpreter::stackElementWords();
int diff = (callee_locals - callee_parameters) * Interpreter::stackElementWords;
return round_to(diff, WordsPerLong);
}
......
......@@ -139,7 +139,7 @@ class StubGenerator: public StubCodeGenerator {
__ ld_ptr(parameter_size.as_address(), t); // get parameter size (in words)
__ add(t, frame::memory_parameter_word_sp_offset, t); // add space for save area (in words)
__ round_to(t, WordsPerLong); // make sure it is multiple of 2 (in words)
__ sll(t, Interpreter::logStackElementSize(), t); // compute number of bytes
__ sll(t, Interpreter::logStackElementSize, t); // compute number of bytes
__ neg(t); // negate so it can be used with save
__ save(SP, t, SP); // setup new frame
}
......@@ -191,19 +191,13 @@ class StubGenerator: public StubCodeGenerator {
// copy parameters if any
Label loop;
__ BIND(loop);
// Store tag first.
if (TaggedStackInterpreter) {
__ ld_ptr(src, 0, tmp);
__ add(src, BytesPerWord, src); // get next
__ st_ptr(tmp, dst, Interpreter::tag_offset_in_bytes());
}
// Store parameter value
__ ld_ptr(src, 0, tmp);
__ add(src, BytesPerWord, src);
__ st_ptr(tmp, dst, Interpreter::value_offset_in_bytes());
__ st_ptr(tmp, dst, 0);
__ deccc(cnt);
__ br(Assembler::greater, false, Assembler::pt, loop);
__ delayed()->sub(dst, Interpreter::stackElementSize(), dst);
__ delayed()->sub(dst, Interpreter::stackElementSize, dst);
// done
__ BIND(exit);
......@@ -220,7 +214,7 @@ class StubGenerator: public StubCodeGenerator {
// setup parameters
const Register t = G3_scratch;
__ ld_ptr(parameter_size.as_in().as_address(), t); // get parameter size (in words)
__ sll(t, Interpreter::logStackElementSize(), t); // compute number of bytes
__ sll(t, Interpreter::logStackElementSize, t); // compute number of bytes
__ sub(FP, t, Gargs); // setup parameter pointer
#ifdef _LP64
__ add( Gargs, STACK_BIAS, Gargs ); // Account for LP64 stack bias
......@@ -2917,6 +2911,16 @@ class StubGenerator: public StubCodeGenerator {
// arraycopy stubs used by compilers
generate_arraycopy_stubs();
// generic method handle stubs
if (EnableMethodHandles && SystemDictionary::MethodHandle_klass() != NULL) {
for (MethodHandles::EntryKind ek = MethodHandles::_EK_FIRST;
ek < MethodHandles::_EK_LIMIT;
ek = MethodHandles::EntryKind(1 + (int)ek)) {
StubCodeMark mark(this, "MethodHandle", MethodHandles::entry_name(ek));
MethodHandles::generate_method_handle_stub(_masm, ek);
}
}
// Don't initialize the platform math functions since sparc
// doesn't have intrinsics for these operations.
}
......
......@@ -151,8 +151,10 @@ address TemplateInterpreterGenerator::generate_StackOverflowError_handler() {
address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) {
address compiled_entry = __ pc();
TosState incoming_state = state;
Label cont;
address compiled_entry = __ pc();
address entry = __ pc();
#if !defined(_LP64) && defined(COMPILER2)
......@@ -165,12 +167,11 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state,
// do this here. Unfortunately if we did a rethrow we'd see an machepilog node
// first which would move g1 -> O0/O1 and destroy the exception we were throwing.
if( state == ltos ) {
__ srl (G1, 0,O1);
__ srlx(G1,32,O0);
if (incoming_state == ltos) {
__ srl (G1, 0, O1);
__ srlx(G1, 32, O0);
}
#endif /* !_LP64 && COMPILER2 */
#endif // !_LP64 && COMPILER2
__ bind(cont);
......@@ -182,17 +183,32 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state,
__ mov(Llast_SP, SP); // Remove any adapter added stack space.
Label L_got_cache, L_giant_index;
const Register cache = G3_scratch;
const Register size = G1_scratch;
if (EnableInvokeDynamic) {
__ ldub(Address(Lbcp, 0), G1_scratch); // Load current bytecode.
__ cmp(G1_scratch, Bytecodes::_invokedynamic);
__ br(Assembler::equal, false, Assembler::pn, L_giant_index);
__ delayed()->nop();
}
__ get_cache_and_index_at_bcp(cache, G1_scratch, 1);
__ bind(L_got_cache);
__ ld_ptr(cache, constantPoolCacheOopDesc::base_offset() +
ConstantPoolCacheEntry::flags_offset(), size);
__ and3(size, 0xFF, size); // argument size in words
__ sll(size, Interpreter::logStackElementSize(), size); // each argument size in bytes
__ sll(size, Interpreter::logStackElementSize, size); // each argument size in bytes
__ add(Lesp, size, Lesp); // pop arguments
__ dispatch_next(state, step);
// out of the main line of code...
if (EnableInvokeDynamic) {
__ bind(L_giant_index);
__ get_cache_and_index_at_bcp(cache, G1_scratch, 1, true);
__ ba(false, L_got_cache);
__ delayed()->nop();
}
return entry;
}
......@@ -479,7 +495,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
// Set the saved SP after the register window save
//
assert_different_registers(Gargs, Glocals_size, Gframe_size, O5_savedSP);
__ sll(Glocals_size, Interpreter::logStackElementSize(), Otmp1);
__ sll(Glocals_size, Interpreter::logStackElementSize, Otmp1);
__ add(Gargs, Otmp1, Gargs);
if (native_call) {
......@@ -495,7 +511,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
__ lduh( size_of_locals, Otmp1 );
__ sub( Otmp1, Glocals_size, Glocals_size );
__ round_to( Glocals_size, WordsPerLong );
__ sll( Glocals_size, Interpreter::logStackElementSize(), Glocals_size );
__ sll( Glocals_size, Interpreter::logStackElementSize, Glocals_size );
// see if the frame is greater than one page in size. If so,
// then we need to verify there is enough stack space remaining
......@@ -503,7 +519,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
__ lduh( max_stack, Gframe_size );
__ add( Gframe_size, extra_space, Gframe_size );
__ round_to( Gframe_size, WordsPerLong );
__ sll( Gframe_size, Interpreter::logStackElementSize(), Gframe_size);
__ sll( Gframe_size, Interpreter::logStackElementSize, Gframe_size);
// Add in java locals size for stack overflow check only
__ add( Gframe_size, Glocals_size, Gframe_size );
......@@ -1218,8 +1234,8 @@ address InterpreterGenerator::generate_normal_entry(bool synchronized) {
// be updated!
__ lduh( size_of_locals, O2 );
__ lduh( size_of_parameters, O1 );
__ sll( O2, Interpreter::logStackElementSize(), O2);
__ sll( O1, Interpreter::logStackElementSize(), O1 );
__ sll( O2, Interpreter::logStackElementSize, O2);
__ sll( O1, Interpreter::logStackElementSize, O1 );
__ sub( Llocals, O2, O2 );
__ sub( Llocals, O1, O1 );
......@@ -1454,8 +1470,8 @@ static int size_activation_helper(int callee_extra_locals, int max_stack, int mo
round_to(frame::interpreter_frame_vm_local_words,WordsPerLong);
// callee_locals and max_stack are counts, not the size in frame.
const int locals_size =
round_to(callee_extra_locals * Interpreter::stackElementWords(), WordsPerLong);
const int max_stack_words = max_stack * Interpreter::stackElementWords();
round_to(callee_extra_locals * Interpreter::stackElementWords, WordsPerLong);
const int max_stack_words = max_stack * Interpreter::stackElementWords;
return (round_to((max_stack_words
//6815692//+ methodOopDesc::extra_stack_words()
+ rounded_vm_local_words
......@@ -1554,11 +1570,11 @@ int AbstractInterpreter::layout_activation(methodOop method,
// preallocate stack space
intptr_t* esp = monitors - 1 -
(tempcount * Interpreter::stackElementWords()) -
(tempcount * Interpreter::stackElementWords) -
popframe_extra_args;
int local_words = method->max_locals() * Interpreter::stackElementWords();
int parm_words = method->size_of_parameters() * Interpreter::stackElementWords();
int local_words = method->max_locals() * Interpreter::stackElementWords;
int parm_words = method->size_of_parameters() * Interpreter::stackElementWords;
NEEDS_CLEANUP;
intptr_t* locals;
if (caller->is_interpreted_frame()) {
......@@ -1646,7 +1662,7 @@ int AbstractInterpreter::layout_activation(methodOop method,
BasicObjectLock* mp = (BasicObjectLock*)monitors;
assert(interpreter_frame->interpreter_frame_method() == method, "method matches");
assert(interpreter_frame->interpreter_frame_local_at(9) == (intptr_t *)((intptr_t)locals - (9 * Interpreter::stackElementSize())+Interpreter::value_offset_in_bytes()), "locals match");
assert(interpreter_frame->interpreter_frame_local_at(9) == (intptr_t *)((intptr_t)locals - (9 * Interpreter::stackElementSize)), "locals match");
assert(interpreter_frame->interpreter_frame_monitor_end() == mp, "monitor_end matches");
assert(((intptr_t *)interpreter_frame->interpreter_frame_monitor_begin()) == ((intptr_t *)mp)+monitor_size, "monitor_begin matches");
assert(interpreter_frame->interpreter_frame_tos_address()-1 == esp, "esp matches");
......@@ -1742,7 +1758,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
// Compute size of arguments for saving when returning to deoptimized caller
__ lduh(Lmethod, in_bytes(methodOopDesc::size_of_parameters_offset()), Gtmp1);
__ sll(Gtmp1, Interpreter::logStackElementSize(), Gtmp1);
__ sll(Gtmp1, Interpreter::logStackElementSize, Gtmp1);
__ sub(Llocals, Gtmp1, Gtmp2);
__ add(Gtmp2, wordSize, Gtmp2);
// Save these arguments
......
/*
* Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -29,7 +29,8 @@
// fail with a guarantee ("not enough space for interpreter generation");
// if too small.
// Run with +PrintInterpreter to get the VM to print out the size.
// Max size with JVMTI and TaggedStackInterpreter
// Max size with JVMTI
#ifdef _LP64
// The sethi() instruction generates lots more instructions when shell
// stack limit is unlimited, so that's why this is much bigger.
......
/*
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -580,7 +580,6 @@ void TemplateTable::saload() {
void TemplateTable::iload(int n) {
transition(vtos, itos);
debug_only(__ verify_local_tag(frame::TagValue, Llocals, Otos_i, n));
__ ld( Llocals, Interpreter::local_offset_in_bytes(n), Otos_i );
}
......@@ -588,7 +587,6 @@ void TemplateTable::iload(int n) {
void TemplateTable::lload(int n) {
transition(vtos, ltos);
assert(n+1 < Argument::n_register_parameters, "would need more code");
debug_only(__ verify_local_tag(frame::TagCategory2, Llocals, Otos_l, n));
__ load_unaligned_long(Llocals, Interpreter::local_offset_in_bytes(n+1), Otos_l);
}
......@@ -596,7 +594,6 @@ void TemplateTable::lload(int n) {
void TemplateTable::fload(int n) {
transition(vtos, ftos);
assert(n < Argument::n_register_parameters, "would need more code");
debug_only(__ verify_local_tag(frame::TagValue, Llocals, G3_scratch, n));
__ ldf( FloatRegisterImpl::S, Llocals, Interpreter::local_offset_in_bytes(n), Ftos_f );
}
......@@ -604,14 +601,12 @@ void TemplateTable::fload(int n) {
void TemplateTable::dload(int n) {
transition(vtos, dtos);
FloatRegister dst = Ftos_d;
debug_only(__ verify_local_tag(frame::TagCategory2, Llocals, G3_scratch, n));
__ load_unaligned_double(Llocals, Interpreter::local_offset_in_bytes(n+1), dst);
}
void TemplateTable::aload(int n) {
transition(vtos, atos);
debug_only(__ verify_local_tag(frame::TagReference, Llocals, Otos_i, n));
__ ld_ptr( Llocals, Interpreter::local_offset_in_bytes(n), Otos_i );
}
......@@ -707,12 +702,11 @@ void TemplateTable::dstore() {
void TemplateTable::astore() {
transition(vtos, vtos);
// astore tos can also be a returnAddress, so load and store the tag too
__ load_ptr_and_tag(0, Otos_i, Otos_l2);
__ inc(Lesp, Interpreter::stackElementSize());
__ load_ptr(0, Otos_i);
__ inc(Lesp, Interpreter::stackElementSize);
__ verify_oop_or_return_address(Otos_i, G3_scratch);
locals_index(G3_scratch);
__ store_local_ptr( G3_scratch, Otos_i, Otos_l2 );
__ store_local_ptr(G3_scratch, Otos_i);
}
......@@ -750,12 +744,11 @@ void TemplateTable::wide_dstore() {
void TemplateTable::wide_astore() {
transition(vtos, vtos);
// astore tos can also be a returnAddress, so load and store the tag too
__ load_ptr_and_tag(0, Otos_i, Otos_l2);
__ inc(Lesp, Interpreter::stackElementSize());
__ load_ptr(0, Otos_i);
__ inc(Lesp, Interpreter::stackElementSize);
__ verify_oop_or_return_address(Otos_i, G3_scratch);
locals_index_wide(G3_scratch);
__ store_local_ptr( G3_scratch, Otos_i, Otos_l2 );
__ store_local_ptr(G3_scratch, Otos_i);
}
......@@ -845,13 +838,13 @@ void TemplateTable::aastore() {
do_oop_store(_masm, O1, noreg, arrayOopDesc::base_offset_in_bytes(T_OBJECT), Otos_i, G3_scratch, _bs->kind(), true);
__ ba(false,done);
__ delayed()->inc(Lesp, 3* Interpreter::stackElementSize()); // adj sp (pops array, index and value)
__ delayed()->inc(Lesp, 3* Interpreter::stackElementSize); // adj sp (pops array, index and value)
__ bind(is_null);
do_oop_store(_masm, O1, noreg, arrayOopDesc::base_offset_in_bytes(T_OBJECT), G0, G4_scratch, _bs->kind(), true);
__ profile_null_seen(G3_scratch);
__ inc(Lesp, 3* Interpreter::stackElementSize()); // adj sp (pops array, index and value)
__ inc(Lesp, 3* Interpreter::stackElementSize); // adj sp (pops array, index and value)
__ bind(done);
}
......@@ -884,7 +877,6 @@ void TemplateTable::sastore() {
void TemplateTable::istore(int n) {
transition(itos, vtos);
__ tag_local(frame::TagValue, Llocals, Otos_i, n);
__ st(Otos_i, Llocals, Interpreter::local_offset_in_bytes(n));
}
......@@ -892,7 +884,6 @@ void TemplateTable::istore(int n) {
void TemplateTable::lstore(int n) {
transition(ltos, vtos);
assert(n+1 < Argument::n_register_parameters, "only handle register cases");
__ tag_local(frame::TagCategory2, Llocals, Otos_l, n);
__ store_unaligned_long(Otos_l, Llocals, Interpreter::local_offset_in_bytes(n+1));
}
......@@ -901,7 +892,6 @@ void TemplateTable::lstore(int n) {
void TemplateTable::fstore(int n) {
transition(ftos, vtos);
assert(n < Argument::n_register_parameters, "only handle register cases");
__ tag_local(frame::TagValue, Llocals, Otos_l, n);
__ stf(FloatRegisterImpl::S, Ftos_f, Llocals, Interpreter::local_offset_in_bytes(n));
}
......@@ -909,30 +899,28 @@ void TemplateTable::fstore(int n) {
void TemplateTable::dstore(int n) {
transition(dtos, vtos);
FloatRegister src = Ftos_d;
__ tag_local(frame::TagCategory2, Llocals, Otos_l, n);
__ store_unaligned_double(src, Llocals, Interpreter::local_offset_in_bytes(n+1));
}
void TemplateTable::astore(int n) {
transition(vtos, vtos);
// astore tos can also be a returnAddress, so load and store the tag too
__ load_ptr_and_tag(0, Otos_i, Otos_l2);
__ inc(Lesp, Interpreter::stackElementSize());
__ load_ptr(0, Otos_i);
__ inc(Lesp, Interpreter::stackElementSize);
__ verify_oop_or_return_address(Otos_i, G3_scratch);
__ store_local_ptr( n, Otos_i, Otos_l2 );
__ store_local_ptr(n, Otos_i);
}
void TemplateTable::pop() {
transition(vtos, vtos);
__ inc(Lesp, Interpreter::stackElementSize());
__ inc(Lesp, Interpreter::stackElementSize);
}
void TemplateTable::pop2() {
transition(vtos, vtos);
__ inc(Lesp, 2 * Interpreter::stackElementSize());
__ inc(Lesp, 2 * Interpreter::stackElementSize);
}
......@@ -940,8 +928,8 @@ void TemplateTable::dup() {
transition(vtos, vtos);
// stack: ..., a
// load a and tag
__ load_ptr_and_tag(0, Otos_i, Otos_l2);
__ push_ptr(Otos_i, Otos_l2);
__ load_ptr(0, Otos_i);
__ push_ptr(Otos_i);
// stack: ..., a, a
}
......@@ -949,11 +937,11 @@ void TemplateTable::dup() {
void TemplateTable::dup_x1() {
transition(vtos, vtos);
// stack: ..., a, b
__ load_ptr_and_tag(1, G3_scratch, G4_scratch); // get a
__ load_ptr_and_tag(0, Otos_l1, Otos_l2); // get b
__ store_ptr_and_tag(1, Otos_l1, Otos_l2); // put b
__ store_ptr_and_tag(0, G3_scratch, G4_scratch); // put a - like swap
__ push_ptr(Otos_l1, Otos_l2); // push b
__ load_ptr( 1, G3_scratch); // get a
__ load_ptr( 0, Otos_l1); // get b
__ store_ptr(1, Otos_l1); // put b
__ store_ptr(0, G3_scratch); // put a - like swap
__ push_ptr(Otos_l1); // push b
// stack: ..., b, a, b
}
......@@ -962,27 +950,27 @@ void TemplateTable::dup_x2() {
transition(vtos, vtos);
// stack: ..., a, b, c
// get c and push on stack, reuse registers
__ load_ptr_and_tag(0, G3_scratch, G4_scratch); // get c
__ push_ptr(G3_scratch, G4_scratch); // push c with tag
__ load_ptr( 0, G3_scratch); // get c
__ push_ptr(G3_scratch); // push c with tag
// stack: ..., a, b, c, c (c in reg) (Lesp - 4)
// (stack offsets n+1 now)
__ load_ptr_and_tag(3, Otos_l1, Otos_l2); // get a
__ store_ptr_and_tag(3, G3_scratch, G4_scratch); // put c at 3
__ load_ptr( 3, Otos_l1); // get a
__ store_ptr(3, G3_scratch); // put c at 3
// stack: ..., c, b, c, c (a in reg)
__ load_ptr_and_tag(2, G3_scratch, G4_scratch); // get b
__ store_ptr_and_tag(2, Otos_l1, Otos_l2); // put a at 2
__ load_ptr( 2, G3_scratch); // get b
__ store_ptr(2, Otos_l1); // put a at 2
// stack: ..., c, a, c, c (b in reg)
__ store_ptr_and_tag(1, G3_scratch, G4_scratch); // put b at 1
__ store_ptr(1, G3_scratch); // put b at 1
// stack: ..., c, a, b, c
}
void TemplateTable::dup2() {
transition(vtos, vtos);
__ load_ptr_and_tag(1, G3_scratch, G4_scratch); // get a
__ load_ptr_and_tag(0, Otos_l1, Otos_l2); // get b
__ push_ptr(G3_scratch, G4_scratch); // push a
__ push_ptr(Otos_l1, Otos_l2); // push b
__ load_ptr(1, G3_scratch); // get a
__ load_ptr(0, Otos_l1); // get b
__ push_ptr(G3_scratch); // push a
__ push_ptr(Otos_l1); // push b
// stack: ..., a, b, a, b
}
......@@ -990,17 +978,17 @@ void TemplateTable::dup2() {
void TemplateTable::dup2_x1() {
transition(vtos, vtos);
// stack: ..., a, b, c
__ load_ptr_and_tag(1, Lscratch, G1_scratch); // get b
__ load_ptr_and_tag(2, Otos_l1, Otos_l2); // get a
__ store_ptr_and_tag(2, Lscratch, G1_scratch); // put b at a
__ load_ptr( 1, Lscratch); // get b
__ load_ptr( 2, Otos_l1); // get a
__ store_ptr(2, Lscratch); // put b at a
// stack: ..., b, b, c
__ load_ptr_and_tag(0, G3_scratch, G4_scratch); // get c
__ store_ptr_and_tag(1, G3_scratch, G4_scratch); // put c at b
__ load_ptr( 0, G3_scratch); // get c
__ store_ptr(1, G3_scratch); // put c at b
// stack: ..., b, c, c
__ store_ptr_and_tag(0, Otos_l1, Otos_l2); // put a at c
__ store_ptr(0, Otos_l1); // put a at c
// stack: ..., b, c, a
__ push_ptr(Lscratch, G1_scratch); // push b
__ push_ptr(G3_scratch, G4_scratch); // push c
__ push_ptr(Lscratch); // push b
__ push_ptr(G3_scratch); // push c
// stack: ..., b, c, a, b, c
}
......@@ -1010,18 +998,18 @@ void TemplateTable::dup2_x1() {
void TemplateTable::dup2_x2() {
transition(vtos, vtos);
// stack: ..., a, b, c, d
__ load_ptr_and_tag(1, Lscratch, G1_scratch); // get c
__ load_ptr_and_tag(3, Otos_l1, Otos_l2); // get a
__ store_ptr_and_tag(3, Lscratch, G1_scratch); // put c at 3
__ store_ptr_and_tag(1, Otos_l1, Otos_l2); // put a at 1
__ load_ptr( 1, Lscratch); // get c
__ load_ptr( 3, Otos_l1); // get a
__ store_ptr(3, Lscratch); // put c at 3
__ store_ptr(1, Otos_l1); // put a at 1
// stack: ..., c, b, a, d
__ load_ptr_and_tag(2, G3_scratch, G4_scratch); // get b
__ load_ptr_and_tag(0, Otos_l1, Otos_l2); // get d
__ store_ptr_and_tag(0, G3_scratch, G4_scratch); // put b at 0
__ store_ptr_and_tag(2, Otos_l1, Otos_l2); // put d at 2
__ load_ptr( 2, G3_scratch); // get b
__ load_ptr( 0, Otos_l1); // get d
__ store_ptr(0, G3_scratch); // put b at 0
__ store_ptr(2, Otos_l1); // put d at 2
// stack: ..., c, d, a, b
__ push_ptr(Lscratch, G1_scratch); // push c
__ push_ptr(Otos_l1, Otos_l2); // push d
__ push_ptr(Lscratch); // push c
__ push_ptr(Otos_l1); // push d
// stack: ..., c, d, a, b, c, d
}
......@@ -1029,10 +1017,10 @@ void TemplateTable::dup2_x2() {
void TemplateTable::swap() {
transition(vtos, vtos);
// stack: ..., a, b
__ load_ptr_and_tag(1, G3_scratch, G4_scratch); // get a
__ load_ptr_and_tag(0, Otos_l1, Otos_l2); // get b
__ store_ptr_and_tag(0, G3_scratch, G4_scratch); // put b
__ store_ptr_and_tag(1, Otos_l1, Otos_l2); // put a
__ load_ptr( 1, G3_scratch); // get a
__ load_ptr( 0, Otos_l1); // get b
__ store_ptr(0, G3_scratch); // put b
__ store_ptr(1, Otos_l1); // put a
// stack: ..., b, a
}
......@@ -1045,9 +1033,9 @@ void TemplateTable::iop2(Operation op) {
case sub: __ sub(O1, Otos_i, Otos_i); break;
// %%%%% Mul may not exist: better to call .mul?
case mul: __ smul(O1, Otos_i, Otos_i); break;
case _and: __ and3(O1, Otos_i, Otos_i); break;
case _or: __ or3(O1, Otos_i, Otos_i); break;
case _xor: __ xor3(O1, Otos_i, Otos_i); break;
case _and: __ and3(O1, Otos_i, Otos_i); break;
case _or: __ or3(O1, Otos_i, Otos_i); break;
case _xor: __ xor3(O1, Otos_i, Otos_i); break;
case shl: __ sll(O1, Otos_i, Otos_i); break;
case shr: __ sra(O1, Otos_i, Otos_i); break;
case ushr: __ srl(O1, Otos_i, Otos_i); break;
......@@ -1061,17 +1049,17 @@ void TemplateTable::lop2(Operation op) {
__ pop_l(O2);
switch (op) {
#ifdef _LP64
case add: __ add(O2, Otos_l, Otos_l); break;
case sub: __ sub(O2, Otos_l, Otos_l); break;
case _and: __ and3( O2, Otos_l, Otos_l); break;
case _or: __ or3( O2, Otos_l, Otos_l); break;
case _xor: __ xor3( O2, Otos_l, Otos_l); break;
case add: __ add(O2, Otos_l, Otos_l); break;
case sub: __ sub(O2, Otos_l, Otos_l); break;
case _and: __ and3(O2, Otos_l, Otos_l); break;
case _or: __ or3(O2, Otos_l, Otos_l); break;
case _xor: __ xor3(O2, Otos_l, Otos_l); break;
#else
case add: __ addcc(O3, Otos_l2, Otos_l2); __ addc(O2, Otos_l1, Otos_l1); break;
case sub: __ subcc(O3, Otos_l2, Otos_l2); __ subc(O2, Otos_l1, Otos_l1); break;
case _and: __ and3( O3, Otos_l2, Otos_l2); __ and3( O2, Otos_l1, Otos_l1); break;
case _or: __ or3( O3, Otos_l2, Otos_l2); __ or3( O2, Otos_l1, Otos_l1); break;
case _xor: __ xor3( O3, Otos_l2, Otos_l2); __ xor3( O2, Otos_l1, Otos_l1); break;
case _and: __ and3(O3, Otos_l2, Otos_l2); __ and3(O2, Otos_l1, Otos_l1); break;
case _or: __ or3(O3, Otos_l2, Otos_l2); __ or3(O2, Otos_l1, Otos_l1); break;
case _xor: __ xor3(O3, Otos_l2, Otos_l2); __ xor3(O2, Otos_l1, Otos_l1); break;
#endif
default: ShouldNotReachHere();
}
......@@ -1307,7 +1295,7 @@ void TemplateTable::iinc() {
__ ldsb(Lbcp, 2, O2); // load constant
__ access_local_int(G3_scratch, Otos_i);
__ add(Otos_i, O2, Otos_i);
__ st(Otos_i, G3_scratch, Interpreter::value_offset_in_bytes()); // access_local_int puts E.A. in G3_scratch
__ st(Otos_i, G3_scratch, 0); // access_local_int puts E.A. in G3_scratch
}
......@@ -1317,7 +1305,7 @@ void TemplateTable::wide_iinc() {
__ get_2_byte_integer_at_bcp( 4, O2, O3, InterpreterMacroAssembler::Signed);
__ access_local_int(G3_scratch, Otos_i);
__ add(Otos_i, O3, Otos_i);
__ st(Otos_i, G3_scratch, Interpreter::value_offset_in_bytes()); // access_local_int puts E.A. in G3_scratch
__ st(Otos_i, G3_scratch, 0); // access_local_int puts E.A. in G3_scratch
}
......@@ -1555,7 +1543,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
// Bump Lbcp to target of JSR
__ add(Lbcp, O1_disp, Lbcp);
// Push returnAddress for "ret" on stack
__ push_ptr(Otos_i, G0); // push ptr sized thing plus 0 for tag.
__ push_ptr(Otos_i);
// And away we go!
__ dispatch_next(vtos);
return;
......@@ -1963,19 +1951,30 @@ void TemplateTable::volatile_barrier(Assembler::Membar_mask_bits order_constrain
// ----------------------------------------------------------------------------
void TemplateTable::resolve_cache_and_index(int byte_no, Register Rcache, Register index) {
assert(byte_no == 1 || byte_no == 2, "byte_no out of range");
bool is_invokedynamic = (bytecode() == Bytecodes::_invokedynamic);
// Depends on cpCacheOop layout!
const int shift_count = (1 + byte_no)*BitsPerByte;
Label resolved;
__ get_cache_and_index_at_bcp(Rcache, index, 1);
__ ld_ptr(Rcache, constantPoolCacheOopDesc::base_offset() +
ConstantPoolCacheEntry::indices_offset(), Lbyte_code);
__ get_cache_and_index_at_bcp(Rcache, index, 1, is_invokedynamic);
if (is_invokedynamic) {
// We are resolved if the f1 field contains a non-null CallSite object.
__ ld_ptr(Rcache, constantPoolCacheOopDesc::base_offset() +
ConstantPoolCacheEntry::f1_offset(), Lbyte_code);
__ tst(Lbyte_code);
__ br(Assembler::notEqual, false, Assembler::pt, resolved);
__ delayed()->set((int)bytecode(), O1);
} else {
__ ld_ptr(Rcache, constantPoolCacheOopDesc::base_offset() +
ConstantPoolCacheEntry::indices_offset(), Lbyte_code);
__ srl( Lbyte_code, shift_count, Lbyte_code );
__ and3( Lbyte_code, 0xFF, Lbyte_code );
__ cmp( Lbyte_code, (int)bytecode());
__ br( Assembler::equal, false, Assembler::pt, resolved);
__ delayed()->set((int)bytecode(), O1);
__ srl( Lbyte_code, shift_count, Lbyte_code );
__ and3( Lbyte_code, 0xFF, Lbyte_code );
__ cmp( Lbyte_code, (int)bytecode());
__ br( Assembler::equal, false, Assembler::pt, resolved);
__ delayed()->set((int)bytecode(), O1);
}
address entry;
switch (bytecode()) {
......@@ -1987,12 +1986,13 @@ void TemplateTable::resolve_cache_and_index(int byte_no, Register Rcache, Regist
case Bytecodes::_invokespecial : // fall through
case Bytecodes::_invokestatic : // fall through
case Bytecodes::_invokeinterface: entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invoke); break;
case Bytecodes::_invokedynamic : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokedynamic); break;
default : ShouldNotReachHere(); break;
}
// first time invocation - must resolve first
__ call_VM(noreg, entry, O1);
// Update registers with resolved info
__ get_cache_and_index_at_bcp(Rcache, index, 1);
__ get_cache_and_index_at_bcp(Rcache, index, 1, is_invokedynamic);
__ bind(resolved);
}
......@@ -2742,7 +2742,7 @@ void TemplateTable::fast_xaccess(TosState state) {
Register Rflags = G4_scratch;
Register Rreceiver = Lscratch;
__ ld_ptr(Llocals, Interpreter::value_offset_in_bytes(), Rreceiver);
__ ld_ptr(Llocals, 0, Rreceiver);
// access constant pool cache (is resolved)
__ get_cache_and_index_at_bcp(Rcache, G4_scratch, 2);
......@@ -3130,7 +3130,42 @@ void TemplateTable::invokedynamic(int byte_no) {
return;
}
__ stop("invokedynamic NYI");//6815692//
// G5: CallSite object (f1)
// XX: unused (f2)
// G3: receiver address
// XX: flags (unused)
Register G5_callsite = G5_method;
Register Rscratch = G3_scratch;
Register Rtemp = G1_scratch;
Register Rret = Lscratch;
load_invoke_cp_cache_entry(byte_no, G5_callsite, noreg, Rret, false);
__ mov(SP, O5_savedSP); // record SP that we wanted the callee to restore
__ verify_oop(G5_callsite);
// profile this call
__ profile_call(O4);
// get return address
AddressLiteral table(Interpreter::return_5_addrs_by_index_table());
__ set(table, Rtemp);
__ srl(Rret, ConstantPoolCacheEntry::tosBits, Rret); // get return type
// Make sure we don't need to mask Rret for tosBits after the above shift
ConstantPoolCacheEntry::verify_tosBits();
__ sll(Rret, LogBytesPerWord, Rret);
__ ld_ptr(Rtemp, Rret, Rret); // get return address
__ ld_ptr(G5_callsite, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, Rscratch), G3_method_handle);
__ null_check(G3_method_handle);
// Adjust Rret first so Llast_SP can be same as Rret
__ add(Rret, -frame::pc_return_offset, O7);
__ add(Lesp, BytesPerWord, Gargs); // setup parameter pointer
__ jump_to_method_handle_entry(G3_method_handle, Rtemp, /* emit_delayed_nop */ false);
// Record SP so we can remove any stack space allocated by adapter transition
__ delayed()->mov(SP, Llast_SP);
}
......@@ -3649,7 +3684,7 @@ void TemplateTable::multianewarray() {
transition(vtos, atos);
// put ndims * wordSize into Lscratch
__ ldub( Lbcp, 3, Lscratch);
__ sll( Lscratch, Interpreter::logStackElementSize(), Lscratch);
__ sll( Lscratch, Interpreter::logStackElementSize, Lscratch);
// Lesp points past last_dim, so set to O1 to first_dim address
__ add( Lesp, Lscratch, O1);
call_VM(Otos_i, CAST_FROM_FN_PTR(address, InterpreterRuntime::multianewarray), O1);
......
......@@ -104,6 +104,12 @@ void VM_Version::initialize() {
if (FLAG_IS_DEFAULT(OptoLoopAlignment)) {
FLAG_SET_DEFAULT(OptoLoopAlignment, 4);
}
// When using CMS, we cannot use memset() in BOT updates because
// the sun4v/CMT version in libc_psr uses BIS which exposes
// "phantom zeros" to concurrent readers. See 6948537.
if (FLAG_IS_DEFAULT(UseMemSetInBOT) && UseConcMarkSweepGC) {
FLAG_SET_DEFAULT(UseMemSetInBOT, false);
}
}
// Use hardware population count instruction if available.
......
/*
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -6492,24 +6492,19 @@ int MacroAssembler::load_unsigned_short(Register dst, Address src) {
}
void MacroAssembler::load_sized_value(Register dst, Address src,
int size_in_bytes, bool is_signed) {
switch (size_in_bytes ^ (is_signed ? -1 : 0)) {
size_t size_in_bytes, bool is_signed) {
switch (size_in_bytes) {
#ifndef _LP64
// For case 8, caller is responsible for manually loading
// the second word into another register.
case ~8: // fall through:
case 8: movl( dst, src ); break;
case 8: movl(dst, src); break;
#else
case ~8: // fall through:
case 8: movq( dst, src ); break;
case 8: movq(dst, src); break;
#endif
case ~4: // fall through:
case 4: movl( dst, src ); break;
case ~2: load_signed_short( dst, src ); break;
case 2: load_unsigned_short( dst, src ); break;
case ~1: load_signed_byte( dst, src ); break;
case 1: load_unsigned_byte( dst, src ); break;
default: ShouldNotReachHere();
case 4: movl(dst, src); break;
case 2: is_signed ? load_signed_short(dst, src) : load_unsigned_short(dst, src); break;
case 1: is_signed ? load_signed_byte( dst, src) : load_unsigned_byte( dst, src); break;
default: ShouldNotReachHere();
}
}
......@@ -7706,6 +7701,7 @@ void MacroAssembler::check_method_handle_type(Register mtype_reg, Register mh_re
// method handle's MethodType. This macro hides the distinction.
void MacroAssembler::load_method_handle_vmslots(Register vmslots_reg, Register mh_reg,
Register temp_reg) {
assert_different_registers(vmslots_reg, mh_reg, temp_reg);
if (UseCompressedOops) unimplemented(); // field accesses must decode
// load mh.type.form.vmslots
if (java_dyn_MethodHandle::vmslots_offset_in_bytes() != 0) {
......@@ -7744,7 +7740,7 @@ void MacroAssembler::jump_to_method_handle_entry(Register mh_reg, Register temp_
Address MacroAssembler::argument_address(RegisterOrConstant arg_slot,
int extra_slot_offset) {
// cf. TemplateTable::prepare_invoke(), if (load_receiver).
int stackElementSize = Interpreter::stackElementSize();
int stackElementSize = Interpreter::stackElementSize;
int offset = Interpreter::expr_offset_in_bytes(extra_slot_offset+0);
#ifdef ASSERT
int offset1 = Interpreter::expr_offset_in_bytes(extra_slot_offset+1);
......@@ -7975,7 +7971,7 @@ class FPU_State {
case 2: return "special";
case 3: return "empty";
}
ShouldNotReachHere()
ShouldNotReachHere();
return NULL;
}
......
/*
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -1511,7 +1511,7 @@ class MacroAssembler: public Assembler {
void extend_sign(Register hi, Register lo);
// Loading values by size and signed-ness
void load_sized_value(Register dst, Address src, int size_in_bytes, bool is_signed);
void load_sized_value(Register dst, Address src, size_t size_in_bytes, bool is_signed);
// Support for inc/dec with optimal instruction selection depending on value
......
......@@ -2838,7 +2838,7 @@ void LIR_Assembler::emit_static_call_stub() {
// On 64bit this will die since it will take a movq & jmp, must be only a jmp
__ jump(RuntimeAddress(__ pc()));
assert(__ offset() - start <= call_stub_size, "stub too big")
assert(__ offset() - start <= call_stub_size, "stub too big");
__ end_a_stub();
}
......
/*
* Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -28,6 +28,6 @@
// Size of interpreter code. Increase if too small. Interpreter will
// fail with a guarantee ("not enough space for interpreter generation");
// if too small.
// Run with +PrintInterpreterSize to get the VM to print out the size.
// Max size with JVMTI and TaggedStackInterpreter
// Run with +PrintInterpreter to get the VM to print out the size.
// Max size with JVMTI
const static int InterpreterCodeSize = 168 * 1024;
......@@ -291,8 +291,8 @@ BasicObjectLock* frame::interpreter_frame_monitor_begin() const {
BasicObjectLock* frame::interpreter_frame_monitor_end() const {
BasicObjectLock* result = (BasicObjectLock*) *addr_at(interpreter_frame_monitor_block_top_offset);
// make sure the pointer points inside the frame
assert((intptr_t) fp() > (intptr_t) result, "result must < than frame pointer");
assert((intptr_t) sp() <= (intptr_t) result, "result must >= than stack pointer");
assert(sp() <= (intptr_t*) result, "monitor end should be above the stack pointer");
assert((intptr_t*) result < fp(), "monitor end should be strictly below the frame pointer");
return result;
}
......@@ -502,7 +502,7 @@ bool frame::interpreter_frame_equals_unpacked_fp(intptr_t* fp) {
// When unpacking an optimized frame the frame pointer is
// adjusted with:
int diff = (method->max_locals() - method->size_of_parameters()) *
Interpreter::stackElementWords();
Interpreter::stackElementWords;
return _fp == (fp - diff);
}
......@@ -542,7 +542,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
// stack frames shouldn't be much larger than max_stack elements
if (fp() - sp() > 1024 + m->max_stack()*Interpreter::stackElementSize()) {
if (fp() - sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
return false;
}
......@@ -594,7 +594,7 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result)
#ifdef AMD64
// This is times two because we do a push(ltos) after pushing XMM0
// and that takes two interpreter stack slots.
tos_addr += 2 * Interpreter::stackElementWords();
tos_addr += 2 * Interpreter::stackElementWords;
#else
tos_addr += 2;
#endif // AMD64
......
......@@ -265,89 +265,30 @@ void InterpreterMacroAssembler::d2ieee() {
// Java Expression Stack
#ifdef ASSERT
void InterpreterMacroAssembler::verify_stack_tag(frame::Tag t) {
if (TaggedStackInterpreter) {
Label okay;
cmpptr(Address(rsp, wordSize), (int32_t)t);
jcc(Assembler::equal, okay);
// Also compare if the stack value is zero, then the tag might
// not have been set coming from deopt.
cmpptr(Address(rsp, 0), 0);
jcc(Assembler::equal, okay);
stop("Java Expression stack tag value is bad");
bind(okay);
}
}
#endif // ASSERT
void InterpreterMacroAssembler::pop_ptr(Register r) {
debug_only(verify_stack_tag(frame::TagReference));
pop(r);
if (TaggedStackInterpreter) addptr(rsp, 1 * wordSize);
}
void InterpreterMacroAssembler::pop_ptr(Register r, Register tag) {
pop(r);
// Tag may not be reference for jsr, can be returnAddress
if (TaggedStackInterpreter) pop(tag);
}
void InterpreterMacroAssembler::pop_i(Register r) {
debug_only(verify_stack_tag(frame::TagValue));
pop(r);
if (TaggedStackInterpreter) addptr(rsp, 1 * wordSize);
}
void InterpreterMacroAssembler::pop_l(Register lo, Register hi) {
debug_only(verify_stack_tag(frame::TagValue));
pop(lo);
if (TaggedStackInterpreter) addptr(rsp, 1 * wordSize);
debug_only(verify_stack_tag(frame::TagValue));
pop(hi);
if (TaggedStackInterpreter) addptr(rsp, 1 * wordSize);
}
void InterpreterMacroAssembler::pop_f() {
debug_only(verify_stack_tag(frame::TagValue));
fld_s(Address(rsp, 0));
addptr(rsp, 1 * wordSize);
if (TaggedStackInterpreter) addptr(rsp, 1 * wordSize);
}
void InterpreterMacroAssembler::pop_d() {
// Write double to stack contiguously and load into ST0
pop_dtos_to_rsp();
fld_d(Address(rsp, 0));
addptr(rsp, 2 * wordSize);
}
// Pop the top of the java expression stack to execution stack (which
// happens to be the same place).
void InterpreterMacroAssembler::pop_dtos_to_rsp() {
if (TaggedStackInterpreter) {
// Pop double value into scratch registers
debug_only(verify_stack_tag(frame::TagValue));
pop(rax);
addptr(rsp, 1* wordSize);
debug_only(verify_stack_tag(frame::TagValue));
pop(rdx);
addptr(rsp, 1* wordSize);
push(rdx);
push(rax);
}
}
void InterpreterMacroAssembler::pop_ftos_to_rsp() {
if (TaggedStackInterpreter) {
debug_only(verify_stack_tag(frame::TagValue));
pop(rax);
addptr(rsp, 1 * wordSize);
push(rax); // ftos is at rsp
}
}
void InterpreterMacroAssembler::pop(TosState state) {
switch (state) {
case atos: pop_ptr(rax); break;
......@@ -365,54 +306,28 @@ void InterpreterMacroAssembler::pop(TosState state) {
}
void InterpreterMacroAssembler::push_ptr(Register r) {
if (TaggedStackInterpreter) push(frame::TagReference);
push(r);
}
void InterpreterMacroAssembler::push_ptr(Register r, Register tag) {
if (TaggedStackInterpreter) push(tag); // tag first
push(r);
}
void InterpreterMacroAssembler::push_i(Register r) {
if (TaggedStackInterpreter) push(frame::TagValue);
push(r);
}
void InterpreterMacroAssembler::push_l(Register lo, Register hi) {
if (TaggedStackInterpreter) push(frame::TagValue);
push(hi);
if (TaggedStackInterpreter) push(frame::TagValue);
push(lo);
}
void InterpreterMacroAssembler::push_f() {
if (TaggedStackInterpreter) push(frame::TagValue);
// Do not schedule for no AGI! Never write beyond rsp!
subptr(rsp, 1 * wordSize);
fstp_s(Address(rsp, 0));
}
void InterpreterMacroAssembler::push_d(Register r) {
if (TaggedStackInterpreter) {
// Double values are stored as:
// tag
// high
// tag
// low
push(frame::TagValue);
subptr(rsp, 3 * wordSize);
fstp_d(Address(rsp, 0));
// move high word up to slot n-1
movl(r, Address(rsp, 1*wordSize));
movl(Address(rsp, 2*wordSize), r);
// move tag
movl(Address(rsp, 1*wordSize), frame::TagValue);
} else {
// Do not schedule for no AGI! Never write beyond rsp!
subptr(rsp, 2 * wordSize);
fstp_d(Address(rsp, 0));
}
// Do not schedule for no AGI! Never write beyond rsp!
subptr(rsp, 2 * wordSize);
fstp_d(Address(rsp, 0));
}
......@@ -433,118 +348,15 @@ void InterpreterMacroAssembler::push(TosState state) {
}
// Tagged stack helpers for swap and dup
void InterpreterMacroAssembler::load_ptr_and_tag(int n, Register val,
Register tag) {
// Helpers for swap and dup
void InterpreterMacroAssembler::load_ptr(int n, Register val) {
movptr(val, Address(rsp, Interpreter::expr_offset_in_bytes(n)));
if (TaggedStackInterpreter) {
movptr(tag, Address(rsp, Interpreter::expr_tag_offset_in_bytes(n)));
}
}
void InterpreterMacroAssembler::store_ptr_and_tag(int n, Register val,
Register tag) {
void InterpreterMacroAssembler::store_ptr(int n, Register val) {
movptr(Address(rsp, Interpreter::expr_offset_in_bytes(n)), val);
if (TaggedStackInterpreter) {
movptr(Address(rsp, Interpreter::expr_tag_offset_in_bytes(n)), tag);
}
}
// Tagged local support
void InterpreterMacroAssembler::tag_local(frame::Tag tag, int n) {
if (TaggedStackInterpreter) {
if (tag == frame::TagCategory2) {
movptr(Address(rdi, Interpreter::local_tag_offset_in_bytes(n+1)), (int32_t)frame::TagValue);
movptr(Address(rdi, Interpreter::local_tag_offset_in_bytes(n)), (int32_t)frame::TagValue);
} else {
movptr(Address(rdi, Interpreter::local_tag_offset_in_bytes(n)), (int32_t)tag);
}
}
}
void InterpreterMacroAssembler::tag_local(frame::Tag tag, Register idx) {
if (TaggedStackInterpreter) {
if (tag == frame::TagCategory2) {
movptr(Address(rdi, idx, Interpreter::stackElementScale(),
Interpreter::local_tag_offset_in_bytes(1)), (int32_t)frame::TagValue);
movptr(Address(rdi, idx, Interpreter::stackElementScale(),
Interpreter::local_tag_offset_in_bytes(0)), (int32_t)frame::TagValue);
} else {
movptr(Address(rdi, idx, Interpreter::stackElementScale(),
Interpreter::local_tag_offset_in_bytes(0)), (int32_t)tag);
}
}
}
void InterpreterMacroAssembler::tag_local(Register tag, Register idx) {
if (TaggedStackInterpreter) {
// can only be TagValue or TagReference
movptr(Address(rdi, idx, Interpreter::stackElementScale(),
Interpreter::local_tag_offset_in_bytes(0)), tag);
}
}
void InterpreterMacroAssembler::tag_local(Register tag, int n) {
if (TaggedStackInterpreter) {
// can only be TagValue or TagReference
movptr(Address(rdi, Interpreter::local_tag_offset_in_bytes(n)), tag);
}
}
#ifdef ASSERT
void InterpreterMacroAssembler::verify_local_tag(frame::Tag tag, int n) {
if (TaggedStackInterpreter) {
frame::Tag t = tag;
if (tag == frame::TagCategory2) {
Label nbl;
t = frame::TagValue; // change to what is stored in locals
cmpptr(Address(rdi, Interpreter::local_tag_offset_in_bytes(n+1)), (int32_t)t);
jcc(Assembler::equal, nbl);
stop("Local tag is bad for long/double");
bind(nbl);
}
Label notBad;
cmpptr(Address(rdi, Interpreter::local_tag_offset_in_bytes(n)), (int32_t)t);
jcc(Assembler::equal, notBad);
// Also compare if the local value is zero, then the tag might
// not have been set coming from deopt.
cmpptr(Address(rdi, Interpreter::local_offset_in_bytes(n)), 0);
jcc(Assembler::equal, notBad);
stop("Local tag is bad");
bind(notBad);
}
}
void InterpreterMacroAssembler::verify_local_tag(frame::Tag tag, Register idx) {
if (TaggedStackInterpreter) {
frame::Tag t = tag;
if (tag == frame::TagCategory2) {
Label nbl;
t = frame::TagValue; // change to what is stored in locals
cmpptr(Address(rdi, idx, Interpreter::stackElementScale(),
Interpreter::local_tag_offset_in_bytes(1)), (int32_t)t);
jcc(Assembler::equal, nbl);
stop("Local tag is bad for long/double");
bind(nbl);
}
Label notBad;
cmpl(Address(rdi, idx, Interpreter::stackElementScale(),
Interpreter::local_tag_offset_in_bytes(0)), (int32_t)t);
jcc(Assembler::equal, notBad);
// Also compare if the local value is zero, then the tag might
// not have been set coming from deopt.
cmpptr(Address(rdi, idx, Interpreter::stackElementScale(),
Interpreter::local_offset_in_bytes(0)), 0);
jcc(Assembler::equal, notBad);
stop("Local tag is bad");
bind(notBad);
}
}
#endif // ASSERT
void InterpreterMacroAssembler::super_call_VM_leaf(address entry_point) {
MacroAssembler::call_VM_leaf_base(entry_point, 0);
}
......
/*
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -85,16 +85,12 @@ class InterpreterMacroAssembler: public MacroAssembler {
void d2ieee(); // truncate dtos to 64bits
void pop_ptr(Register r = rax);
void pop_ptr(Register r, Register tag);
void pop_i(Register r = rax);
void pop_l(Register lo = rax, Register hi = rdx);
void pop_f();
void pop_d();
void pop_ftos_to_rsp();
void pop_dtos_to_rsp();
void push_ptr(Register r = rax);
void push_ptr(Register r, Register tag);
void push_i(Register r = rax);
void push_l(Register lo = rax, Register hi = rdx);
void push_d(Register r = rax);
......@@ -112,33 +108,15 @@ class InterpreterMacroAssembler: public MacroAssembler {
void pop(void* v ); // Add unimplemented ambiguous method
void push(void* v ); // Add unimplemented ambiguous method
DEBUG_ONLY(void verify_stack_tag(frame::Tag t);)
#endif // CC_INTERP
#ifndef CC_INTERP
void empty_expression_stack() {
movptr(rsp, Address(rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize));
// NULL last_sp until next java call
movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD);
void empty_expression_stack() {
movptr(rsp, Address(rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize));
// NULL last_sp until next java call
movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD);
}
// Tagged stack helpers for swap and dup
void load_ptr_and_tag(int n, Register val, Register tag);
void store_ptr_and_tag(int n, Register val, Register tag);
// Tagged Local support
void tag_local(frame::Tag tag, int n);
void tag_local(Register tag, int n);
void tag_local(frame::Tag tag, Register idx);
void tag_local(Register tag, Register idx);
#ifdef ASSERT
void verify_local_tag(frame::Tag tag, int n);
void verify_local_tag(frame::Tag tag, Register idx);
#endif // ASSERT
// Helpers for swap and dup
void load_ptr(int n, Register val);
void store_ptr(int n, Register val);
// Super call_VM calls - correspond to MacroAssembler::call_VM(_leaf) calls
void super_call_VM_leaf(address entry_point);
......
......@@ -264,113 +264,51 @@ void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass,
// Java Expression Stack
#ifdef ASSERT
// Verifies that the stack tag matches. Must be called before the stack
// value is popped off the stack.
void InterpreterMacroAssembler::verify_stack_tag(frame::Tag t) {
if (TaggedStackInterpreter) {
frame::Tag tag = t;
if (t == frame::TagCategory2) {
tag = frame::TagValue;
Label hokay;
cmpptr(Address(rsp, 3*wordSize), (int32_t)tag);
jcc(Assembler::equal, hokay);
stop("Java Expression stack tag high value is bad");
bind(hokay);
}
Label okay;
cmpptr(Address(rsp, wordSize), (int32_t)tag);
jcc(Assembler::equal, okay);
// Also compare if the stack value is zero, then the tag might
// not have been set coming from deopt.
cmpptr(Address(rsp, 0), 0);
jcc(Assembler::equal, okay);
stop("Java Expression stack tag value is bad");
bind(okay);
}
}
#endif // ASSERT
void InterpreterMacroAssembler::pop_ptr(Register r) {
debug_only(verify_stack_tag(frame::TagReference));
pop(r);
if (TaggedStackInterpreter) addptr(rsp, 1 * wordSize);
}
void InterpreterMacroAssembler::pop_ptr(Register r, Register tag) {
pop(r);
if (TaggedStackInterpreter) pop(tag);
}
void InterpreterMacroAssembler::pop_i(Register r) {
// XXX can't use pop currently, upper half non clean
debug_only(verify_stack_tag(frame::TagValue));
movl(r, Address(rsp, 0));
addptr(rsp, wordSize);
if (TaggedStackInterpreter) addptr(rsp, 1 * wordSize);
}
void InterpreterMacroAssembler::pop_l(Register r) {
debug_only(verify_stack_tag(frame::TagCategory2));
movq(r, Address(rsp, 0));
addptr(rsp, 2 * Interpreter::stackElementSize());
addptr(rsp, 2 * Interpreter::stackElementSize);
}
void InterpreterMacroAssembler::pop_f(XMMRegister r) {
debug_only(verify_stack_tag(frame::TagValue));
movflt(r, Address(rsp, 0));
addptr(rsp, wordSize);
if (TaggedStackInterpreter) addptr(rsp, 1 * wordSize);
}
void InterpreterMacroAssembler::pop_d(XMMRegister r) {
debug_only(verify_stack_tag(frame::TagCategory2));
movdbl(r, Address(rsp, 0));
addptr(rsp, 2 * Interpreter::stackElementSize());
addptr(rsp, 2 * Interpreter::stackElementSize);
}
void InterpreterMacroAssembler::push_ptr(Register r) {
if (TaggedStackInterpreter) push(frame::TagReference);
push(r);
}
void InterpreterMacroAssembler::push_ptr(Register r, Register tag) {
if (TaggedStackInterpreter) push(tag);
push(r);
}
void InterpreterMacroAssembler::push_i(Register r) {
if (TaggedStackInterpreter) push(frame::TagValue);
push(r);
}
void InterpreterMacroAssembler::push_l(Register r) {
if (TaggedStackInterpreter) {
push(frame::TagValue);
subptr(rsp, 1 * wordSize);
push(frame::TagValue);
subptr(rsp, 1 * wordSize);
} else {
subptr(rsp, 2 * wordSize);
}
subptr(rsp, 2 * wordSize);
movq(Address(rsp, 0), r);
}
void InterpreterMacroAssembler::push_f(XMMRegister r) {
if (TaggedStackInterpreter) push(frame::TagValue);
subptr(rsp, wordSize);
movflt(Address(rsp, 0), r);
}
void InterpreterMacroAssembler::push_d(XMMRegister r) {
if (TaggedStackInterpreter) {
push(frame::TagValue);
subptr(rsp, 1 * wordSize);
push(frame::TagValue);
subptr(rsp, 1 * wordSize);
} else {
subptr(rsp, 2 * wordSize);
}
subptr(rsp, 2 * wordSize);
movdbl(Address(rsp, 0), r);
}
......@@ -407,116 +345,14 @@ void InterpreterMacroAssembler::push(TosState state) {
}
// Tagged stack helpers for swap and dup
void InterpreterMacroAssembler::load_ptr_and_tag(int n, Register val,
Register tag) {
// Helpers for swap and dup
void InterpreterMacroAssembler::load_ptr(int n, Register val) {
movptr(val, Address(rsp, Interpreter::expr_offset_in_bytes(n)));
if (TaggedStackInterpreter) {
movptr(tag, Address(rsp, Interpreter::expr_tag_offset_in_bytes(n)));
}
}
void InterpreterMacroAssembler::store_ptr_and_tag(int n, Register val,
Register tag) {
void InterpreterMacroAssembler::store_ptr(int n, Register val) {
movptr(Address(rsp, Interpreter::expr_offset_in_bytes(n)), val);
if (TaggedStackInterpreter) {
movptr(Address(rsp, Interpreter::expr_tag_offset_in_bytes(n)), tag);
}
}
// Tagged local support
void InterpreterMacroAssembler::tag_local(frame::Tag tag, int n) {
if (TaggedStackInterpreter) {
if (tag == frame::TagCategory2) {
movptr(Address(r14, Interpreter::local_tag_offset_in_bytes(n+1)),
(int32_t)frame::TagValue);
movptr(Address(r14, Interpreter::local_tag_offset_in_bytes(n)),
(int32_t)frame::TagValue);
} else {
movptr(Address(r14, Interpreter::local_tag_offset_in_bytes(n)), (int32_t)tag);
}
}
}
void InterpreterMacroAssembler::tag_local(frame::Tag tag, Register idx) {
if (TaggedStackInterpreter) {
if (tag == frame::TagCategory2) {
movptr(Address(r14, idx, Address::times_8,
Interpreter::local_tag_offset_in_bytes(1)), (int32_t)frame::TagValue);
movptr(Address(r14, idx, Address::times_8,
Interpreter::local_tag_offset_in_bytes(0)), (int32_t)frame::TagValue);
} else {
movptr(Address(r14, idx, Address::times_8, Interpreter::local_tag_offset_in_bytes(0)),
(int32_t)tag);
}
}
}
void InterpreterMacroAssembler::tag_local(Register tag, Register idx) {
if (TaggedStackInterpreter) {
// can only be TagValue or TagReference
movptr(Address(r14, idx, Address::times_8, Interpreter::local_tag_offset_in_bytes(0)), tag);
}
}
void InterpreterMacroAssembler::tag_local(Register tag, int n) {
if (TaggedStackInterpreter) {
// can only be TagValue or TagReference
movptr(Address(r14, Interpreter::local_tag_offset_in_bytes(n)), tag);
}
}
#ifdef ASSERT
void InterpreterMacroAssembler::verify_local_tag(frame::Tag tag, int n) {
if (TaggedStackInterpreter) {
frame::Tag t = tag;
if (tag == frame::TagCategory2) {
Label nbl;
t = frame::TagValue; // change to what is stored in locals
cmpptr(Address(r14, Interpreter::local_tag_offset_in_bytes(n+1)), (int32_t)t);
jcc(Assembler::equal, nbl);
stop("Local tag is bad for long/double");
bind(nbl);
}
Label notBad;
cmpq(Address(r14, Interpreter::local_tag_offset_in_bytes(n)), (int32_t)t);
jcc(Assembler::equal, notBad);
// Also compare if the local value is zero, then the tag might
// not have been set coming from deopt.
cmpptr(Address(r14, Interpreter::local_offset_in_bytes(n)), 0);
jcc(Assembler::equal, notBad);
stop("Local tag is bad");
bind(notBad);
}
}
void InterpreterMacroAssembler::verify_local_tag(frame::Tag tag, Register idx) {
if (TaggedStackInterpreter) {
frame::Tag t = tag;
if (tag == frame::TagCategory2) {
Label nbl;
t = frame::TagValue; // change to what is stored in locals
cmpptr(Address(r14, idx, Address::times_8, Interpreter::local_tag_offset_in_bytes(1)), (int32_t)t);
jcc(Assembler::equal, nbl);
stop("Local tag is bad for long/double");
bind(nbl);
}
Label notBad;
cmpptr(Address(r14, idx, Address::times_8, Interpreter::local_tag_offset_in_bytes(0)), (int32_t)t);
jcc(Assembler::equal, notBad);
// Also compare if the local value is zero, then the tag might
// not have been set coming from deopt.
cmpptr(Address(r14, idx, Address::times_8, Interpreter::local_offset_in_bytes(0)), 0);
jcc(Assembler::equal, notBad);
stop("Local tag is bad");
bind(notBad);
}
}
#endif // ASSERT
void InterpreterMacroAssembler::super_call_VM_leaf(address entry_point) {
......
/*
* Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -120,38 +120,16 @@ class InterpreterMacroAssembler: public MacroAssembler {
void pop(TosState state); // transition vtos -> state
void push(TosState state); // transition state -> vtos
// Tagged stack support, pop and push both tag and value.
void pop_ptr(Register r, Register tag);
void push_ptr(Register r, Register tag);
#endif // CC_INTERP
DEBUG_ONLY(void verify_stack_tag(frame::Tag t);)
#ifndef CC_INTERP
// Tagged stack helpers for swap and dup
void load_ptr_and_tag(int n, Register val, Register tag);
void store_ptr_and_tag(int n, Register val, Register tag);
// Tagged Local support
void tag_local(frame::Tag tag, int n);
void tag_local(Register tag, int n);
void tag_local(frame::Tag tag, Register idx);
void tag_local(Register tag, Register idx);
#ifdef ASSERT
void verify_local_tag(frame::Tag tag, int n);
void verify_local_tag(frame::Tag tag, Register idx);
#endif // ASSERT
void empty_expression_stack()
{
void empty_expression_stack() {
movptr(rsp, Address(rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize));
// NULL last_sp until next java call
movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD);
}
// Helpers for swap and dup
void load_ptr(int n, Register val);
void store_ptr(int n, Register val);
// Super call_VM calls - correspond to MacroAssembler::call_VM(_leaf) calls
void super_call_VM_leaf(address entry_point);
void super_call_VM_leaf(address entry_point, Register arg_1);
......
/*
* Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1998-2010 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -86,33 +86,23 @@ class SlowSignatureHandler: public NativeSignatureIterator {
address _from;
intptr_t* _to;
#ifdef ASSERT
void verify_tag(frame::Tag t) {
assert(!TaggedStackInterpreter ||
*(intptr_t*)(_from+Interpreter::local_tag_offset_in_bytes(0)) == t, "wrong tag");
}
#endif // ASSERT
virtual void pass_int() {
*_to++ = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
debug_only(verify_tag(frame::TagValue));
_from -= Interpreter::stackElementSize();
_from -= Interpreter::stackElementSize;
}
virtual void pass_long() {
_to[0] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
_to[1] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(0));
debug_only(verify_tag(frame::TagValue));
_to += 2;
_from -= 2*Interpreter::stackElementSize();
_from -= 2*Interpreter::stackElementSize;
}
virtual void pass_object() {
// pass address of from
intptr_t from_addr = (intptr_t)(_from + Interpreter::local_offset_in_bytes(0));
*_to++ = (*(intptr_t*)from_addr == 0) ? NULL_WORD : from_addr;
debug_only(verify_tag(frame::TagReference));
_from -= Interpreter::stackElementSize();
_from -= Interpreter::stackElementSize;
}
public:
......
/*
* Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -293,18 +293,10 @@ class SlowSignatureHandler
intptr_t* _fp_identifiers;
unsigned int _num_args;
#ifdef ASSERT
void verify_tag(frame::Tag t) {
assert(!TaggedStackInterpreter ||
*(intptr_t*)(_from+Interpreter::local_tag_offset_in_bytes(0)) == t, "wrong tag");
}
#endif // ASSERT
virtual void pass_int()
{
jint from_obj = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
debug_only(verify_tag(frame::TagValue));
_from -= Interpreter::stackElementSize();
_from -= Interpreter::stackElementSize;
if (_num_args < Argument::n_int_register_parameters_c-1) {
*_reg_args++ = from_obj;
......@@ -317,8 +309,7 @@ class SlowSignatureHandler
virtual void pass_long()
{
intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
debug_only(verify_tag(frame::TagValue));
_from -= 2*Interpreter::stackElementSize();
_from -= 2*Interpreter::stackElementSize;
if (_num_args < Argument::n_int_register_parameters_c-1) {
*_reg_args++ = from_obj;
......@@ -331,8 +322,7 @@ class SlowSignatureHandler
virtual void pass_object()
{
intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0));
debug_only(verify_tag(frame::TagReference));
_from -= Interpreter::stackElementSize();
_from -= Interpreter::stackElementSize;
if (_num_args < Argument::n_int_register_parameters_c-1) {
*_reg_args++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
_num_args++;
......@@ -344,8 +334,7 @@ class SlowSignatureHandler
virtual void pass_float()
{
jint from_obj = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
debug_only(verify_tag(frame::TagValue));
_from -= Interpreter::stackElementSize();
_from -= Interpreter::stackElementSize;
if (_num_args < Argument::n_float_register_parameters_c-1) {
*_reg_args++ = from_obj;
......@@ -359,8 +348,7 @@ class SlowSignatureHandler
virtual void pass_double()
{
intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
debug_only(verify_tag(frame::TagValue));
_from -= 2*Interpreter::stackElementSize();
_from -= 2*Interpreter::stackElementSize;
if (_num_args < Argument::n_float_register_parameters_c-1) {
*_reg_args++ = from_obj;
......@@ -397,18 +385,10 @@ class SlowSignatureHandler
unsigned int _num_int_args;
unsigned int _num_fp_args;
#ifdef ASSERT
void verify_tag(frame::Tag t) {
assert(!TaggedStackInterpreter ||
*(intptr_t*)(_from+Interpreter::local_tag_offset_in_bytes(0)) == t, "wrong tag");
}
#endif // ASSERT
virtual void pass_int()
{
jint from_obj = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
debug_only(verify_tag(frame::TagValue));
_from -= Interpreter::stackElementSize();
_from -= Interpreter::stackElementSize;
if (_num_int_args < Argument::n_int_register_parameters_c-1) {
*_int_args++ = from_obj;
......@@ -421,8 +401,7 @@ class SlowSignatureHandler
virtual void pass_long()
{
intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
debug_only(verify_tag(frame::TagValue));
_from -= 2*Interpreter::stackElementSize();
_from -= 2*Interpreter::stackElementSize;
if (_num_int_args < Argument::n_int_register_parameters_c-1) {
*_int_args++ = from_obj;
......@@ -435,8 +414,7 @@ class SlowSignatureHandler
virtual void pass_object()
{
intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0));
debug_only(verify_tag(frame::TagReference));
_from -= Interpreter::stackElementSize();
_from -= Interpreter::stackElementSize;
if (_num_int_args < Argument::n_int_register_parameters_c-1) {
*_int_args++ = (*from_addr == 0) ? NULL : (intptr_t)from_addr;
......@@ -449,8 +427,7 @@ class SlowSignatureHandler
virtual void pass_float()
{
jint from_obj = *(jint*)(_from+Interpreter::local_offset_in_bytes(0));
debug_only(verify_tag(frame::TagValue));
_from -= Interpreter::stackElementSize();
_from -= Interpreter::stackElementSize;
if (_num_fp_args < Argument::n_float_register_parameters_c) {
*_fp_args++ = from_obj;
......@@ -463,7 +440,7 @@ class SlowSignatureHandler
virtual void pass_double()
{
intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
_from -= 2*Interpreter::stackElementSize();
_from -= 2*Interpreter::stackElementSize;
if (_num_fp_args < Argument::n_float_register_parameters_c) {
*_fp_args++ = from_obj;
......
......@@ -26,6 +26,10 @@
#include "incls/_precompiled.incl"
#include "incls/_methodHandles_zero.cpp.incl"
int MethodHandles::adapter_conversion_ops_supported_mask() {
ShouldNotCallThis();
}
void MethodHandles::generate_method_handle_stub(MacroAssembler* masm,
MethodHandles::EntryKind ek) {
ShouldNotCallThis();
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册