comparison src/share/vm/c1/c1_GraphBuilder.cpp @ 18004:ee1c924763d2

8043546: C1 optimizes @Stable instance fields with default values Reviewed-by: kvn, jrose
author vlivanov
date Thu, 10 Jul 2014 12:04:43 -0700
parents dda2ae6f9557
children 52b4284cb496 2fd0fd493045
comparison
equal deleted inserted replaced
18003:dda2ae6f9557 18004:ee1c924763d2
1567 break; 1567 break;
1568 1568
1569 default: 1569 default:
1570 constant = new Constant(as_ValueType(field_val)); 1570 constant = new Constant(as_ValueType(field_val));
1571 } 1571 }
1572 // Stable static fields are checked for non-default values in ciField::initialize_from().
1572 } 1573 }
1573 if (constant != NULL) { 1574 if (constant != NULL) {
1574 push(type, append(constant)); 1575 push(type, append(constant));
1575 } else { 1576 } else {
1576 if (state_before == NULL) { 1577 if (state_before == NULL) {
1607 constant = new Constant(as_ValueType(field_val)); 1608 constant = new Constant(as_ValueType(field_val));
1608 } 1609 }
1609 break; 1610 break;
1610 default: 1611 default:
1611 constant = new Constant(as_ValueType(field_val)); 1612 constant = new Constant(as_ValueType(field_val));
1613 }
1614 if (FoldStableValues && field->is_stable() && field_val.is_null_or_zero()) {
1615 // Stable field with default value can't be constant.
1616 constant = NULL;
1612 } 1617 }
1613 } else { 1618 } else {
1614 // For CallSite objects treat the target field as a compile time constant. 1619 // For CallSite objects treat the target field as a compile time constant.
1615 if (const_oop->is_call_site()) { 1620 if (const_oop->is_call_site()) {
1616 ciCallSite* call_site = const_oop->as_call_site(); 1621 ciCallSite* call_site = const_oop->as_call_site();