comparison src/cpu/zero/vm/compiledIC_zero.cpp @ 20271:c64b6b0c40c8

8047326: Consolidate all CompiledIC::CompiledIC implementations and move it to compiledIC.cpp Reviewed-by: vlivanov, ehelin
author stefank
date Wed, 25 Jun 2014 08:56:57 +0200
parents a6e09d6dd8e5
children
comparison
equal deleted inserted replaced
20270:b7d24d2bc8be 20271:c64b6b0c40c8
56 // This call site might have become stale so inspect it carefully. 56 // This call site might have become stale so inspect it carefully.
57 NativeCall* call = nativeCall_at(call_site->addr()); 57 NativeCall* call = nativeCall_at(call_site->addr());
58 return is_icholder_entry(call->destination()); 58 return is_icholder_entry(call->destination());
59 } 59 }
60 60
61 //-----------------------------------------------------------------------------
62 // High-level access to an inline cache. Guaranteed to be MT-safe.
63
64 CompiledIC::CompiledIC(nmethod* nm, NativeCall* call)
65 : _ic_call(call)
66 {
67 address ic_call = call->instruction_address();
68
69 assert(ic_call != NULL, "ic_call address must be set");
70 assert(nm != NULL, "must pass nmethod");
71 assert(nm->contains(ic_call), "must be in nmethod");
72
73 // Search for the ic_call at the given address.
74 RelocIterator iter(nm, ic_call, ic_call+1);
75 bool ret = iter.next();
76 assert(ret == true, "relocInfo must exist at this address");
77 assert(iter.addr() == ic_call, "must find ic_call");
78 if (iter.type() == relocInfo::virtual_call_type) {
79 virtual_call_Relocation* r = iter.virtual_call_reloc();
80 _is_optimized = false;
81 _value = nativeMovConstReg_at(r->cached_value());
82 } else {
83 assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call");
84 _is_optimized = true;
85 _value = NULL;
86 }
87 }
88
89 // ---------------------------------------------------------------------------- 61 // ----------------------------------------------------------------------------
90 62
91 void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) { 63 void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
92 ShouldNotReachHere(); // Only needed for COMPILER2. 64 ShouldNotReachHere(); // Only needed for COMPILER2.
93 } 65 }