460 // Use the resolved_references() lock for this cpCache entry.
461 // resolved_references are created for all classes with Invokedynamic, MethodHandle
462 // or MethodType constant pool cache entries.
463 objArrayHandle resolved_references(Thread::current(), cpool->resolved_references());
464 assert(resolved_references() != NULL,
465 "a resolved_references array should have been created for this class");
466 ObjectLocker ol(resolved_references, THREAD);
467
468 // if f1 is not null or the indy_resolution_failed flag is set then another
469 // thread either succeeded in resolving the method or got a LinkageError
470 // exception, before this thread was able to record its failure. So, clear
471 // this thread's exception and return false so caller can use the earlier
472 // thread's result.
473 if (!is_f1_null() || indy_resolution_failed()) {
474 CLEAR_PENDING_EXCEPTION;
475 return false;
476 }
477
478 Symbol* error = PENDING_EXCEPTION->klass()->name();
479 Symbol* message = java_lang_Throwable::detail_message(PENDING_EXCEPTION);
480 assert(message != NULL, "Missing detail message");
481
482 SystemDictionary::add_resolution_error(cpool, index, error, message);
483 set_indy_resolution_failed();
484 return true;
485 }
486
487 Method* ConstantPoolCacheEntry::method_if_resolved(const constantPoolHandle& cpool) {
488 // Decode the action of set_method and set_interface_call
489 Bytecodes::Code invoke_code = bytecode_1();
490 if (invoke_code != (Bytecodes::Code)0) {
491 Metadata* f1 = f1_ord();
492 if (f1 != NULL) {
493 switch (invoke_code) {
494 case Bytecodes::_invokeinterface:
495 assert(f1->is_klass(), "");
496 return klassItable::method_for_itable_index((InstanceKlass*)f1, f2_as_index());
497 case Bytecodes::_invokestatic:
498 case Bytecodes::_invokespecial:
499 assert(!has_appendix(), "");
500 case Bytecodes::_invokehandle:
|
460 // Use the resolved_references() lock for this cpCache entry.
461 // resolved_references are created for all classes with Invokedynamic, MethodHandle
462 // or MethodType constant pool cache entries.
463 objArrayHandle resolved_references(Thread::current(), cpool->resolved_references());
464 assert(resolved_references() != NULL,
465 "a resolved_references array should have been created for this class");
466 ObjectLocker ol(resolved_references, THREAD);
467
468 // if f1 is not null or the indy_resolution_failed flag is set then another
469 // thread either succeeded in resolving the method or got a LinkageError
470 // exception, before this thread was able to record its failure. So, clear
471 // this thread's exception and return false so caller can use the earlier
472 // thread's result.
473 if (!is_f1_null() || indy_resolution_failed()) {
474 CLEAR_PENDING_EXCEPTION;
475 return false;
476 }
477
478 Symbol* error = PENDING_EXCEPTION->klass()->name();
479 Symbol* message = java_lang_Throwable::detail_message(PENDING_EXCEPTION);
480
481 SystemDictionary::add_resolution_error(cpool, index, error, message);
482 set_indy_resolution_failed();
483 return true;
484 }
485
486 Method* ConstantPoolCacheEntry::method_if_resolved(const constantPoolHandle& cpool) {
487 // Decode the action of set_method and set_interface_call
488 Bytecodes::Code invoke_code = bytecode_1();
489 if (invoke_code != (Bytecodes::Code)0) {
490 Metadata* f1 = f1_ord();
491 if (f1 != NULL) {
492 switch (invoke_code) {
493 case Bytecodes::_invokeinterface:
494 assert(f1->is_klass(), "");
495 return klassItable::method_for_itable_index((InstanceKlass*)f1, f2_as_index());
496 case Bytecodes::_invokestatic:
497 case Bytecodes::_invokespecial:
498 assert(!has_appendix(), "");
499 case Bytecodes::_invokehandle:
|