< prev index next >

src/share/vm/prims/methodHandles.cpp

Print this page

        

@@ -34,10 +34,11 @@
 #include "memory/oopFactory.hpp"
 #include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/methodHandles.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "prims/unsafe.hpp"
 #include "runtime/compilationPolicy.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/reflection.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/stubRoutines.hpp"

@@ -1212,11 +1213,12 @@
     if ((flags & IS_FIELD) != 0 &&
         (must_be_static
          ? (flags & JVM_ACC_STATIC) != 0
          : (flags & JVM_ACC_STATIC) == 0)) {
       int vmindex = java_lang_invoke_MemberName::vmindex(mname);
-      return (jlong) vmindex;
+      bool is_final = (flags & JVM_ACC_FINAL) != 0;
+      return Unsafe::field_offset_from_byte_offset(vmindex, is_final);
     }
   }
   const char* msg = (must_be_static ? "static field required" : "non-static field required");
   THROW_MSG_0(vmSymbols::java_lang_InternalError(), msg);
   return 0;

@@ -1337,20 +1339,11 @@
 
     int marked = 0;
     {
       MutexLockerEx mu2(CodeCache_lock, Mutex::_no_safepoint_check_flag);
       nmethodBucket* b = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context());
-      while(b != NULL) {
-        nmethod* nm = b->get_nmethod();
-        if (b->count() > 0 && nm->is_alive() && !nm->is_marked_for_deoptimization()) {
-          nm->mark_for_deoptimization();
-          marked++;
-        }
-        nmethodBucket* next = b->next();
-        delete b;
-        b = next;
-      }
+      marked = nmethodBucket::release(b);
       java_lang_invoke_MethodHandleNatives_CallSiteContext::set_vmdependencies(context(), NULL); // reset context
     }
     if (marked > 0) {
       // At least one nmethod has been marked for deoptimization
       VM_Deoptimize op;
< prev index next >