Mercurial > hg > truffle
comparison src/share/vm/opto/parse3.cpp @ 10408:836a62f43af9
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 19 Jun 2013 10:45:56 +0200 |
parents | 6f3fd5150b67 |
children | fcf521c3fbc6 |
comparison
equal
deleted
inserted
replaced
10086:e0fb8a213650 | 10408:836a62f43af9 |
---|---|
148 // Does this field have a constant value? If so, just push the value. | 148 // Does this field have a constant value? If so, just push the value. |
149 if (field->is_constant()) { | 149 if (field->is_constant()) { |
150 // final field | 150 // final field |
151 if (field->is_static()) { | 151 if (field->is_static()) { |
152 // final static field | 152 // final static field |
153 if (C->eliminate_boxing()) { | |
154 // The pointers in the autobox arrays are always non-null. | |
155 ciSymbol* klass_name = field->holder()->name(); | |
156 if (field->name() == ciSymbol::cache_field_name() && | |
157 field->holder()->uses_default_loader() && | |
158 (klass_name == ciSymbol::java_lang_Character_CharacterCache() || | |
159 klass_name == ciSymbol::java_lang_Byte_ByteCache() || | |
160 klass_name == ciSymbol::java_lang_Short_ShortCache() || | |
161 klass_name == ciSymbol::java_lang_Integer_IntegerCache() || | |
162 klass_name == ciSymbol::java_lang_Long_LongCache())) { | |
163 bool require_const = true; | |
164 bool autobox_cache = true; | |
165 if (push_constant(field->constant_value(), require_const, autobox_cache)) { | |
166 return; | |
167 } | |
168 } | |
169 } | |
153 if (push_constant(field->constant_value())) | 170 if (push_constant(field->constant_value())) |
154 return; | 171 return; |
155 } | 172 } |
156 else { | 173 else { |
157 // final non-static field | 174 // final non-static field |
302 // Note the presence of writes to final non-static fields, so that we | 319 // Note the presence of writes to final non-static fields, so that we |
303 // can insert a memory barrier later on to keep the writes from floating | 320 // can insert a memory barrier later on to keep the writes from floating |
304 // out of the constructor. | 321 // out of the constructor. |
305 if (is_field && field->is_final()) { | 322 if (is_field && field->is_final()) { |
306 set_wrote_final(true); | 323 set_wrote_final(true); |
307 } | 324 // Preserve allocation ptr to create precedent edge to it in membar |
308 } | 325 // generated on exit from constructor. |
309 | 326 if (C->eliminate_boxing() && |
310 | 327 adr_type->isa_oopptr() && adr_type->is_oopptr()->is_ptr_to_boxed_value() && |
311 bool Parse::push_constant(ciConstant constant, bool require_constant) { | 328 AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) { |
329 set_alloc_with_final(obj); | |
330 } | |
331 } | |
332 } | |
333 | |
334 | |
335 bool Parse::push_constant(ciConstant constant, bool require_constant, bool is_autobox_cache) { | |
312 switch (constant.basic_type()) { | 336 switch (constant.basic_type()) { |
313 case T_BOOLEAN: push( intcon(constant.as_boolean()) ); break; | 337 case T_BOOLEAN: push( intcon(constant.as_boolean()) ); break; |
314 case T_INT: push( intcon(constant.as_int()) ); break; | 338 case T_INT: push( intcon(constant.as_int()) ); break; |
315 case T_CHAR: push( intcon(constant.as_char()) ); break; | 339 case T_CHAR: push( intcon(constant.as_char()) ); break; |
316 case T_BYTE: push( intcon(constant.as_byte()) ); break; | 340 case T_BYTE: push( intcon(constant.as_byte()) ); break; |
327 ciObject* oop_constant = constant.as_object(); | 351 ciObject* oop_constant = constant.as_object(); |
328 if (oop_constant->is_null_object()) { | 352 if (oop_constant->is_null_object()) { |
329 push( zerocon(T_OBJECT) ); | 353 push( zerocon(T_OBJECT) ); |
330 break; | 354 break; |
331 } else if (require_constant || oop_constant->should_be_constant()) { | 355 } else if (require_constant || oop_constant->should_be_constant()) { |
332 push( makecon(TypeOopPtr::make_from_constant(oop_constant, require_constant)) ); | 356 push( makecon(TypeOopPtr::make_from_constant(oop_constant, require_constant, is_autobox_cache)) ); |
333 break; | 357 break; |
334 } else { | 358 } else { |
335 // we cannot inline the oop, but we can use it later to narrow a type | 359 // we cannot inline the oop, but we can use it later to narrow a type |
336 return false; | 360 return false; |
337 } | 361 } |