src/share/vm/c1/c1_GraphBuilder.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8073191-work Sdiff src/share/vm/c1

src/share/vm/c1/c1_GraphBuilder.cpp

Print this page




1583   switch (field_type) {
1584     case T_ARRAY:
1585     case T_OBJECT:
1586       if (field_value.as_object()->should_be_constant()) {
1587         return new Constant(value);
1588       }
1589       return NULL; // Not a constant.
1590     default:
1591       return new Constant(value);
1592   }
1593 }
1594 
1595 void GraphBuilder::access_field(Bytecodes::Code code) {
1596   bool will_link;
1597   ciField* field = stream()->get_field(will_link);
1598   ciInstanceKlass* holder = field->holder();
1599   BasicType field_type = field->type()->basic_type();
1600   ValueType* type = as_ValueType(field_type);
1601   // call will_link again to determine if the field is valid.
1602   const bool needs_patching = !holder->is_loaded() ||
1603                               !field->will_link(method()->holder(), code) ||
1604                               PatchALot;
1605 
1606   ValueStack* state_before = NULL;
1607   if (!holder->is_initialized() || needs_patching) {
1608     // save state before instruction for debug info when
1609     // deoptimization happens during patching
1610     state_before = copy_state_before();
1611   }
1612 
1613   Value obj = NULL;
1614   if (code == Bytecodes::_getstatic || code == Bytecodes::_putstatic) {
1615     if (state_before != NULL) {
1616       // build a patching constant
1617       obj = new Constant(new InstanceConstant(holder->java_mirror()), state_before);
1618     } else {
1619       obj = new Constant(new InstanceConstant(holder->java_mirror()));
1620     }
1621   }
1622 
1623   if (field->is_final() && (code == Bytecodes::_putfield)) {




1583   switch (field_type) {
1584     case T_ARRAY:
1585     case T_OBJECT:
1586       if (field_value.as_object()->should_be_constant()) {
1587         return new Constant(value);
1588       }
1589       return NULL; // Not a constant.
1590     default:
1591       return new Constant(value);
1592   }
1593 }
1594 
1595 void GraphBuilder::access_field(Bytecodes::Code code) {
1596   bool will_link;
1597   ciField* field = stream()->get_field(will_link);
1598   ciInstanceKlass* holder = field->holder();
1599   BasicType field_type = field->type()->basic_type();
1600   ValueType* type = as_ValueType(field_type);
1601   // call will_link again to determine if the field is valid.
1602   const bool needs_patching = !holder->is_loaded() ||
1603                               !field->will_link(method()->holder(), method(), code) ||
1604                               PatchALot;
1605 
1606   ValueStack* state_before = NULL;
1607   if (!holder->is_initialized() || needs_patching) {
1608     // save state before instruction for debug info when
1609     // deoptimization happens during patching
1610     state_before = copy_state_before();
1611   }
1612 
1613   Value obj = NULL;
1614   if (code == Bytecodes::_getstatic || code == Bytecodes::_putstatic) {
1615     if (state_before != NULL) {
1616       // build a patching constant
1617       obj = new Constant(new InstanceConstant(holder->java_mirror()), state_before);
1618     } else {
1619       obj = new Constant(new InstanceConstant(holder->java_mirror()));
1620     }
1621   }
1622 
1623   if (field->is_final() && (code == Bytecodes::_putfield)) {


src/share/vm/c1/c1_GraphBuilder.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File