comparison src/share/vm/code/compiledIC.hpp @ 20277:882004b9e7e1

8047362: Add a version of CompiledIC_at that doesn't create a new RelocIterator Reviewed-by: iveresov, mgerdin
author stefank
date Tue, 01 Jul 2014 09:03:55 +0200
parents 55fb97c4c58d
children 7848fc12602b
comparison
equal deleted inserted replaced
20276:1526a938e670 20277:882004b9e7e1
148 NativeCall* _ic_call; // the call instruction 148 NativeCall* _ic_call; // the call instruction
149 NativeMovConstReg* _value; // patchable value cell for this IC 149 NativeMovConstReg* _value; // patchable value cell for this IC
150 bool _is_optimized; // an optimized virtual call (i.e., no compiled IC) 150 bool _is_optimized; // an optimized virtual call (i.e., no compiled IC)
151 151
152 CompiledIC(nmethod* nm, NativeCall* ic_call); 152 CompiledIC(nmethod* nm, NativeCall* ic_call);
153 CompiledIC(RelocIterator* iter);
154
155 void initialize_from_iter(RelocIterator* iter);
153 156
154 static bool is_icholder_entry(address entry); 157 static bool is_icholder_entry(address entry);
155 158
156 // low-level inline-cache manipulation. Cannot be accessed directly, since it might not be MT-safe 159 // low-level inline-cache manipulation. Cannot be accessed directly, since it might not be MT-safe
157 // to change an inline-cache. These changes the underlying inline-cache directly. They *newer* make 160 // to change an inline-cache. These changes the underlying inline-cache directly. They *newer* make
181 public: 184 public:
182 // conversion (machine PC to CompiledIC*) 185 // conversion (machine PC to CompiledIC*)
183 friend CompiledIC* CompiledIC_before(nmethod* nm, address return_addr); 186 friend CompiledIC* CompiledIC_before(nmethod* nm, address return_addr);
184 friend CompiledIC* CompiledIC_at(nmethod* nm, address call_site); 187 friend CompiledIC* CompiledIC_at(nmethod* nm, address call_site);
185 friend CompiledIC* CompiledIC_at(Relocation* call_site); 188 friend CompiledIC* CompiledIC_at(Relocation* call_site);
189 friend CompiledIC* CompiledIC_at(RelocIterator* reloc_iter);
186 190
187 // This is used to release CompiledICHolder*s from nmethods that 191 // This is used to release CompiledICHolder*s from nmethods that
188 // are about to be freed. The callsite might contain other stale 192 // are about to be freed. The callsite might contain other stale
189 // values of other kinds so it must be careful. 193 // values of other kinds so it must be careful.
190 static void cleanup_call_site(virtual_call_Relocation* call_site); 194 static void cleanup_call_site(virtual_call_Relocation* call_site);
261 CompiledIC* c_ic = new CompiledIC(call_site->code(), nativeCall_at(call_site->addr())); 265 CompiledIC* c_ic = new CompiledIC(call_site->code(), nativeCall_at(call_site->addr()));
262 c_ic->verify(); 266 c_ic->verify();
263 return c_ic; 267 return c_ic;
264 } 268 }
265 269
270 inline CompiledIC* CompiledIC_at(RelocIterator* reloc_iter) {
271 assert(reloc_iter->type() == relocInfo::virtual_call_type ||
272 reloc_iter->type() == relocInfo::opt_virtual_call_type, "wrong reloc. info");
273 CompiledIC* c_ic = new CompiledIC(reloc_iter);
274 c_ic->verify();
275 return c_ic;
276 }
266 277
267 //----------------------------------------------------------------------------- 278 //-----------------------------------------------------------------------------
268 // The CompiledStaticCall represents a call to a static method in the compiled 279 // The CompiledStaticCall represents a call to a static method in the compiled
269 // 280 //
270 // Transition diagram of a static call site is somewhat simpler than for an inlined cache: 281 // Transition diagram of a static call site is somewhat simpler than for an inlined cache: