src/hotspot/share/runtime/sharedRuntime.cpp
changeset 55105 9ad765641e8f
parent 54752 3fbaea4b1f1c
child 55293 d19dc5b10fbb
equal deleted inserted replaced
55104:a72e187adb54 55105:9ad765641e8f
  1312           if (!inline_cache->set_to_monomorphic(virtual_call_info)) {
  1312           if (!inline_cache->set_to_monomorphic(virtual_call_info)) {
  1313             return false;
  1313             return false;
  1314           }
  1314           }
  1315         }
  1315         }
  1316       } else {
  1316       } else {
       
  1317         if (VM_Version::supports_fast_class_init_checks() &&
       
  1318             invoke_code == Bytecodes::_invokestatic &&
       
  1319             callee_method->needs_clinit_barrier() &&
       
  1320             callee != NULL && (callee->is_compiled_by_jvmci() || callee->is_aot())) {
       
  1321           return true; // skip patching for JVMCI or AOT code
       
  1322         }
  1317         CompiledStaticCall* ssc = caller_nm->compiledStaticCall_before(caller_frame.pc());
  1323         CompiledStaticCall* ssc = caller_nm->compiledStaticCall_before(caller_frame.pc());
  1318         if (ssc->is_clean()) ssc->set(static_call_info);
  1324         if (ssc->is_clean()) ssc->set(static_call_info);
  1319       }
  1325       }
  1320     }
  1326     }
  1321   } // unlock CompiledICLocker
  1327   } // unlock CompiledICLocker
  1374     tty->print_cr(" at pc: " INTPTR_FORMAT " to code: " INTPTR_FORMAT,
  1380     tty->print_cr(" at pc: " INTPTR_FORMAT " to code: " INTPTR_FORMAT,
  1375                   p2i(caller_frame.pc()), p2i(callee_method->code()));
  1381                   p2i(caller_frame.pc()), p2i(callee_method->code()));
  1376   }
  1382   }
  1377 #endif
  1383 #endif
  1378 
  1384 
  1379   // Do not patch call site for static call when the class is not
  1385   if (invoke_code == Bytecodes::_invokestatic) {
  1380   // fully initialized.
  1386     assert(callee_method->method_holder()->is_initialized() ||
  1381   if (invoke_code == Bytecodes::_invokestatic &&
  1387            callee_method->method_holder()->is_reentrant_initialization(thread),
  1382       !callee_method->method_holder()->is_initialized()) {
  1388            "invalid class initialization state for invoke_static");
  1383     assert(callee_method->method_holder()->is_linked(), "must be");
  1389     if (!VM_Version::supports_fast_class_init_checks() && callee_method->needs_clinit_barrier()) {
  1384     return callee_method;
  1390       // In order to keep class initialization check, do not patch call
       
  1391       // site for static call when the class is not fully initialized.
       
  1392       // Proper check is enforced by call site re-resolution on every invocation.
       
  1393       //
       
  1394       // When fast class initialization checks are supported (VM_Version::supports_fast_class_init_checks() == true),
       
  1395       // explicit class initialization check is put in nmethod entry (VEP).
       
  1396       assert(callee_method->method_holder()->is_linked(), "must be");
       
  1397       return callee_method;
       
  1398     }
  1385   }
  1399   }
  1386 
  1400 
  1387   // JSR 292 key invariant:
  1401   // JSR 292 key invariant:
  1388   // If the resolved method is a MethodHandle invoke target, the call
  1402   // If the resolved method is a MethodHandle invoke target, the call
  1389   // site must be a MethodHandle call site, because the lambda form might tail-call
  1403   // site must be a MethodHandle call site, because the lambda form might tail-call