changeset 513:920e65ad4626

coro-simple.patch: rebasing fixes
author Lukas Stadler <lukas.stadler@jku.at>
date Thu, 05 Sep 2013 18:02:53 +0200
parents f3dba3c8e66b
children 09506d69c8cb
files coro-simple.patch
diffstat 1 files changed, 111 insertions(+), 95 deletions(-) [+]
line wrap: on
line diff
--- a/coro-simple.patch	Wed Jun 26 00:08:34 2013 -0700
+++ b/coro-simple.patch	Thu Sep 05 18:02:53 2013 +0200
@@ -1,15 +1,3 @@
-diff --git a/src/cpu/x86/vm/assembler_x86.cpp b/src/cpu/x86/vm/assembler_x86.cpp
---- a/src/cpu/x86/vm/assembler_x86.cpp
-+++ b/src/cpu/x86/vm/assembler_x86.cpp
-@@ -6074,7 +6074,7 @@
-   andq(rsp, -16);     // align stack as required by push_CPU_state and call
-   push_CPU_state();   // keeps alignment at 16 bytes
-   lea(c_rarg0, ExternalAddress((address) msg));
--  call_VM_leaf(CAST_FROM_FN_PTR(address, warning), c_rarg0);
-+  call_VM_leaf(CAST_FROM_FN_PTR(address, warning_fixed_args), c_rarg0);
-   pop_CPU_state();
-   mov(rsp, rbp);
-   pop(rbp);
 diff --git a/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/src/cpu/x86/vm/sharedRuntime_x86_32.cpp
 --- a/src/cpu/x86/vm/sharedRuntime_x86_32.cpp
 +++ b/src/cpu/x86/vm/sharedRuntime_x86_32.cpp
@@ -22,7 +10,7 @@
  #define __ masm->
  
  const int StackAlignmentInSlots = StackAlignmentInBytes / VMRegImpl::stack_slot_size;
-@@ -1434,6 +1436,8 @@
+@@ -1483,6 +1485,8 @@
                                                   receiver_reg, member_reg, /*for_compiler_entry:*/ true);
  }
  
@@ -31,7 +19,7 @@
  // ---------------------------------------------------------------------------
  // Generate a native wrapper for a given method.  The method takes arguments
  // in the Java compiled code convention, marshals them to the native
-@@ -1760,6 +1764,16 @@
+@@ -1806,6 +1810,16 @@
      // need a 5 byte instruction to allow MT safe patching to non-entrant
      __ fat_nop();
    }
@@ -48,7 +36,7 @@
  
    // Generate a new frame for the wrapper.
    __ enter();
-@@ -3460,3 +3474,167 @@
+@@ -3508,3 +3522,167 @@
    // frame_size_words or bytes??
    return RuntimeStub::new_runtime_stub(name, &buffer, frame_complete, frame_size_words, oop_maps, true);
  }
@@ -231,7 +219,7 @@
  #define __ masm->
  
  const int StackAlignmentInSlots = StackAlignmentInBytes / VMRegImpl::stack_slot_size;
-@@ -1681,6 +1686,9 @@
+@@ -1711,6 +1716,9 @@
                                                   receiver_reg, member_reg, /*for_compiler_entry:*/ true);
  }
  
@@ -241,7 +229,7 @@
  // ---------------------------------------------------------------------------
  // Generate a native wrapper for a given method.  The method takes arguments
  // in the Java compiled code convention, marshals them to the native
-@@ -1971,6 +1979,15 @@
+@@ -1998,6 +2006,15 @@
      __ fat_nop();
    }
  
@@ -257,7 +245,7 @@
    // Generate a new frame for the wrapper.
    __ enter();
    // -2 because return address is already present and so is saved rbp
-@@ -2484,6 +2501,21 @@
+@@ -2503,6 +2520,21 @@
    }
  
    // Return
@@ -279,7 +267,7 @@
  
    __ ret(0);
  
-@@ -4051,3 +4083,208 @@
+@@ -4071,3 +4103,208 @@
    _exception_blob =  ExceptionBlob::create(&buffer, oop_maps, SimpleRuntimeFrame::framesize >> 1);
  }
  #endif // COMPILER2
@@ -491,7 +479,7 @@
 diff --git a/src/os/windows/vm/os_windows.cpp b/src/os/windows/vm/os_windows.cpp
 --- a/src/os/windows/vm/os_windows.cpp
 +++ b/src/os/windows/vm/os_windows.cpp
-@@ -2324,7 +2324,7 @@
+@@ -2393,7 +2393,7 @@
      bool in_java = thread->thread_state() == _thread_in_Java;
  
      // Handle potential stack overflows up front.
@@ -499,7 +487,7 @@
 +    if (exception_code == EXCEPTION_STACK_OVERFLOW || exception_code == EXCEPTION_GUARD_PAGE) {
        if (os::uses_stack_guard_pages()) {
  #ifdef _M_IA64
-         //
+         // Use guard page for register stack.
 diff --git a/src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.cpp b/src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.cpp
 --- a/src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.cpp
 +++ b/src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.cpp
@@ -579,7 +567,7 @@
 diff --git a/src/share/vm/classfile/javaClasses.cpp b/src/share/vm/classfile/javaClasses.cpp
 --- a/src/share/vm/classfile/javaClasses.cpp
 +++ b/src/share/vm/classfile/javaClasses.cpp
-@@ -2896,6 +2896,25 @@
+@@ -3058,6 +3058,25 @@
    compute_offset(_limit_offset, k, vmSymbols::limit_name(), vmSymbols::int_signature());
  }
  
@@ -588,7 +576,7 @@
 +int java_dyn_CoroutineBase::data_offset = 0;
 +
 +void java_dyn_CoroutineBase::compute_offsets() {
-+  klassOop k = SystemDictionary::coroutine_base_klass();
++  Klass* k = SystemDictionary::coroutine_base_klass();
 +  if (k != NULL) {
 +    compute_offset(data_offset,    k, vmSymbols::data_name(),    vmSymbols::long_signature());
 +  }
@@ -605,7 +593,7 @@
  void java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(TRAPS) {
    if (_owner_offset != 0) return;
  
-@@ -2999,6 +3018,8 @@
+@@ -3163,6 +3182,8 @@
  
    // generated interpreter code wants to know about the offsets we just computed:
    AbstractAssembler::update_delayed_values();
@@ -617,8 +605,8 @@
 diff --git a/src/share/vm/classfile/javaClasses.hpp b/src/share/vm/classfile/javaClasses.hpp
 --- a/src/share/vm/classfile/javaClasses.hpp
 +++ b/src/share/vm/classfile/javaClasses.hpp
-@@ -1287,6 +1287,24 @@
-   CLASS_INJECTED_FIELDS(macro)              \
+@@ -1349,6 +1349,24 @@
+   CLASSLOADER_INJECTED_FIELDS(macro)        \
    MEMBERNAME_INJECTED_FIELDS(macro)
  
 +class java_dyn_CoroutineBase: AllStatic {
@@ -645,21 +633,21 @@
 diff --git a/src/share/vm/classfile/systemDictionary.hpp b/src/share/vm/classfile/systemDictionary.hpp
 --- a/src/share/vm/classfile/systemDictionary.hpp
 +++ b/src/share/vm/classfile/systemDictionary.hpp
-@@ -179,6 +179,10 @@
-   template(Short_klass,                  java_lang_Short,                Pre) \
-   template(Integer_klass,                java_lang_Integer,              Pre) \
-   template(Long_klass,                   java_lang_Long,                 Pre) \
-+                                                                              \
-+  /* Stack manipulation classes */                                            \
-+  template(coroutine_support_klass,      java_dyn_CoroutineSupport,      Opt) \
-+  template(coroutine_base_klass,         java_dyn_CoroutineBase,         Opt) \
+@@ -181,6 +181,10 @@
+   do_klass(Short_klass,                                 java_lang_Short,                           Pre                 ) \
+   do_klass(Integer_klass,                               java_lang_Integer,                         Pre                 ) \
+   do_klass(Long_klass,                                  java_lang_Long,                            Pre                 ) \
++                                                                                                                         \
++  /* Stack manipulation classes */                                                                                       \
++  do_klass(coroutine_support_klass,                     java_dyn_CoroutineSupport,                 Opt                 ) \
++  do_klass(coroutine_base_klass,                        java_dyn_CoroutineBase,                    Opt                 ) \
    /*end*/
  
  
 diff --git a/src/share/vm/classfile/vmSymbols.hpp b/src/share/vm/classfile/vmSymbols.hpp
 --- a/src/share/vm/classfile/vmSymbols.hpp
 +++ b/src/share/vm/classfile/vmSymbols.hpp
-@@ -391,6 +391,7 @@
+@@ -413,6 +413,7 @@
    template(void_float_signature,                      "()F")                                      \
    template(void_double_signature,                     "()D")                                      \
    template(int_void_signature,                        "(I)V")                                     \
@@ -667,7 +655,7 @@
    template(int_int_signature,                         "(I)I")                                     \
    template(char_char_signature,                       "(C)C")                                     \
    template(short_short_signature,                     "(S)S")                                     \
-@@ -508,7 +509,7 @@
+@@ -537,7 +538,7 @@
    template(createGarbageCollectorMBean_signature,      "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/management/GarbageCollectorMBean;") \
    template(trigger_name,                               "trigger")                                                 \
    template(clear_name,                                 "clear")                                                   \
@@ -676,7 +664,7 @@
    template(startAgent_name,                            "startAgent")                                              \
    template(startRemoteAgent_name,                      "startRemoteManagementAgent")                              \
    template(startLocalAgent_name,                       "startLocalManagementAgent")                               \
-@@ -530,7 +531,7 @@
+@@ -559,7 +560,7 @@
    template(addThreadDumpForMonitors_name,              "addThreadDumpForMonitors")                                \
    template(addThreadDumpForSynchronizers_name,         "addThreadDumpForSynchronizers")                           \
    template(addThreadDumpForMonitors_signature,         "(Ljava/lang/management/ThreadInfo;[Ljava/lang/Object;[I)V") \
@@ -685,7 +673,7 @@
                                                                                                                    \
    /* JVMTI/java.lang.instrument support and VM Attach mechanism */                                                \
    template(sun_misc_VMSupport,                         "sun/misc/VMSupport")                                      \
-@@ -541,6 +542,26 @@
+@@ -570,6 +571,26 @@
    template(serializeAgentPropertiesToByteArray_name,   "serializeAgentPropertiesToByteArray")                     \
    template(classRedefinedCount_name,                   "classRedefinedCount")                                     \
                                                                                                                    \
@@ -712,7 +700,7 @@
    /* trace signatures */                                                                                          \
    TRACE_TEMPLATES(template)                                                                                       \
                                                                                                                    \
-@@ -879,9 +900,19 @@
+@@ -952,9 +973,19 @@
     do_name(     prefetchReadStatic_name,                         "prefetchReadStatic")                                  \
    do_intrinsic(_prefetchWriteStatic,      sun_misc_Unsafe,        prefetchWriteStatic_name, prefetch_signature,  F_SN)  \
     do_name(     prefetchWriteStatic_name,                        "prefetchWriteStatic")                                 \
@@ -735,10 +723,10 @@
 diff --git a/src/share/vm/prims/jni.cpp b/src/share/vm/prims/jni.cpp
 --- a/src/share/vm/prims/jni.cpp
 +++ b/src/share/vm/prims/jni.cpp
-@@ -5152,6 +5152,28 @@
- 
+@@ -5132,6 +5132,28 @@
      // Check if we should compile all classes on bootclasspath
      NOT_PRODUCT(if (CompileTheWorld) ClassLoader::compile_the_world();)
+     NOT_PRODUCT(if (ReplayCompiles) ciReplay::replay(thread);)
 +
 +    JavaThread* __the_thread__ = thread;
 +    HandleMark hm(THREAD);
@@ -746,8 +734,8 @@
 +    JavaValue result(T_VOID);
 +
 +    if (SystemDictionary::coroutine_support_klass() != NULL) {
-+      instanceKlass::cast(SystemDictionary::Class_klass())->initialize(CHECK_0);
-+      instanceKlass::cast(SystemDictionary::coroutine_support_klass())->initialize(CHECK_0);
++      InstanceKlass::cast(SystemDictionary::Class_klass())->initialize(CHECK_0);
++      InstanceKlass::cast(SystemDictionary::coroutine_support_klass())->initialize(CHECK_0);
 +      JavaCalls::call_virtual(&result,
 +                              obj,
 +                              KlassHandle(THREAD, SystemDictionary::Thread_klass()),
@@ -764,7 +752,7 @@
      // Since this is not a JVM_ENTRY we have to set the thread state manually before leaving.
      ThreadStateTransition::transition_and_fence(thread, _thread_in_vm, _thread_in_native);
    } else {
-@@ -5282,7 +5304,7 @@
+@@ -5262,7 +5284,7 @@
    thread->set_thread_state(_thread_in_vm);
    // Must do this before initialize_thread_local_storage
    thread->record_stack_base_and_size();
@@ -776,14 +764,14 @@
 diff --git a/src/share/vm/prims/jvm.cpp b/src/share/vm/prims/jvm.cpp
 --- a/src/share/vm/prims/jvm.cpp
 +++ b/src/share/vm/prims/jvm.cpp
-@@ -2620,6 +2620,22 @@
+@@ -2768,6 +2768,22 @@
    HandleMark hm(THREAD);
    Handle obj(THREAD, thread->threadObj());
    JavaValue result(T_VOID);
 +
 +  if (SystemDictionary::coroutine_support_klass() != NULL) {
-+    instanceKlass::cast(SystemDictionary::Class_klass())->initialize(CHECK);
-+    instanceKlass::cast(SystemDictionary::coroutine_support_klass())->initialize(CHECK);
++    InstanceKlass::cast(SystemDictionary::Class_klass())->initialize(CHECK);
++    InstanceKlass::cast(SystemDictionary::coroutine_support_klass())->initialize(CHECK);
 +    JavaCalls::call_virtual(&result,
 +                            obj,
 +                            KlassHandle(THREAD, SystemDictionary::Thread_klass()),
@@ -802,7 +790,7 @@
 diff --git a/src/share/vm/prims/nativeLookup.cpp b/src/share/vm/prims/nativeLookup.cpp
 --- a/src/share/vm/prims/nativeLookup.cpp
 +++ b/src/share/vm/prims/nativeLookup.cpp
-@@ -118,6 +118,7 @@
+@@ -119,6 +119,7 @@
  }
  
  extern "C" {
@@ -810,7 +798,7 @@
    void JNICALL JVM_RegisterUnsafeMethods(JNIEnv *env, jclass unsafecls);
    void JNICALL JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass unsafecls);
    void JNICALL JVM_RegisterPerfMethods(JNIEnv *env, jclass perfclass);
-@@ -135,6 +136,7 @@
+@@ -136,6 +137,7 @@
    { CC"Java_sun_misc_Unsafe_registerNatives",                      NULL, FN_PTR(JVM_RegisterUnsafeMethods)       },
    { CC"Java_java_lang_invoke_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) },
    { CC"Java_sun_misc_Perf_registerNatives",                        NULL, FN_PTR(JVM_RegisterPerfMethods)         },
@@ -821,10 +809,10 @@
 diff --git a/src/share/vm/prims/unsafe.cpp b/src/share/vm/prims/unsafe.cpp
 --- a/src/share/vm/prims/unsafe.cpp
 +++ b/src/share/vm/prims/unsafe.cpp
-@@ -27,9 +27,11 @@
- #ifndef SERIALGC
+@@ -28,9 +28,11 @@
+ #if INCLUDE_ALL_GCS
  #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
- #endif // SERIALGC
+ #endif // INCLUDE_ALL_GCS
 +#include "compiler/compileBroker.hpp"
  #include "memory/allocation.inline.hpp"
  #include "prims/jni.h"
@@ -833,7 +821,7 @@
  #include "runtime/globals.hpp"
  #include "runtime/interfaceSupport.hpp"
  #include "runtime/reflection.hpp"
-@@ -1288,6 +1290,107 @@
+@@ -1303,6 +1305,107 @@
    Prefetch::write(addr, (intx)offset);
  UNSAFE_END
  
@@ -941,8 +929,8 @@
  
  /// JVM_RegisterUnsafeMethods
  
-@@ -1587,6 +1690,22 @@
-     {CC"shouldBeInitialized",CC"("CLS")Z",               FN_PTR(Unsafe_ShouldBeInitialized)},
+@@ -1642,6 +1745,22 @@
+     {CC"fullFence",          CC"()V",                    FN_PTR(Unsafe_FullFence)},
  };
  
 +#define COBA "Ljava/dyn/CoroutineBase;"
@@ -964,8 +952,8 @@
  #undef CC
  #undef FN_PTR
  
-@@ -1694,3 +1813,30 @@
-     guarantee(status == 0, "register unsafe natives");
+@@ -1743,3 +1862,30 @@
+     register_natives("1.8 fence methods", env, unsafecls, fence_methods, sizeof(fence_methods)/sizeof(JNINativeMethod));
    }
  JVM_END
 +
@@ -987,7 +975,7 @@
 +        jmethodID id = env->GetStaticMethodID(corocls, coroutine_support_methods[i].name, coroutine_support_methods[i].signature);
 +        {
 +          ThreadInVMfromNative tivfn(thread);
-+          methodHandle method(JNIHandles::resolve_jmethod_id(id));
++          methodHandle method(Method::resolve_jmethod_id(id));
 +          uint id = 0; // CompileBroker::assign_compile_id(method, InvocationEntryBci);
 +          nmethod* nm = AdapterHandlerLibrary::create_native_wrapper(method, id);
 +        }
@@ -999,7 +987,7 @@
 new file mode 100644
 --- /dev/null
 +++ b/src/share/vm/runtime/coroutine.cpp
-@@ -0,0 +1,342 @@
+@@ -0,0 +1,356 @@
 +/*
 + * Copyright 2001-2010 Sun Microsystems, Inc.  All Rights Reserved.
 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1193,13 +1181,14 @@
 +private:
 +  OopClosure* _f;
 +  CodeBlobClosure* _cf;
++  CLDToOopClosure* _cld_f;
 +public:
-+  oops_do_Closure(OopClosure* f, CodeBlobClosure* cf): _f(f), _cf(cf) { }
-+  void frames_do(frame* fr, RegisterMap* map) { fr->oops_do(_f, _cf, map); }
++  oops_do_Closure(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf): _f(f), _cld_f(cld_f), _cf(cf) { }
++  void frames_do(frame* fr, RegisterMap* map) { fr->oops_do(_f, _cld_f, _cf, map); }
 +};
 +
-+void Coroutine::oops_do(OopClosure* f, CodeBlobClosure* cf) {
-+  oops_do_Closure fc(f, cf);
++void Coroutine::oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf) {
++  oops_do_Closure fc(f, cld_f, cf);
 +  frames_do(&fc);
 +  if (_state == _onstack &&_handle_area != NULL) {
 +    DEBUG_CORO_ONLY(tty->print_cr("collecting handle area %08x", _handle_area));
@@ -1220,6 +1209,19 @@
 +  frames_do(&fc);
 +}
 +
++class metadata_do_Closure: public FrameClosure {
++private:
++  void (*_f)(Metadata*);
++public:
++  metadata_do_Closure(void f(Metadata*)): _f(f) { }
++  void frames_do(frame* fr, RegisterMap* map) { fr->metadata_do(_f); }
++};
++
++void Coroutine::metadata_do(void f(Metadata*)) {
++  metadata_do_Closure fc(f);
++  frames_do(&fc);
++}
++
 +class frames_do_Closure: public FrameClosure {
 +private:
 +  void (*_f)(frame*, const RegisterMap*);
@@ -1346,7 +1348,7 @@
 new file mode 100644
 --- /dev/null
 +++ b/src/share/vm/runtime/coroutine.hpp
-@@ -0,0 +1,244 @@
+@@ -0,0 +1,245 @@
 +/*
 + * Copyright 1999-2010 Sun Microsystems, Inc.  All Rights Reserved.
 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1376,6 +1378,7 @@
 +
 +#include "runtime/jniHandles.hpp"
 +#include "runtime/handles.hpp"
++#include "memory/allocation.hpp"
 +#include "memory/resourceArea.hpp"
 +#include "runtime/javaFrameAnchor.hpp"
 +#include "runtime/monitorChunk.hpp"
@@ -1421,7 +1424,6 @@
 +class FrameClosure: public StackObj {
 +public:
 +  virtual void frames_do(frame* fr, RegisterMap* map) = 0;
-+  virtual ~FrameClosure() { }
 +};
 +
 +
@@ -1493,8 +1495,9 @@
 +  bool is_disposable();
 +
 +  // GC support
-+  void oops_do(OopClosure* f, CodeBlobClosure* cf);
++  void oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf);
 +  void nmethods_do(CodeBlobClosure* cf);
++  void metadata_do(void f(Metadata*));
 +  void frames_do(void f(frame*, const RegisterMap* map));
 +
 +  static ByteSize state_offset()              { return byte_offset_of(Coroutine, _state); }
@@ -1594,7 +1597,7 @@
 diff --git a/src/share/vm/runtime/frame.cpp b/src/share/vm/runtime/frame.cpp
 --- a/src/share/vm/runtime/frame.cpp
 +++ b/src/share/vm/runtime/frame.cpp
-@@ -1415,6 +1415,11 @@
+@@ -1432,6 +1432,11 @@
    _is_done = false;
  }
  
@@ -1609,7 +1612,7 @@
 diff --git a/src/share/vm/runtime/frame.hpp b/src/share/vm/runtime/frame.hpp
 --- a/src/share/vm/runtime/frame.hpp
 +++ b/src/share/vm/runtime/frame.hpp
-@@ -549,6 +549,7 @@
+@@ -551,6 +551,7 @@
    bool        _is_done;
   public:
     StackFrameStream(JavaThread *thread, bool update = true);
@@ -1620,7 +1623,7 @@
 diff --git a/src/share/vm/runtime/globals.hpp b/src/share/vm/runtime/globals.hpp
 --- a/src/share/vm/runtime/globals.hpp
 +++ b/src/share/vm/runtime/globals.hpp
-@@ -3890,6 +3890,12 @@
+@@ -3669,6 +3669,12 @@
            "EINTR for I/O operations results in OS_INTRPT. The default value"\
            " of this flag is true for JDK 6 and earlier")                    \
                                                                              \
@@ -1663,7 +1666,7 @@
 diff --git a/src/share/vm/runtime/handles.hpp b/src/share/vm/runtime/handles.hpp
 --- a/src/share/vm/runtime/handles.hpp
 +++ b/src/share/vm/runtime/handles.hpp
-@@ -243,6 +243,7 @@
+@@ -221,6 +221,7 @@
    friend class NoHandleMark;
    friend class ResetNoHandleMark;
  #ifdef ASSERT
@@ -1671,7 +1674,7 @@
    int _handle_mark_nesting;
    int _no_handle_mark_nesting;
  #endif
-@@ -254,6 +255,11 @@
+@@ -232,6 +233,11 @@
      debug_only(_no_handle_mark_nesting = 0);
      _prev = prev;
    }
@@ -1683,7 +1686,7 @@
  
    // Handle allocation
   private:
-@@ -322,6 +328,7 @@
+@@ -301,6 +307,7 @@
   public:
    HandleMark();                            // see handles_inline.hpp
    HandleMark(Thread* thread)                      { initialize(thread); }
@@ -1694,11 +1697,11 @@
 diff --git a/src/share/vm/runtime/javaCalls.cpp b/src/share/vm/runtime/javaCalls.cpp
 --- a/src/share/vm/runtime/javaCalls.cpp
 +++ b/src/share/vm/runtime/javaCalls.cpp
-@@ -119,6 +119,15 @@
+@@ -107,6 +107,15 @@
    }
  }
  
-+void JavaCallWrapper::initialize(JavaThread* thread, JNIHandleBlock* handles, methodOop callee_method, oop receiver, JavaValue* result) {
++void JavaCallWrapper::initialize(JavaThread* thread, JNIHandleBlock* handles, Method* callee_method, oop receiver, JavaValue* result) {
 +  _thread = thread;
 +  _handles = handles;
 +  _callee_method = callee_method;
@@ -1713,11 +1716,11 @@
 diff --git a/src/share/vm/runtime/javaCalls.hpp b/src/share/vm/runtime/javaCalls.hpp
 --- a/src/share/vm/runtime/javaCalls.hpp
 +++ b/src/share/vm/runtime/javaCalls.hpp
-@@ -79,8 +79,11 @@
+@@ -68,8 +68,11 @@
     JavaCallWrapper(methodHandle callee_method, Handle receiver, JavaValue* result, TRAPS);
    ~JavaCallWrapper();
  
-+  void initialize(JavaThread* thread, JNIHandleBlock* handles, methodOop callee_method, oop receiver, JavaValue* result);
++  void initialize(JavaThread* thread, JNIHandleBlock* handles, Method* callee_method, oop receiver, JavaValue* result);
 +
    // Accessors
    JavaThread*      thread() const           { return _thread; }
@@ -1728,7 +1731,7 @@
 diff --git a/src/share/vm/runtime/thread.cpp b/src/share/vm/runtime/thread.cpp
 --- a/src/share/vm/runtime/thread.cpp
 +++ b/src/share/vm/runtime/thread.cpp
-@@ -47,6 +47,7 @@
+@@ -48,6 +48,7 @@
  #include "runtime/aprofiler.hpp"
  #include "runtime/arguments.hpp"
  #include "runtime/biasedLocking.hpp"
@@ -1736,7 +1739,7 @@
  #include "runtime/deoptimization.hpp"
  #include "runtime/fprofiler.hpp"
  #include "runtime/frame.inline.hpp"
-@@ -324,6 +325,7 @@
+@@ -330,6 +331,7 @@
  
  
  Thread::~Thread() {
@@ -1744,7 +1747,7 @@
    // Reclaim the objectmonitors from the omFreeList of the moribund thread.
    ObjectSynchronizer::omFlush (this) ;
  
-@@ -1347,6 +1349,13 @@
+@@ -1444,6 +1446,13 @@
    _interp_only_mode    = 0;
    _special_runtime_exit_condition = _no_async_condition;
    _pending_async_exception = NULL;
@@ -1758,7 +1761,7 @@
    _is_compiling = false;
    _thread_stat = NULL;
    _thread_stat = new ThreadStatistics();
-@@ -1482,6 +1491,13 @@
+@@ -1579,6 +1588,13 @@
  }
  
  JavaThread::~JavaThread() {
@@ -1772,7 +1775,7 @@
    if (TraceThreadEvents) {
        tty->print_cr("terminate thread %p", this);
    }
-@@ -1536,6 +1552,8 @@
+@@ -1635,6 +1651,8 @@
    // Record real stack base and size.
    this->record_stack_base_and_size();
  
@@ -1781,7 +1784,7 @@
    // Initialize thread local storage; set before calling MutexLocker
    this->initialize_thread_local_storage();
  
-@@ -2480,6 +2498,12 @@
+@@ -2586,6 +2604,12 @@
      frame* fr = fst.current();
      f(fr, fst.register_map());
    }
@@ -1794,21 +1797,21 @@
  }
  
  
-@@ -2636,6 +2660,13 @@
-       fst.current()->oops_do(f, cf, fst.register_map());
+@@ -2748,6 +2772,13 @@
+       fst.current()->oops_do(f, cld_f, cf, fst.register_map());
      }
    }
 +  
 +
 +  Coroutine* current = _coroutine_list;
 +  do {
-+    current->oops_do(f, cf);
++    current->oops_do(f, cld_f, cf);
 +    current = current->next();
 +  } while (current != _coroutine_list);
  
    // callee_target is never live across a gc point so NULL it here should
    // it still contain a methdOop.
-@@ -2677,6 +2708,13 @@
+@@ -2788,6 +2819,12 @@
        fst.current()->nmethods_do(cf);
      }
    }
@@ -1818,11 +1821,24 @@
 +    current->nmethods_do(cf);
 +    current = current->next();
 +  } while (current != _coroutine_list);
+ }
+ 
+ void JavaThread::metadata_do(void f(Metadata*)) {
+@@ -2804,6 +2841,13 @@
+       ct->env()->metadata_do(f);
+     }
+   }
++
++  Coroutine* current = _coroutine_list;
++  do {
++    current->metadata_do(f);
++    current = current->next();
++  } while (current != _coroutine_list);
 +
  }
  
  // Printing
-@@ -3243,6 +3281,7 @@
+@@ -3380,6 +3424,7 @@
    // stacksize. This adjusted size is what is used to figure the placement
    // of the guard pages.
    main_thread->record_stack_base_and_size();
@@ -1830,7 +1846,7 @@
    main_thread->initialize_thread_local_storage();
  
    main_thread->set_active_handles(JNIHandleBlock::allocate_block());
-@@ -4552,3 +4591,9 @@
+@@ -4683,3 +4728,9 @@
    VMThread* thread = VMThread::vm_thread();
    if (thread != NULL) thread->verify();
  }
@@ -1843,7 +1859,7 @@
 diff --git a/src/share/vm/runtime/thread.hpp b/src/share/vm/runtime/thread.hpp
 --- a/src/share/vm/runtime/thread.hpp
 +++ b/src/share/vm/runtime/thread.hpp
-@@ -82,6 +82,9 @@
+@@ -87,6 +87,9 @@
  
  class WorkerThread;
  
@@ -1853,7 +1869,7 @@
  // Class hierarchy
  // - Thread
  //   - NamedThread
-@@ -583,6 +586,10 @@
+@@ -597,6 +600,10 @@
    void leaving_jvmti_env_iteration()             { --_jvmti_env_iteration_count; }
    bool is_inside_jvmti_env_iteration()           { return _jvmti_env_iteration_count > 0; }
  
@@ -1864,7 +1880,7 @@
    // Code generation
    static ByteSize exception_file_offset()        { return byte_offset_of(Thread, _exception_file   ); }
    static ByteSize exception_line_offset()        { return byte_offset_of(Thread, _exception_line   ); }
-@@ -897,6 +904,26 @@
+@@ -919,6 +926,26 @@
    // This is set to popframe_pending to signal that top Java frame should be popped immediately
    int _popframe_condition;
  
@@ -1891,7 +1907,7 @@
  #ifndef PRODUCT
    int _jmp_ring_index;
    struct {
-@@ -1316,6 +1343,9 @@
+@@ -1341,6 +1368,9 @@
    static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); }
    static ByteSize stack_guard_state_offset()     { return byte_offset_of(JavaThread, _stack_guard_state   ); }
    static ByteSize suspend_flags_offset()         { return byte_offset_of(JavaThread, _suspend_flags       ); }
@@ -1904,7 +1920,7 @@
 diff --git a/src/share/vm/runtime/threadLocalStorage.cpp b/src/share/vm/runtime/threadLocalStorage.cpp
 --- a/src/share/vm/runtime/threadLocalStorage.cpp
 +++ b/src/share/vm/runtime/threadLocalStorage.cpp
-@@ -57,6 +57,14 @@
+@@ -54,6 +54,14 @@
    guarantee(get_thread_slow() == thread, "must be the same thread, slowly");
  }
  
@@ -1946,7 +1962,7 @@
 diff --git a/src/share/vm/utilities/debug.cpp b/src/share/vm/utilities/debug.cpp
 --- a/src/share/vm/utilities/debug.cpp
 +++ b/src/share/vm/utilities/debug.cpp
-@@ -106,6 +106,16 @@
+@@ -109,6 +109,16 @@
    if (BreakAtWarning) BREAKPOINT;
  }
  
@@ -1966,7 +1982,7 @@
 diff --git a/src/share/vm/utilities/debug.hpp b/src/share/vm/utilities/debug.hpp
 --- a/src/share/vm/utilities/debug.hpp
 +++ b/src/share/vm/utilities/debug.hpp
-@@ -201,6 +201,7 @@
+@@ -224,6 +224,7 @@
  void report_untested(const char* file, int line, const char* message);
  
  void warning(const char* format, ...);