< prev index next >

src/hotspot/share/jvmci/jvmciCompilerToVM.cpp

Print this page

1592   int last_frame_number = JVMCIENV->get_HotSpotStackFrameReference_frameNumber(hs_frame);
1593   if (last_frame_number >= virtualFrames->length()) {
1594     JVMCI_THROW_MSG(IllegalStateException, "invalid frame number");
1595   }
1596 
1597   // Reallocate the non-escaping objects and restore their fields.
1598   assert (virtualFrames->at(last_frame_number)->scope() != NULL,"invalid scope");
1599   GrowableArray<ScopeValue*>* objects = virtualFrames->at(last_frame_number)->scope()->objects();
1600 
1601   if (objects == NULL) {
1602     // no objects to materialize
1603     return;
1604   }
1605 
1606   bool realloc_failures = Deoptimization::realloc_objects(thread, fstAfterDeopt.current(), fstAfterDeopt.register_map(), objects, CHECK);
1607   Deoptimization::reassign_fields(fstAfterDeopt.current(), fstAfterDeopt.register_map(), objects, realloc_failures, false);
1608 
1609   for (int frame_index = 0; frame_index < virtualFrames->length(); frame_index++) {
1610     compiledVFrame* cvf = virtualFrames->at(frame_index);
1611 
1612     GrowableArray<ScopeValue*>* extentLocals = cvf->scope()->locals();
1613     StackValueCollection* locals = cvf->locals();
1614     if (locals != NULL) {
1615       for (int i2 = 0; i2 < locals->size(); i2++) {
1616         StackValue* var = locals->at(i2);
1617         if (var->type() == T_OBJECT && extentLocals->at(i2)->is_object()) {
1618           jvalue val;
1619           val.l = cast_from_oop<jobject>(locals->at(i2)->get_obj()());
1620           cvf->update_local(T_OBJECT, i2, val);
1621         }
1622       }
1623     }
1624 
1625     GrowableArray<ScopeValue*>* scopeExpressions = cvf->scope()->expressions();
1626     StackValueCollection* expressions = cvf->expressions();
1627     if (expressions != NULL) {
1628       for (int i2 = 0; i2 < expressions->size(); i2++) {
1629         StackValue* var = expressions->at(i2);
1630         if (var->type() == T_OBJECT && scopeExpressions->at(i2)->is_object()) {
1631           jvalue val;
1632           val.l = cast_from_oop<jobject>(expressions->at(i2)->get_obj()());
1633           cvf->update_stack(T_OBJECT, i2, val);
1634         }
1635       }
1636     }
1637 

1592   int last_frame_number = JVMCIENV->get_HotSpotStackFrameReference_frameNumber(hs_frame);
1593   if (last_frame_number >= virtualFrames->length()) {
1594     JVMCI_THROW_MSG(IllegalStateException, "invalid frame number");
1595   }
1596 
1597   // Reallocate the non-escaping objects and restore their fields.
1598   assert (virtualFrames->at(last_frame_number)->scope() != NULL,"invalid scope");
1599   GrowableArray<ScopeValue*>* objects = virtualFrames->at(last_frame_number)->scope()->objects();
1600 
1601   if (objects == NULL) {
1602     // no objects to materialize
1603     return;
1604   }
1605 
1606   bool realloc_failures = Deoptimization::realloc_objects(thread, fstAfterDeopt.current(), fstAfterDeopt.register_map(), objects, CHECK);
1607   Deoptimization::reassign_fields(fstAfterDeopt.current(), fstAfterDeopt.register_map(), objects, realloc_failures, false);
1608 
1609   for (int frame_index = 0; frame_index < virtualFrames->length(); frame_index++) {
1610     compiledVFrame* cvf = virtualFrames->at(frame_index);
1611 
1612     GrowableArray<ScopeValue*>* scopedValues = cvf->scope()->locals();
1613     StackValueCollection* locals = cvf->locals();
1614     if (locals != NULL) {
1615       for (int i2 = 0; i2 < locals->size(); i2++) {
1616         StackValue* var = locals->at(i2);
1617         if (var->type() == T_OBJECT && scopedValues->at(i2)->is_object()) {
1618           jvalue val;
1619           val.l = cast_from_oop<jobject>(locals->at(i2)->get_obj()());
1620           cvf->update_local(T_OBJECT, i2, val);
1621         }
1622       }
1623     }
1624 
1625     GrowableArray<ScopeValue*>* scopeExpressions = cvf->scope()->expressions();
1626     StackValueCollection* expressions = cvf->expressions();
1627     if (expressions != NULL) {
1628       for (int i2 = 0; i2 < expressions->size(); i2++) {
1629         StackValue* var = expressions->at(i2);
1630         if (var->type() == T_OBJECT && scopeExpressions->at(i2)->is_object()) {
1631           jvalue val;
1632           val.l = cast_from_oop<jobject>(expressions->at(i2)->get_obj()());
1633           cvf->update_stack(T_OBJECT, i2, val);
1634         }
1635       }
1636     }
1637 
< prev index next >