--- old/src/cpu/sparc/vm/sparc.ad 2012-11-20 11:19:15.720425000 +0100 +++ new/src/cpu/sparc/vm/sparc.ad 2012-11-20 11:19:15.587405000 +0100 @@ -1657,6 +1657,10 @@ //============================================================================= +// Offset from start of compiled java to interpreter stub to the load +// constant that loads the inline cache (IC) (0 on sparc). +const int CompiledStaticCall::comp_to_int_load_offset = 0; + // emit call stub, compiled java to interpretor void emit_java_to_interp(CodeBuffer &cbuf ) { --- old/src/cpu/x86/vm/x86_32.ad 2012-11-20 11:19:16.581455000 +0100 +++ new/src/cpu/x86/vm/x86_32.ad 2012-11-20 11:19:16.448451000 +0100 @@ -1242,6 +1242,10 @@ //============================================================================= +// Offset from start of compiled java to interpreter stub to the load +// constant that loads the inline cache (IC) (0 on i486). +const int CompiledStaticCall::comp_to_int_load_offset = 0; + // emit call stub, compiled java to interpreter void emit_java_to_interp(CodeBuffer &cbuf ) { // Stub is fixed up when the corresponding call is converted from calling --- old/src/cpu/x86/vm/x86_64.ad 2012-11-20 11:19:17.451542000 +0100 +++ new/src/cpu/x86/vm/x86_64.ad 2012-11-20 11:19:17.318551000 +0100 @@ -1365,6 +1365,10 @@ //============================================================================= +// Offset from start of compiled java to interpreter stub to the load +// constant that loads the inline cache (IC) (0 on amd64). +const int CompiledStaticCall::comp_to_int_load_offset = 0; + // emit call stub, compiled java to interpreter void emit_java_to_interp(CodeBuffer& cbuf) { --- old/src/share/vm/adlc/main.cpp 2012-11-20 11:19:18.261638000 +0100 +++ new/src/share/vm/adlc/main.cpp 2012-11-20 11:19:18.137633000 +0100 @@ -213,6 +213,7 @@ AD.addInclude(AD._CPP_file, "adfiles", get_basename(AD._HPP_file._name)); AD.addInclude(AD._CPP_file, "memory/allocation.inline.hpp"); AD.addInclude(AD._CPP_file, "asm/assembler.hpp"); + AD.addInclude(AD._CPP_file, "code/compiledIC.hpp"); AD.addInclude(AD._CPP_file, "code/vmreg.hpp"); AD.addInclude(AD._CPP_file, "gc_interface/collectedHeap.inline.hpp"); AD.addInclude(AD._CPP_file, "oops/compiledICHolder.hpp"); --- old/src/share/vm/code/compiledIC.cpp 2012-11-20 11:19:18.861613000 +0100 +++ new/src/share/vm/code/compiledIC.cpp 2012-11-20 11:19:18.743630000 +0100 @@ -561,7 +561,7 @@ callee->name_and_sig_as_C_string()); } - NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); // creation also verifies the object + NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + comp_to_int_load_offset); // creation also verifies the object NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); assert(method_holder->data() == 0 || method_holder->data() == (intptr_t)callee(), "a) MT-unsafe modification of inline cache"); @@ -624,7 +624,7 @@ // Reset stub address stub = static_stub->addr(); assert(stub!=NULL, "stub not found"); - NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); // creation also verifies the object + NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + comp_to_int_load_offset); // creation also verifies the object NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); method_holder->set_data(0); jump->set_jump_destination((address)-1); @@ -703,11 +703,16 @@ // Verify stub address stub = find_stub(); assert(stub != NULL, "no stub found for static call"); - NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); // creation also verifies the object + NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + comp_to_int_load_offset); // creation also verifies the object + NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); // Verify state assert(is_clean() || is_call_to_compiled() || is_call_to_interpreted(), "sanity check"); } +#endif // !PRODUCT + +#ifndef COMPILER2 +const int CompiledStaticCall::comp_to_int_load_offset = 0; #endif --- old/src/share/vm/code/compiledIC.hpp 2012-11-20 11:19:19.442651000 +0100 +++ new/src/share/vm/code/compiledIC.hpp 2012-11-20 11:19:19.326636000 +0100 @@ -327,6 +327,10 @@ // Misc. void print() PRODUCT_RETURN; void verify() PRODUCT_RETURN; + + // Offset of start of compiled java to interpreter stub to the load + // constant that loads the inline cache (IC). See ad file. + static const int comp_to_int_load_offset; };