< prev index next >

src/share/vm/c1/c1_Runtime1.cpp

Print this page

        

@@ -329,11 +329,11 @@
 JRT_ENTRY(void, Runtime1::new_instance(JavaThread* thread, Klass* klass))
   NOT_PRODUCT(_new_instance_slowcase_cnt++;)
 
   assert(klass->is_klass(), "not a class");
   Handle holder(THREAD, klass->klass_holder()); // keep the klass alive
-  instanceKlassHandle h(thread, klass);
+  InstanceKlass* h = InstanceKlass::cast(klass);
   h->check_valid_for_instantiation(true, CHECK);
   // make sure klass is initialized
   h->initialize(CHECK);
   // allocate instance and return via TLS
   oop obj = h->allocate_instance(CHECK);

@@ -855,12 +855,12 @@
   // this is used by assertions in the access_field_patching_id
   BasicType patch_field_type = T_ILLEGAL;
   bool deoptimize_for_volatile = false;
   bool deoptimize_for_atomic = false;
   int patch_field_offset = -1;
-  KlassHandle init_klass(THREAD, NULL); // klass needed by load_klass_patching code
-  KlassHandle load_klass(THREAD, NULL); // klass needed by load_klass_patching code
+  Klass* init_klass = NULL; // klass needed by load_klass_patching code
+  Klass* load_klass = NULL; // klass needed by load_klass_patching code
   Handle mirror(THREAD, NULL);                    // oop needed by load_mirror_patching code
   Handle appendix(THREAD, NULL);                  // oop needed by appendix_patching code
   bool load_klass_or_mirror_patch_id =
     (stub_id == Runtime1::load_klass_patching_id || stub_id == Runtime1::load_mirror_patching_id);
 

@@ -903,11 +903,11 @@
     Klass* k = NULL;
     switch (code) {
       case Bytecodes::_putstatic:
       case Bytecodes::_getstatic:
         { Klass* klass = resolve_field_return_klass(caller_method, bci, CHECK);
-          init_klass = KlassHandle(THREAD, klass);
+          init_klass = klass;
           mirror = Handle(THREAD, klass->java_mirror());
         }
         break;
       case Bytecodes::_new:
         { Bytecode_new bnew(caller_method(), caller_method->bcp_from(bci));

@@ -943,12 +943,11 @@
           mirror = Handle(THREAD, m);
         }
         break;
       default: fatal("unexpected bytecode for load_klass_or_mirror_patch_id");
     }
-    // convert to handle
-    load_klass = KlassHandle(THREAD, k);
+    load_klass = k;
   } else if (stub_id == load_appendix_patching_id) {
     Bytecode_invoke bytecode(caller_method, bci);
     Bytecodes::Code bc = bytecode.invoke_code();
 
     CallInfo info;

@@ -1065,11 +1064,11 @@
           // place until initialization is complete.  In this case the
           // patch site is setup so that any threads besides the
           // initializing thread are forced to come into the VM and
           // block.
           do_patch = (code != Bytecodes::_getstatic && code != Bytecodes::_putstatic) ||
-                     InstanceKlass::cast(init_klass())->is_initialized();
+                     InstanceKlass::cast(init_klass)->is_initialized();
           NativeGeneralJump* jump = nativeGeneralJump_at(instr_pc);
           if (jump->jump_destination() == being_initialized_entry) {
             assert(do_patch == true, "initialization must be complete at this point");
           } else {
             // patch the instruction <move reg, klass>

@@ -1077,12 +1076,12 @@
 
             assert(n_copy->data() == 0 ||
                    n_copy->data() == (intptr_t)Universe::non_oop_word(),
                    "illegal init value");
             if (stub_id == Runtime1::load_klass_patching_id) {
-              assert(load_klass() != NULL, "klass not set");
-              n_copy->set_data((intx) (load_klass()));
+              assert(load_klass != NULL, "klass not set");
+              n_copy->set_data((intx) (load_klass));
             } else {
               assert(mirror() != NULL, "klass not set");
               // Don't need a G1 pre-barrier here since we assert above that data isn't an oop.
               n_copy->set_data(cast_from_oop<intx>(mirror()));
             }

@@ -1129,11 +1128,11 @@
               found = true;
             } else if (mds.type() == relocInfo::metadata_type) {
               assert(stub_id == Runtime1::load_klass_patching_id, "wrong stub id");
               metadata_Relocation* r = mds.metadata_reloc();
               Metadata** metadata_adr = r->metadata_addr();
-              *metadata_adr = load_klass();
+              *metadata_adr = load_klass;
               r->fix_metadata_relocation();
               found = true;
             }
           }
           assert(found, "the metadata must exist!");
< prev index next >