hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp
changeset 33602 16053580a684
parent 33208 5ec6ffa63c57
child 33611 9abd65805e19
--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	Fri Oct 23 14:33:19 2015 +0300
+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	Mon Oct 26 13:11:36 2015 -0400
@@ -2148,11 +2148,8 @@
         if (!constants->tag_at(index).is_unresolved_klass()) {
           // Make sure klass is initialized and doesn't have a finalizer
           Klass* entry = constants->slot_at(index).get_klass();
-          assert(entry->is_klass(), "Should be resolved klass");
-          Klass* k_entry = (Klass*) entry;
-          assert(k_entry->oop_is_instance(), "Should be InstanceKlass");
-          InstanceKlass* ik = (InstanceKlass*) k_entry;
-          if ( ik->is_initialized() && ik->can_be_fastpath_allocated() ) {
+          InstanceKlass* ik = InstanceKlass::cast(entry);
+          if (ik->is_initialized() && ik->can_be_fastpath_allocated() ) {
             size_t obj_size = ik->size_helper();
             oop result = NULL;
             // If the TLAB isn't pre-zeroed then we'll have to do it
@@ -2611,7 +2608,7 @@
                   but using InstanceKlass::cast(STACK_OBJECT(-parms)->klass()) causes in assertion failure
                   because rcvr->klass()->oop_is_instance() == 0
                   However it seems to have a vtable in the right location. Huh?
-
+                  Because vtables have the same offset for ArrayKlass and InstanceKlass.
               */
               callee = (Method*) rcvrKlass->start_of_vtable()[ cache->f2_as_index()];
               // Profile virtual call.