hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
changeset 46329 53ccc37bda19
parent 42664 29142a56c193
child 46424 2dfc07162b35
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Wed Mar 15 11:44:46 2017 +0100
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Wed Mar 15 10:25:37 2017 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -138,8 +138,8 @@
 // Allocation
 
 IRT_ENTRY(void, InterpreterRuntime::_new(JavaThread* thread, ConstantPool* pool, int index))
-  Klass* k_oop = pool->klass_at(index, CHECK);
-  instanceKlassHandle klass (THREAD, k_oop);
+  Klass* k = pool->klass_at(index, CHECK);
+  InstanceKlass* klass = InstanceKlass::cast(k);
 
   // Make sure we are not instantiating an abstract klass
   klass->check_valid_for_instantiation(true, CHECK);
@@ -461,8 +461,8 @@
     Exceptions::debug_check_abort(h_exception);
 
     // exception handler lookup
-    KlassHandle h_klass(THREAD, h_exception->klass());
-    handler_bci = Method::fast_exception_handler_bci_for(h_method, h_klass, current_bci, THREAD);
+    Klass* klass = h_exception->klass();
+    handler_bci = Method::fast_exception_handler_bci_for(h_method, klass, current_bci, THREAD);
     if (HAS_PENDING_EXCEPTION) {
       // We threw an exception while trying to find the exception handler.
       // Transfer the new exception to the exception handle which will
@@ -1070,15 +1070,15 @@
     // non-static field accessors have an object, but we need a handle
     h_obj = Handle(thread, obj);
   }
-  instanceKlassHandle h_cp_entry_f1(thread, (Klass*)cp_entry->f1_as_klass());
-  jfieldID fid = jfieldIDWorkaround::to_jfieldID(h_cp_entry_f1, cp_entry->f2_as_index(), is_static);
-  JvmtiExport::post_field_access(thread, method(thread), bcp(thread), h_cp_entry_f1, h_obj, fid);
+  InstanceKlass* cp_entry_f1 = InstanceKlass::cast(cp_entry->f1_as_klass());
+  jfieldID fid = jfieldIDWorkaround::to_jfieldID(cp_entry_f1, cp_entry->f2_as_index(), is_static);
+  JvmtiExport::post_field_access(thread, method(thread), bcp(thread), cp_entry_f1, h_obj, fid);
 IRT_END
 
 IRT_ENTRY(void, InterpreterRuntime::post_field_modification(JavaThread *thread,
   oopDesc* obj, ConstantPoolCacheEntry *cp_entry, jvalue *value))
 
-  Klass* k = (Klass*)cp_entry->f1_as_klass();
+  Klass* k = cp_entry->f1_as_klass();
 
   // check the access_flags for the field in the klass
   InstanceKlass* ik = InstanceKlass::cast(k);
@@ -1103,8 +1103,7 @@
   bool is_static = (obj == NULL);
 
   HandleMark hm(thread);
-  instanceKlassHandle h_klass(thread, k);
-  jfieldID fid = jfieldIDWorkaround::to_jfieldID(h_klass, cp_entry->f2_as_index(), is_static);
+  jfieldID fid = jfieldIDWorkaround::to_jfieldID(ik, cp_entry->f2_as_index(), is_static);
   jvalue fvalue;
 #ifdef _LP64
   fvalue = *value;
@@ -1128,7 +1127,7 @@
     h_obj = Handle(thread, obj);
   }
 
-  JvmtiExport::post_raw_field_modification(thread, method(thread), bcp(thread), h_klass, h_obj,
+  JvmtiExport::post_raw_field_modification(thread, method(thread), bcp(thread), ik, h_obj,
                                            fid, sig_type, &fvalue);
 IRT_END