< prev index next >

src/hotspot/share/jvmci/jvmciCompilerToVM.cpp

Print this page




1634     THROW_MSG(vmSymbols::java_lang_IllegalStateException(), "invalid frame number")
1635   }
1636 
1637   // Reallocate the non-escaping objects and restore their fields.
1638   assert (virtualFrames->at(last_frame_number)->scope() != NULL,"invalid scope");
1639   GrowableArray<ScopeValue*>* objects = virtualFrames->at(last_frame_number)->scope()->objects();
1640 
1641   if (objects == NULL) {
1642     // no objects to materialize
1643     return;
1644   }
1645 
1646   bool realloc_failures = Deoptimization::realloc_objects(thread, fstAfterDeopt.current(), objects, CHECK);
1647   Deoptimization::reassign_fields(fstAfterDeopt.current(), fstAfterDeopt.register_map(), objects, realloc_failures, false);
1648 
1649   for (int frame_index = 0; frame_index < virtualFrames->length(); frame_index++) {
1650     compiledVFrame* cvf = virtualFrames->at(frame_index);
1651 
1652     GrowableArray<ScopeValue*>* scopeLocals = cvf->scope()->locals();
1653     StackValueCollection* locals = cvf->locals();
1654 
1655     if (locals != NULL) {
1656       for (int i2 = 0; i2 < locals->size(); i2++) {
1657         StackValue* var = locals->at(i2);
1658         if (var->type() == T_OBJECT && scopeLocals->at(i2)->is_object()) {
1659           jvalue val;
1660           val.l = (jobject) locals->at(i2)->get_obj()();
1661           cvf->update_local(T_OBJECT, i2, val);
1662         }
1663       }
1664     }





















1665   }
1666 
1667   // all locals are materialized by now
1668   HotSpotStackFrameReference::set_localIsVirtual(hs_frame, NULL);
1669 
1670   // update the locals array
1671   objArrayHandle array(THREAD, HotSpotStackFrameReference::locals(hs_frame));
1672   StackValueCollection* locals = virtualFrames->at(last_frame_number)->locals();
1673   for (int i = 0; i < locals->size(); i++) {
1674     StackValue* var = locals->at(i);
1675     if (var->type() == T_OBJECT) {
1676       array->obj_at_put(i, locals->at(i)->get_obj()());
1677     }
1678   }
1679 C2V_END
1680 
1681 C2V_VMENTRY(void, writeDebugOutput, (JNIEnv*, jobject, jbyteArray bytes, jint offset, jint length))
1682   if (bytes == NULL) {
1683     THROW(vmSymbols::java_lang_NullPointerException());
1684   }




1634     THROW_MSG(vmSymbols::java_lang_IllegalStateException(), "invalid frame number")
1635   }
1636 
1637   // Reallocate the non-escaping objects and restore their fields.
1638   assert (virtualFrames->at(last_frame_number)->scope() != NULL,"invalid scope");
1639   GrowableArray<ScopeValue*>* objects = virtualFrames->at(last_frame_number)->scope()->objects();
1640 
1641   if (objects == NULL) {
1642     // no objects to materialize
1643     return;
1644   }
1645 
1646   bool realloc_failures = Deoptimization::realloc_objects(thread, fstAfterDeopt.current(), objects, CHECK);
1647   Deoptimization::reassign_fields(fstAfterDeopt.current(), fstAfterDeopt.register_map(), objects, realloc_failures, false);
1648 
1649   for (int frame_index = 0; frame_index < virtualFrames->length(); frame_index++) {
1650     compiledVFrame* cvf = virtualFrames->at(frame_index);
1651 
1652     GrowableArray<ScopeValue*>* scopeLocals = cvf->scope()->locals();
1653     StackValueCollection* locals = cvf->locals();

1654     if (locals != NULL) {
1655       for (int i2 = 0; i2 < locals->size(); i2++) {
1656         StackValue* var = locals->at(i2);
1657         if (var->type() == T_OBJECT && scopeLocals->at(i2)->is_object()) {
1658           jvalue val;
1659           val.l = (jobject) locals->at(i2)->get_obj()();
1660           cvf->update_local(T_OBJECT, i2, val);
1661         }
1662       }
1663     }
1664 
1665     GrowableArray<ScopeValue*>* scopeExpressions = cvf->scope()->expressions();
1666     StackValueCollection* expressions = cvf->expressions();
1667     if (expressions != NULL) {
1668       for (int i2 = 0; i2 < expressions->size(); i2++) {
1669         StackValue* var = expressions->at(i2);
1670         if (var->type() == T_OBJECT && scopeExpressions->at(i2)->is_object()) {
1671           jvalue val;
1672           val.l = (jobject) expressions->at(i2)->get_obj()();
1673           cvf->update_stack(T_OBJECT, i2, val);
1674         }
1675       }
1676     }
1677 
1678     GrowableArray<MonitorValue*>* scopeMonitors = cvf->scope()->monitors();
1679     GrowableArray<MonitorInfo*>* monitors = cvf->monitors();
1680     if (monitors != NULL) {
1681       for (int i2 = 0; i2 < monitors->length(); i2++) {
1682         cvf->update_monitor(i2, monitors->at(i2));
1683       }
1684     }
1685   }
1686 
1687   // all locals are materialized by now
1688   HotSpotStackFrameReference::set_localIsVirtual(hs_frame, NULL);
1689 
1690   // update the locals array
1691   objArrayHandle array(THREAD, HotSpotStackFrameReference::locals(hs_frame));
1692   StackValueCollection* locals = virtualFrames->at(last_frame_number)->locals();
1693   for (int i = 0; i < locals->size(); i++) {
1694     StackValue* var = locals->at(i);
1695     if (var->type() == T_OBJECT) {
1696       array->obj_at_put(i, locals->at(i)->get_obj()());
1697     }
1698   }
1699 C2V_END
1700 
1701 C2V_VMENTRY(void, writeDebugOutput, (JNIEnv*, jobject, jbyteArray bytes, jint offset, jint length))
1702   if (bytes == NULL) {
1703     THROW(vmSymbols::java_lang_NullPointerException());
1704   }


< prev index next >