< prev index next >

src/share/vm/jvmci/jvmciEnv.cpp

Print this page




 340   Symbol* sig_sym  = cpool->signature_ref_at(index);
 341 
 342   if (cpool->has_preresolution()
 343       || ((holder == SystemDictionary::MethodHandle_klass() || holder == SystemDictionary::VarHandle_klass()) &&
 344           MethodHandles::is_signature_polymorphic_name(holder, name_sym))) {
 345     // Short-circuit lookups for JSR 292-related call sites.
 346     // That is, do not rely only on name-based lookups, because they may fail
 347     // if the names are not resolvable in the boot class loader (7056328).
 348     switch (bc) {
 349     case Bytecodes::_invokevirtual:
 350     case Bytecodes::_invokeinterface:
 351     case Bytecodes::_invokespecial:
 352     case Bytecodes::_invokestatic:
 353       {
 354         Method* m = ConstantPool::method_at_if_loaded(cpool, index);
 355         if (m != NULL) {
 356           return m;
 357         }
 358       }
 359       break;


 360     }
 361   }
 362 
 363   if (holder_is_accessible) { // Our declared holder is loaded.
 364     constantTag tag = cpool->tag_ref_at(index);
 365     methodHandle m = lookup_method(accessor, holder, name_sym, sig_sym, bc, tag);
 366     if (!m.is_null() &&
 367         (bc == Bytecodes::_invokestatic
 368          ?  InstanceKlass::cast(m->method_holder())->is_not_initialized()
 369          : !InstanceKlass::cast(m->method_holder())->is_loaded())) {
 370       m = NULL;
 371     }
 372     if (!m.is_null()) {
 373       // We found the method.
 374       return m;
 375     }
 376   }
 377 
 378   // Either the declared holder was not loaded, or the method could
 379   // not be found.


 587   if (failure_detail != NULL) {
 588     // A failure to allocate the string is silently ignored.
 589     Handle message = java_lang_String::create_from_str(failure_detail, THREAD);
 590     HotSpotCompiledNmethod::set_installationFailureMessage(compiled_code, message());
 591   }
 592 
 593   // JVMTI -- compiled method notification (must be done outside lock)
 594   if (nm != NULL) {
 595     nm->post_compiled_method_load_event();
 596 
 597     if (env == NULL) {
 598       // This compile didn't come through the CompileBroker so perform the printing here
 599       DirectiveSet* directive = DirectivesStack::getMatchingDirective(method, compiler);
 600       nm->maybe_print_nmethod(directive);
 601       DirectivesStack::release(directive);
 602     }
 603   }
 604 
 605   return result;
 606 }
 607 


 340   Symbol* sig_sym  = cpool->signature_ref_at(index);
 341 
 342   if (cpool->has_preresolution()
 343       || ((holder == SystemDictionary::MethodHandle_klass() || holder == SystemDictionary::VarHandle_klass()) &&
 344           MethodHandles::is_signature_polymorphic_name(holder, name_sym))) {
 345     // Short-circuit lookups for JSR 292-related call sites.
 346     // That is, do not rely only on name-based lookups, because they may fail
 347     // if the names are not resolvable in the boot class loader (7056328).
 348     switch (bc) {
 349     case Bytecodes::_invokevirtual:
 350     case Bytecodes::_invokeinterface:
 351     case Bytecodes::_invokespecial:
 352     case Bytecodes::_invokestatic:
 353       {
 354         Method* m = ConstantPool::method_at_if_loaded(cpool, index);
 355         if (m != NULL) {
 356           return m;
 357         }
 358       }
 359       break;
 360     default:
 361       break;
 362     }
 363   }
 364 
 365   if (holder_is_accessible) { // Our declared holder is loaded.
 366     constantTag tag = cpool->tag_ref_at(index);
 367     methodHandle m = lookup_method(accessor, holder, name_sym, sig_sym, bc, tag);
 368     if (!m.is_null() &&
 369         (bc == Bytecodes::_invokestatic
 370          ?  InstanceKlass::cast(m->method_holder())->is_not_initialized()
 371          : !InstanceKlass::cast(m->method_holder())->is_loaded())) {
 372       m = NULL;
 373     }
 374     if (!m.is_null()) {
 375       // We found the method.
 376       return m;
 377     }
 378   }
 379 
 380   // Either the declared holder was not loaded, or the method could
 381   // not be found.


 589   if (failure_detail != NULL) {
 590     // A failure to allocate the string is silently ignored.
 591     Handle message = java_lang_String::create_from_str(failure_detail, THREAD);
 592     HotSpotCompiledNmethod::set_installationFailureMessage(compiled_code, message());
 593   }
 594 
 595   // JVMTI -- compiled method notification (must be done outside lock)
 596   if (nm != NULL) {
 597     nm->post_compiled_method_load_event();
 598 
 599     if (env == NULL) {
 600       // This compile didn't come through the CompileBroker so perform the printing here
 601       DirectiveSet* directive = DirectivesStack::getMatchingDirective(method, compiler);
 602       nm->maybe_print_nmethod(directive);
 603       DirectivesStack::release(directive);
 604     }
 605   }
 606 
 607   return result;
 608 }

< prev index next >