< prev index next >

src/share/vm/opto/parse3.cpp

Print this page




 134       (void) pop();  // pop receiver after putting
 135     }
 136   } else {
 137     const TypeInstPtr* tip = TypeInstPtr::make(field_holder->java_mirror());
 138     obj = _gvn.makecon(tip);
 139     if (is_get) {
 140       do_get_xxx(obj, field, is_field);
 141     } else {
 142       do_put_xxx(obj, field, is_field);
 143     }
 144   }
 145 }
 146 
 147 
 148 void Parse::do_get_xxx(Node* obj, ciField* field, bool is_field) {
 149   // Does this field have a constant value?  If so, just push the value.
 150   if (field->is_constant()) {
 151     // final or stable field
 152     const Type* con_type = Type::make_constant(field, obj);
 153     if (con_type != NULL) {






 154       push_node(con_type->basic_type(), makecon(con_type));
 155       return;
 156     }
 157   }
 158   
 159   ciType* field_klass = field->type();
 160   bool is_vol = field->is_volatile();
 161 
 162   // Compute address and memory type.
 163   int offset = field->offset_in_bytes();
 164   const TypePtr* adr_type = C->alias_type(field)->adr_type();
 165   Node *adr = basic_plus_adr(obj, obj, offset);
 166   BasicType bt = field->layout_type();
 167 
 168   // Build the resultant type of the load
 169   const Type *type;
 170 
 171   bool must_assert_null = false;
 172 
 173   if( bt == T_OBJECT ) {




 134       (void) pop();  // pop receiver after putting
 135     }
 136   } else {
 137     const TypeInstPtr* tip = TypeInstPtr::make(field_holder->java_mirror());
 138     obj = _gvn.makecon(tip);
 139     if (is_get) {
 140       do_get_xxx(obj, field, is_field);
 141     } else {
 142       do_put_xxx(obj, field, is_field);
 143     }
 144   }
 145 }
 146 
 147 
 148 void Parse::do_get_xxx(Node* obj, ciField* field, bool is_field) {
 149   // Does this field have a constant value?  If so, just push the value.
 150   if (field->is_constant()) {
 151     // final or stable field
 152     const Type* con_type = Type::make_constant(field, obj);
 153     if (con_type != NULL) {
 154       if (TrustFinalNonStaticFields &&
 155           !field->is_static() && obj->is_Con()) {
 156         const TypeOopPtr* oop_ptr = obj->bottom_type()->isa_oopptr();
 157         ciObject* constant_oop = oop_ptr->const_oop();
 158         C->dependencies()->assert_constant_field_value_instance(field, constant_oop);
 159       }
 160       push_node(con_type->basic_type(), makecon(con_type));
 161       return;
 162     }
 163   }
 164 
 165   ciType* field_klass = field->type();
 166   bool is_vol = field->is_volatile();
 167 
 168   // Compute address and memory type.
 169   int offset = field->offset_in_bytes();
 170   const TypePtr* adr_type = C->alias_type(field)->adr_type();
 171   Node *adr = basic_plus_adr(obj, obj, offset);
 172   BasicType bt = field->layout_type();
 173 
 174   // Build the resultant type of the load
 175   const Type *type;
 176 
 177   bool must_assert_null = false;
 178 
 179   if( bt == T_OBJECT ) {


< prev index next >