@@ -1236,6 +1236,12 @@ void Method::link_method(const methodHandle& h_method, TRAPS) {
12361236 (void ) make_adapters (h_method, CHECK);
12371237
12381238 // ONLY USE the h_method now as make_adapter may have blocked
1239+
1240+ if (h_method->is_continuation_enter_intrinsic ()) {
1241+ // the entry points to this method will be set in set_code, called when first resolving this method
1242+ _from_interpreted_entry = NULL ;
1243+ _from_compiled_entry = NULL ;
1244+ }
12391245}
12401246
12411247address Method::make_adapters (const methodHandle& mh, TRAPS) {
@@ -1317,12 +1323,16 @@ void Method::set_code(const methodHandle& mh, CompiledMethod *code) {
13171323 OrderAccess::storestore ();
13181324 mh->_from_compiled_entry = code->verified_entry_point ();
13191325 OrderAccess::storestore ();
1320- // Instantly compiled code can execute.
1321- if (!mh->is_method_handle_intrinsic ())
1322- mh->_from_interpreted_entry = mh->get_i2c_entry ();
1326+
13231327 if (mh->is_continuation_enter_intrinsic ()) {
1324- // this is the entry used when we're in interpreter-only mode; see InterpreterMacroAssembler::jump_from_interpreted
1328+ assert (mh->_from_interpreted_entry == NULL , " initialized incorrectly" ); // see link_method
1329+
1330+ // This is the entry used when we're in interpreter-only mode; see InterpreterMacroAssembler::jump_from_interpreted
13251331 mh->_i2i_entry = mh->get_i2c_entry ();
1332+ // This must come last, as it is what's tested in LinkResolver::resolve_static_call
1333+ Atomic::release_store (&mh->_from_interpreted_entry , mh->get_i2c_entry ());
1334+ } else if (!mh->is_method_handle_intrinsic ()) {
1335+ // Instantly compiled code can execute.
13261336 mh->_from_interpreted_entry = mh->get_i2c_entry ();
13271337 }
13281338}
0 commit comments