Wed, 25 Jun 2014 08:56:57 +0200
8047326: Consolidate all CompiledIC::CompiledIC implementations and move it to compiledIC.cpp
Reviewed-by: vlivanov, ehelin
1.1 --- a/src/cpu/ppc/vm/compiledIC_ppc.cpp Wed Jun 25 08:28:01 2014 +0200 1.2 +++ b/src/cpu/ppc/vm/compiledIC_ppc.cpp Wed Jun 25 08:56:57 2014 +0200 1.3 @@ -50,34 +50,6 @@ 1.4 return is_icholder_entry(call->destination()); 1.5 } 1.6 1.7 -//----------------------------------------------------------------------------- 1.8 -// High-level access to an inline cache. Guaranteed to be MT-safe. 1.9 - 1.10 -CompiledIC::CompiledIC(nmethod* nm, NativeCall* call) 1.11 - : _ic_call(call) 1.12 -{ 1.13 - address ic_call = call->instruction_address(); 1.14 - 1.15 - assert(ic_call != NULL, "ic_call address must be set"); 1.16 - assert(nm != NULL, "must pass nmethod"); 1.17 - assert(nm->contains(ic_call), "must be in nmethod"); 1.18 - 1.19 - // Search for the ic_call at the given address. 1.20 - RelocIterator iter(nm, ic_call, ic_call+1); 1.21 - bool ret = iter.next(); 1.22 - assert(ret == true, "relocInfo must exist at this address"); 1.23 - assert(iter.addr() == ic_call, "must find ic_call"); 1.24 - if (iter.type() == relocInfo::virtual_call_type) { 1.25 - virtual_call_Relocation* r = iter.virtual_call_reloc(); 1.26 - _is_optimized = false; 1.27 - _value = nativeMovConstReg_at(r->cached_value()); 1.28 - } else { 1.29 - assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call"); 1.30 - _is_optimized = true; 1.31 - _value = NULL; 1.32 - } 1.33 -} 1.34 - 1.35 // ---------------------------------------------------------------------------- 1.36 1.37 // A PPC CompiledStaticCall looks like this:
2.1 --- a/src/cpu/sparc/vm/compiledIC_sparc.cpp Wed Jun 25 08:28:01 2014 +0200 2.2 +++ b/src/cpu/sparc/vm/compiledIC_sparc.cpp Wed Jun 25 08:56:57 2014 +0200 2.3 @@ -50,34 +50,6 @@ 2.4 return is_icholder_entry(call->destination()); 2.5 } 2.6 2.7 -//----------------------------------------------------------------------------- 2.8 -// High-level access to an inline cache. Guaranteed to be MT-safe. 2.9 - 2.10 -CompiledIC::CompiledIC(nmethod* nm, NativeCall* call) 2.11 - : _ic_call(call) 2.12 -{ 2.13 - address ic_call = call->instruction_address(); 2.14 - 2.15 - assert(ic_call != NULL, "ic_call address must be set"); 2.16 - assert(nm != NULL, "must pass nmethod"); 2.17 - assert(nm->contains(ic_call), "must be in nmethod"); 2.18 - 2.19 - // Search for the ic_call at the given address. 2.20 - RelocIterator iter(nm, ic_call, ic_call+1); 2.21 - bool ret = iter.next(); 2.22 - assert(ret == true, "relocInfo must exist at this address"); 2.23 - assert(iter.addr() == ic_call, "must find ic_call"); 2.24 - if (iter.type() == relocInfo::virtual_call_type) { 2.25 - virtual_call_Relocation* r = iter.virtual_call_reloc(); 2.26 - _is_optimized = false; 2.27 - _value = nativeMovConstReg_at(r->cached_value()); 2.28 - } else { 2.29 - assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call"); 2.30 - _is_optimized = true; 2.31 - _value = NULL; 2.32 - } 2.33 -} 2.34 - 2.35 // ---------------------------------------------------------------------------- 2.36 2.37 #define __ _masm.
3.1 --- a/src/cpu/x86/vm/compiledIC_x86.cpp Wed Jun 25 08:28:01 2014 +0200 3.2 +++ b/src/cpu/x86/vm/compiledIC_x86.cpp Wed Jun 25 08:56:57 2014 +0200 3.3 @@ -47,34 +47,6 @@ 3.4 return is_icholder_entry(call->destination()); 3.5 } 3.6 3.7 -//----------------------------------------------------------------------------- 3.8 -// High-level access to an inline cache. Guaranteed to be MT-safe. 3.9 - 3.10 -CompiledIC::CompiledIC(nmethod* nm, NativeCall* call) 3.11 - : _ic_call(call) 3.12 -{ 3.13 - address ic_call = call->instruction_address(); 3.14 - 3.15 - assert(ic_call != NULL, "ic_call address must be set"); 3.16 - assert(nm != NULL, "must pass nmethod"); 3.17 - assert(nm->contains(ic_call), "must be in nmethod"); 3.18 - 3.19 - // Search for the ic_call at the given address. 3.20 - RelocIterator iter(nm, ic_call, ic_call+1); 3.21 - bool ret = iter.next(); 3.22 - assert(ret == true, "relocInfo must exist at this address"); 3.23 - assert(iter.addr() == ic_call, "must find ic_call"); 3.24 - if (iter.type() == relocInfo::virtual_call_type) { 3.25 - virtual_call_Relocation* r = iter.virtual_call_reloc(); 3.26 - _is_optimized = false; 3.27 - _value = nativeMovConstReg_at(r->cached_value()); 3.28 - } else { 3.29 - assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call"); 3.30 - _is_optimized = true; 3.31 - _value = NULL; 3.32 - } 3.33 -} 3.34 - 3.35 // ---------------------------------------------------------------------------- 3.36 3.37 #define __ _masm.
4.1 --- a/src/cpu/zero/vm/compiledIC_zero.cpp Wed Jun 25 08:28:01 2014 +0200 4.2 +++ b/src/cpu/zero/vm/compiledIC_zero.cpp Wed Jun 25 08:56:57 2014 +0200 4.3 @@ -58,34 +58,6 @@ 4.4 return is_icholder_entry(call->destination()); 4.5 } 4.6 4.7 -//----------------------------------------------------------------------------- 4.8 -// High-level access to an inline cache. Guaranteed to be MT-safe. 4.9 - 4.10 -CompiledIC::CompiledIC(nmethod* nm, NativeCall* call) 4.11 - : _ic_call(call) 4.12 -{ 4.13 - address ic_call = call->instruction_address(); 4.14 - 4.15 - assert(ic_call != NULL, "ic_call address must be set"); 4.16 - assert(nm != NULL, "must pass nmethod"); 4.17 - assert(nm->contains(ic_call), "must be in nmethod"); 4.18 - 4.19 - // Search for the ic_call at the given address. 4.20 - RelocIterator iter(nm, ic_call, ic_call+1); 4.21 - bool ret = iter.next(); 4.22 - assert(ret == true, "relocInfo must exist at this address"); 4.23 - assert(iter.addr() == ic_call, "must find ic_call"); 4.24 - if (iter.type() == relocInfo::virtual_call_type) { 4.25 - virtual_call_Relocation* r = iter.virtual_call_reloc(); 4.26 - _is_optimized = false; 4.27 - _value = nativeMovConstReg_at(r->cached_value()); 4.28 - } else { 4.29 - assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call"); 4.30 - _is_optimized = true; 4.31 - _value = NULL; 4.32 - } 4.33 -} 4.34 - 4.35 // ---------------------------------------------------------------------------- 4.36 4.37 void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
5.1 --- a/src/share/vm/code/compiledIC.cpp Wed Jun 25 08:28:01 2014 +0200 5.2 +++ b/src/share/vm/code/compiledIC.cpp Wed Jun 25 08:56:57 2014 +0200 5.3 @@ -159,6 +159,30 @@ 5.4 //----------------------------------------------------------------------------- 5.5 // High-level access to an inline cache. Guaranteed to be MT-safe. 5.6 5.7 +CompiledIC::CompiledIC(nmethod* nm, NativeCall* call) 5.8 + : _ic_call(call) 5.9 +{ 5.10 + address ic_call = call->instruction_address(); 5.11 + 5.12 + assert(ic_call != NULL, "ic_call address must be set"); 5.13 + assert(nm != NULL, "must pass nmethod"); 5.14 + assert(nm->contains(ic_call), "must be in nmethod"); 5.15 + 5.16 + // Search for the ic_call at the given address. 5.17 + RelocIterator iter(nm, ic_call, ic_call+1); 5.18 + bool ret = iter.next(); 5.19 + assert(ret == true, "relocInfo must exist at this address"); 5.20 + assert(iter.addr() == ic_call, "must find ic_call"); 5.21 + if (iter.type() == relocInfo::virtual_call_type) { 5.22 + virtual_call_Relocation* r = iter.virtual_call_reloc(); 5.23 + _is_optimized = false; 5.24 + _value = nativeMovConstReg_at(r->cached_value()); 5.25 + } else { 5.26 + assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call"); 5.27 + _is_optimized = true; 5.28 + _value = NULL; 5.29 + } 5.30 +} 5.31 5.32 bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS) { 5.33 assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");