< prev index next >

src/hotspot/share/interpreter/linkResolver.cpp

Print this page
@@ -44,21 +44,22 @@
  #include "memory/resourceArea.hpp"
  #include "oops/constantPool.hpp"
  #include "oops/cpCache.inline.hpp"
  #include "oops/instanceKlass.inline.hpp"
  #include "oops/klass.inline.hpp"
- #include "oops/method.hpp"
+ #include "oops/method.inline.hpp"
  #include "oops/objArrayKlass.hpp"
  #include "oops/objArrayOop.hpp"
  #include "oops/oop.inline.hpp"
  #include "prims/methodHandles.hpp"
  #include "runtime/fieldDescriptor.inline.hpp"
  #include "runtime/frame.inline.hpp"
  #include "runtime/handles.inline.hpp"
  #include "runtime/reflection.hpp"
  #include "runtime/safepointVerifiers.hpp"
  #include "runtime/signature.hpp"
+ #include "runtime/sharedRuntime.hpp"
  #include "runtime/thread.inline.hpp"
  #include "runtime/vmThread.hpp"
  
  //------------------------------------------------------------------------------------------------------------------------
  // Implementation of CallInfo

@@ -597,10 +598,20 @@
                         );
      return;
    }
  }
  
+ void LinkResolver::resolve_continuation_enter(CallInfo& callinfo, TRAPS) {
+   Klass* resolved_klass = vmClasses::Continuation_klass();
+   Symbol* method_name = vmSymbols::enter_name();
+   Symbol* method_signature = vmSymbols::continuationEnter_signature();
+   Klass*  current_klass = resolved_klass;
+   LinkInfo link_info(resolved_klass, method_name, method_signature, current_klass);
+   Method* resolved_method = resolve_method(link_info, Bytecodes::_invokestatic, CHECK);
+   callinfo.set_static(resolved_klass, methodHandle(THREAD, resolved_method), CHECK);
+ }
+ 
  Method* LinkResolver::resolve_method_statically(Bytecodes::Code code,
                                                  const constantPoolHandle& pool, int index, TRAPS) {
    // This method is used only
    // (1) in C2 from InlineTree::ok_to_inline (via ciMethod::check_call),
    // and

@@ -1076,10 +1087,18 @@
                        link_info.check_access() ? LinkInfo::AccessCheck::required : LinkInfo::AccessCheck::skip,
                        link_info.check_loader_constraints() ? LinkInfo::LoaderConstraintCheck::required : LinkInfo::LoaderConstraintCheck::skip);
      resolved_method = linktime_resolve_static_method(new_info, CHECK);
    }
  
+   if (resolved_method->is_continuation_enter_intrinsic()) {
+     if (!resolved_method->has_compiled_code()) {
+       methodHandle mh(THREAD, resolved_method);
+       // Generate a compiled form of the enterSpecial intrinsic.
+       AdapterHandlerLibrary::create_native_wrapper(mh);
+     }
+   }
+ 
    // setup result
    result.set_static(resolved_klass, methodHandle(THREAD, resolved_method), CHECK);
  }
  
  // throws linktime exceptions
< prev index next >