Mercurial > hg > truffle
comparison src/share/vm/opto/parse3.cpp @ 2376:c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
Reviewed-by: kvn, coleenp, twisti, stefank
author | never |
---|---|
date | Fri, 18 Mar 2011 16:00:34 -0700 |
parents | 8033953d67ff |
children | 263247c478c5 |
comparison
equal
deleted
inserted
replaced
2375:d673ef06fe96 | 2376:c7f3d0b4570f |
---|---|
110 int obj_depth = is_get ? 0 : field->type()->size(); | 110 int obj_depth = is_get ? 0 : field->type()->size(); |
111 obj = do_null_check(peek(obj_depth), T_OBJECT); | 111 obj = do_null_check(peek(obj_depth), T_OBJECT); |
112 // Compile-time detect of null-exception? | 112 // Compile-time detect of null-exception? |
113 if (stopped()) return; | 113 if (stopped()) return; |
114 | 114 |
115 #ifdef ASSERT | |
115 const TypeInstPtr *tjp = TypeInstPtr::make(TypePtr::NotNull, iter().get_declared_field_holder()); | 116 const TypeInstPtr *tjp = TypeInstPtr::make(TypePtr::NotNull, iter().get_declared_field_holder()); |
116 assert(_gvn.type(obj)->higher_equal(tjp), "cast_up is no longer needed"); | 117 assert(_gvn.type(obj)->higher_equal(tjp), "cast_up is no longer needed"); |
118 #endif | |
117 | 119 |
118 if (is_get) { | 120 if (is_get) { |
119 --_sp; // pop receiver before getting | 121 --_sp; // pop receiver before getting |
120 do_get_xxx(tjp, obj, field, is_field); | 122 do_get_xxx(obj, field, is_field); |
121 } else { | 123 } else { |
122 do_put_xxx(tjp, obj, field, is_field); | 124 do_put_xxx(obj, field, is_field); |
123 --_sp; // pop receiver after putting | 125 --_sp; // pop receiver after putting |
124 } | 126 } |
125 } else { | 127 } else { |
126 const TypeKlassPtr* tkp = TypeKlassPtr::make(field_holder); | 128 const TypeInstPtr* tip = TypeInstPtr::make(field_holder->java_mirror()); |
127 obj = _gvn.makecon(tkp); | 129 obj = _gvn.makecon(tip); |
128 if (is_get) { | 130 if (is_get) { |
129 do_get_xxx(tkp, obj, field, is_field); | 131 do_get_xxx(obj, field, is_field); |
130 } else { | 132 } else { |
131 do_put_xxx(tkp, obj, field, is_field); | 133 do_put_xxx(obj, field, is_field); |
132 } | 134 } |
133 } | 135 } |
134 } | 136 } |
135 | 137 |
136 | 138 |
137 void Parse::do_get_xxx(const TypePtr* obj_type, Node* obj, ciField* field, bool is_field) { | 139 void Parse::do_get_xxx(Node* obj, ciField* field, bool is_field) { |
138 // Does this field have a constant value? If so, just push the value. | 140 // Does this field have a constant value? If so, just push the value. |
139 if (field->is_constant()) { | 141 if (field->is_constant()) { |
140 if (field->is_static()) { | 142 if (field->is_static()) { |
141 // final static field | 143 // final static field |
142 if (push_constant(field->constant_value())) | 144 if (push_constant(field->constant_value())) |
229 // Memory barrier includes bogus read of value to force load BEFORE membar | 231 // Memory barrier includes bogus read of value to force load BEFORE membar |
230 insert_mem_bar(Op_MemBarAcquire, ld); | 232 insert_mem_bar(Op_MemBarAcquire, ld); |
231 } | 233 } |
232 } | 234 } |
233 | 235 |
234 void Parse::do_put_xxx(const TypePtr* obj_type, Node* obj, ciField* field, bool is_field) { | 236 void Parse::do_put_xxx(Node* obj, ciField* field, bool is_field) { |
235 bool is_vol = field->is_volatile(); | 237 bool is_vol = field->is_volatile(); |
236 // If reference is volatile, prevent following memory ops from | 238 // If reference is volatile, prevent following memory ops from |
237 // floating down past the volatile write. Also prevents commoning | 239 // floating down past the volatile write. Also prevents commoning |
238 // another volatile read. | 240 // another volatile read. |
239 if (is_vol) insert_mem_bar(Op_MemBarRelease); | 241 if (is_vol) insert_mem_bar(Op_MemBarRelease); |