< prev index next >

src/hotspot/share/memory/metaspaceShared.cpp

Print this page

        

@@ -594,11 +594,11 @@
   Universe::set_long_mirror(NULL);
   Universe::set_short_mirror(NULL);
   Universe::set_void_mirror(NULL);
 }
 
-static void rewrite_nofast_bytecode(Method* method) {
+static void rewrite_nofast_bytecode(const methodHandle& method) {
   BytecodeStream bcs(method);
   while (!bcs.is_last_bytecode()) {
     Bytecodes::Code opcode = bcs.next();
     switch (opcode) {
     case Bytecodes::_getfield:      *bcs.bcp() = Bytecodes::_nofast_getfield;      break;

@@ -618,23 +618,23 @@
 // Walk all methods in the class list to ensure that they won't be modified at
 // run time. This includes:
 // [1] Rewrite all bytecodes as needed, so that the ConstMethod* will not be modified
 //     at run time by RewriteBytecodes/RewriteFrequentPairs
 // [2] Assign a fingerprint, so one doesn't need to be assigned at run-time.
-static void rewrite_nofast_bytecodes_and_calculate_fingerprints() {
+static void rewrite_nofast_bytecodes_and_calculate_fingerprints(Thread* thread) {
   for (int i = 0; i < _global_klass_objects->length(); i++) {
     Klass* k = _global_klass_objects->at(i);
     if (k->is_instance_klass()) {
       InstanceKlass* ik = InstanceKlass::cast(k);
-      MetaspaceShared::rewrite_nofast_bytecodes_and_calculate_fingerprints(ik);
+      MetaspaceShared::rewrite_nofast_bytecodes_and_calculate_fingerprints(thread, ik);
     }
   }
 }
 
-void MetaspaceShared::rewrite_nofast_bytecodes_and_calculate_fingerprints(InstanceKlass* ik) {
+void MetaspaceShared::rewrite_nofast_bytecodes_and_calculate_fingerprints(Thread* thread, InstanceKlass* ik) {
   for (int i = 0; i < ik->methods()->length(); i++) {
-    Method* m = ik->methods()->at(i);
+    methodHandle m(thread, ik->methods()->at(i));
     rewrite_nofast_bytecode(m);
     Fingerprinter fp(m);
     // The side effect of this call sets method's fingerprint field.
     fp.fingerprint();
   }

@@ -1491,11 +1491,11 @@
     tty->print_cr("    type array classes = %5d", num_type_array);
   }
 
   // Ensure the ConstMethods won't be modified at run-time
   tty->print("Updating ConstMethods ... ");
-  rewrite_nofast_bytecodes_and_calculate_fingerprints();
+  rewrite_nofast_bytecodes_and_calculate_fingerprints(THREAD);
   tty->print_cr("done. ");
 
   // Remove all references outside the metadata
   tty->print("Removing unshareable information ... ");
   remove_unshareable_in_classes();
< prev index next >