< prev index next >

src/hotspot/share/interpreter/interpreterRuntime.cpp

Print this page
rev 49250 : [mq]: JDK-8199781.patch


 137   case 2: guarantee(bytecode == Bytecodes::_ldc2_w, ""); break;
 138   case 1: guarantee(bytecode != Bytecodes::_ldc2_w, ""); break;
 139   default: ShouldNotReachHere();
 140   }
 141 
 142   // Resolve the constant.  This does not do unboxing.
 143   // But it does replace Universe::the_null_sentinel by null.
 144   oop result = ldc.resolve_constant(CHECK);
 145   assert(result != NULL || is_fast_aldc, "null result only valid for fast_aldc");
 146 
 147 #ifdef ASSERT
 148   {
 149     // The bytecode wrappers aren't GC-safe so construct a new one
 150     Bytecode_loadconstant ldc2(m, last_frame.bci());
 151     int rindex = ldc2.cache_index();
 152     if (rindex < 0)
 153       rindex = m->constants()->cp_to_object_index(ldc2.pool_index());
 154     if (rindex >= 0) {
 155       oop coop = m->constants()->resolved_references()->obj_at(rindex);
 156       oop roop = (result == NULL ? Universe::the_null_sentinel() : result);
 157       assert(roop == coop, "expected result for assembly code");
 158     }
 159   }
 160 #endif
 161   thread->set_vm_result(result);
 162   if (!is_fast_aldc) {
 163     // Tell the interpreter how to unbox the primitive.
 164     guarantee(java_lang_boxing_object::is_instance(result, type), "");
 165     int offset = java_lang_boxing_object::value_offset_in_bytes(type);
 166     intptr_t flags = ((as_TosState(type) << ConstantPoolCacheEntry::tos_state_shift)
 167                       | (offset & ConstantPoolCacheEntry::field_index_mask));
 168     thread->set_vm_result_2((Metadata*)flags);
 169   }
 170 }
 171 IRT_END
 172 
 173 
 174 //------------------------------------------------------------------------------------------------------------------------
 175 // Allocation
 176 
 177 IRT_ENTRY(void, InterpreterRuntime::_new(JavaThread* thread, ConstantPool* pool, int index))




 137   case 2: guarantee(bytecode == Bytecodes::_ldc2_w, ""); break;
 138   case 1: guarantee(bytecode != Bytecodes::_ldc2_w, ""); break;
 139   default: ShouldNotReachHere();
 140   }
 141 
 142   // Resolve the constant.  This does not do unboxing.
 143   // But it does replace Universe::the_null_sentinel by null.
 144   oop result = ldc.resolve_constant(CHECK);
 145   assert(result != NULL || is_fast_aldc, "null result only valid for fast_aldc");
 146 
 147 #ifdef ASSERT
 148   {
 149     // The bytecode wrappers aren't GC-safe so construct a new one
 150     Bytecode_loadconstant ldc2(m, last_frame.bci());
 151     int rindex = ldc2.cache_index();
 152     if (rindex < 0)
 153       rindex = m->constants()->cp_to_object_index(ldc2.pool_index());
 154     if (rindex >= 0) {
 155       oop coop = m->constants()->resolved_references()->obj_at(rindex);
 156       oop roop = (result == NULL ? Universe::the_null_sentinel() : result);
 157       assert(oopDesc::equals(roop, coop), "expected result for assembly code");
 158     }
 159   }
 160 #endif
 161   thread->set_vm_result(result);
 162   if (!is_fast_aldc) {
 163     // Tell the interpreter how to unbox the primitive.
 164     guarantee(java_lang_boxing_object::is_instance(result, type), "");
 165     int offset = java_lang_boxing_object::value_offset_in_bytes(type);
 166     intptr_t flags = ((as_TosState(type) << ConstantPoolCacheEntry::tos_state_shift)
 167                       | (offset & ConstantPoolCacheEntry::field_index_mask));
 168     thread->set_vm_result_2((Metadata*)flags);
 169   }
 170 }
 171 IRT_END
 172 
 173 
 174 //------------------------------------------------------------------------------------------------------------------------
 175 // Allocation
 176 
 177 IRT_ENTRY(void, InterpreterRuntime::_new(JavaThread* thread, ConstantPool* pool, int index))


< prev index next >