Mercurial > hg > graal-compiler
comparison src/share/vm/oops/cpCacheOop.cpp @ 3461:81d815b05abb
7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
Reviewed-by: never
author | jrose |
---|---|
date | Thu, 23 Jun 2011 17:14:06 -0700 |
parents | 08ccee2c4dbf |
children | e6b1331a51d2 |
comparison
equal
deleted
inserted
replaced
3460:e9b51b4bdcc7 | 3461:81d815b05abb |
---|---|
293 //set_bytecode_1(Bytecodes::_invokedynamic); | 293 //set_bytecode_1(Bytecodes::_invokedynamic); |
294 set_f1_if_null_atomic(call_site()); // This must be the last one to set (see NOTE above)! | 294 set_f1_if_null_atomic(call_site()); // This must be the last one to set (see NOTE above)! |
295 } | 295 } |
296 | 296 |
297 | 297 |
298 methodOop ConstantPoolCacheEntry::get_method_if_resolved(Bytecodes::Code invoke_code, constantPoolHandle cpool) { | |
299 assert(invoke_code > (Bytecodes::Code)0, "bad query"); | |
300 if (is_secondary_entry()) { | |
301 return cpool->cache()->entry_at(main_entry_index())->get_method_if_resolved(invoke_code, cpool); | |
302 } | |
303 // Decode the action of set_method and set_interface_call | |
304 if (bytecode_1() == invoke_code) { | |
305 oop f1 = _f1; | |
306 if (f1 != NULL) { | |
307 switch (invoke_code) { | |
308 case Bytecodes::_invokeinterface: | |
309 assert(f1->is_klass(), ""); | |
310 return klassItable::method_for_itable_index(klassOop(f1), (int) f2()); | |
311 case Bytecodes::_invokestatic: | |
312 case Bytecodes::_invokespecial: | |
313 assert(f1->is_method(), ""); | |
314 return methodOop(f1); | |
315 } | |
316 } | |
317 } | |
318 if (bytecode_2() == invoke_code) { | |
319 switch (invoke_code) { | |
320 case Bytecodes::_invokevirtual: | |
321 if (is_vfinal()) { | |
322 // invokevirtual | |
323 methodOop m = methodOop((intptr_t) f2()); | |
324 assert(m->is_method(), ""); | |
325 return m; | |
326 } else { | |
327 int holder_index = cpool->uncached_klass_ref_index_at(constant_pool_index()); | |
328 if (cpool->tag_at(holder_index).is_klass()) { | |
329 klassOop klass = cpool->resolved_klass_at(holder_index); | |
330 if (!Klass::cast(klass)->oop_is_instance()) | |
331 klass = SystemDictionary::Object_klass(); | |
332 return instanceKlass::cast(klass)->method_at_vtable((int) f2()); | |
333 } | |
334 } | |
335 } | |
336 } | |
337 return NULL; | |
338 } | |
339 | |
340 | |
341 | |
298 class LocalOopClosure: public OopClosure { | 342 class LocalOopClosure: public OopClosure { |
299 private: | 343 private: |
300 void (*_f)(oop*); | 344 void (*_f)(oop*); |
301 | 345 |
302 public: | 346 public: |