Mercurial > hg > truffle
comparison src/cpu/ppc/vm/compiledIC_ppc.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 | ec28f9c041ff |
children | 327e7269f90d |
comparison
equal
deleted
inserted
replaced
20270:b7d24d2bc8be | 20271:c64b6b0c40c8 |
---|---|
46 | 46 |
47 bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) { | 47 bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) { |
48 // This call site might have become stale so inspect it carefully. | 48 // This call site might have become stale so inspect it carefully. |
49 NativeCall* call = nativeCall_at(call_site->addr()); | 49 NativeCall* call = nativeCall_at(call_site->addr()); |
50 return is_icholder_entry(call->destination()); | 50 return is_icholder_entry(call->destination()); |
51 } | |
52 | |
53 //----------------------------------------------------------------------------- | |
54 // High-level access to an inline cache. Guaranteed to be MT-safe. | |
55 | |
56 CompiledIC::CompiledIC(nmethod* nm, NativeCall* call) | |
57 : _ic_call(call) | |
58 { | |
59 address ic_call = call->instruction_address(); | |
60 | |
61 assert(ic_call != NULL, "ic_call address must be set"); | |
62 assert(nm != NULL, "must pass nmethod"); | |
63 assert(nm->contains(ic_call), "must be in nmethod"); | |
64 | |
65 // Search for the ic_call at the given address. | |
66 RelocIterator iter(nm, ic_call, ic_call+1); | |
67 bool ret = iter.next(); | |
68 assert(ret == true, "relocInfo must exist at this address"); | |
69 assert(iter.addr() == ic_call, "must find ic_call"); | |
70 if (iter.type() == relocInfo::virtual_call_type) { | |
71 virtual_call_Relocation* r = iter.virtual_call_reloc(); | |
72 _is_optimized = false; | |
73 _value = nativeMovConstReg_at(r->cached_value()); | |
74 } else { | |
75 assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call"); | |
76 _is_optimized = true; | |
77 _value = NULL; | |
78 } | |
79 } | 51 } |
80 | 52 |
81 // ---------------------------------------------------------------------------- | 53 // ---------------------------------------------------------------------------- |
82 | 54 |
83 // A PPC CompiledStaticCall looks like this: | 55 // A PPC CompiledStaticCall looks like this: |