Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/opto/parse3.cpp
          +++ new/src/share/vm/opto/parse3.cpp
↓ open down ↓ 139 lines elided ↑ open up ↑
 140  140      } else {
 141  141        do_put_xxx(obj, field, is_field);
 142  142      }
 143  143    }
 144  144  }
 145  145  
 146  146  
 147  147  void Parse::do_get_xxx(Node* obj, ciField* field, bool is_field) {
 148  148    // Does this field have a constant value?  If so, just push the value.
 149  149    if (field->is_constant()) {
      150 +    // final field
 150  151      if (field->is_static()) {
 151  152        // final static field
 152  153        if (push_constant(field->constant_value()))
 153  154          return;
 154  155      }
 155  156      else {
 156      -      // final non-static field of a trusted class (classes in
 157      -      // java.lang.invoke and sun.invoke packages and subpackages).
      157 +      // final non-static field
      158 +      // Treat final non-static fields of trusted classes (classes in
      159 +      // java.lang.invoke and sun.invoke packages and subpackages) as
      160 +      // compile time constants.
 158  161        if (obj->is_Con()) {
 159  162          const TypeOopPtr* oop_ptr = obj->bottom_type()->isa_oopptr();
 160  163          ciObject* constant_oop = oop_ptr->const_oop();
 161  164          ciConstant constant = field->constant_value_of(constant_oop);
 162      -
 163  165          if (push_constant(constant, true))
 164  166            return;
 165  167        }
 166  168      }
 167  169    }
 168  170  
 169  171    ciType* field_klass = field->type();
 170  172    bool is_vol = field->is_volatile();
 171  173  
 172  174    // Compute address and memory type.
↓ open down ↓ 359 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX