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 } |