comparison graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java @ 2540:3fc322165071

More flags clean up.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 27 Apr 2011 20:27:43 +0200
parents e1ba5a93e997
children c58a301eb2d7
comparison
equal deleted inserted replaced
2539:fa3bda50cbfd 2540:3fc322165071
730 } 730 }
731 731
732 void genGetField(int cpi, RiField field) { 732 void genGetField(int cpi, RiField field) {
733 // Must copy the state here, because the field holder must still be on the stack. 733 // Must copy the state here, because the field holder must still be on the stack.
734 FrameState stateBefore = curState.immutableCopy(bci()); 734 FrameState stateBefore = curState.immutableCopy(bci());
735 boolean isLoaded = !C1XOptions.TestPatching && field.isResolved(); 735 LoadField load = new LoadField(apop(), field, stateBefore);
736 LoadField load = new LoadField(apop(), field, stateBefore, isLoaded);
737 appendOptimizedLoadField(field.kind(), load); 736 appendOptimizedLoadField(field.kind(), load);
738 } 737 }
739 738
740 void genPutField(int cpi, RiField field) { 739 void genPutField(int cpi, RiField field) {
741 // Must copy the state here, because the field holder must still be on the stack. 740 // Must copy the state here, because the field holder must still be on the stack.
742 FrameState stateBefore = curState.immutableCopy(bci()); 741 FrameState stateBefore = curState.immutableCopy(bci());
743 boolean isLoaded = !C1XOptions.TestPatching && field.isResolved();
744 Value value = pop(field.kind().stackKind()); 742 Value value = pop(field.kind().stackKind());
745 appendOptimizedStoreField(new StoreField(apop(), field, value, stateBefore, isLoaded)); 743 appendOptimizedStoreField(new StoreField(apop(), field, value, stateBefore));
746 } 744 }
747 745
748 void genGetStatic(int cpi, RiField field) { 746 void genGetStatic(int cpi, RiField field) {
749 RiType holder = field.holder(); 747 RiType holder = field.holder();
750 boolean isInitialized = !C1XOptions.TestPatching && field.isResolved() && holder.isResolved() && holder.isInitialized(); 748 boolean isInitialized = !C1XOptions.TestPatching && field.isResolved();
751 CiConstant constantValue = null; 749 CiConstant constantValue = null;
752 if (isInitialized) { 750 if (isInitialized) {
753 constantValue = field.constantValue(null); 751 constantValue = field.constantValue(null);
754 } 752 }
755 if (constantValue != null) { 753 if (constantValue != null) {
756 push(constantValue.kind.stackKind(), appendConstant(constantValue)); 754 push(constantValue.kind.stackKind(), appendConstant(constantValue));
757 } else { 755 } else {
758 Value container = genResolveClass(RiType.Representation.StaticFields, holder, isInitialized, cpi); 756 Value container = genResolveClass(RiType.Representation.StaticFields, holder, field.isResolved(), cpi);
759 LoadField load = new LoadField(container, field, null, isInitialized); 757 LoadField load = new LoadField(container, field, null);
760 appendOptimizedLoadField(field.kind(), load); 758 appendOptimizedLoadField(field.kind(), load);
761 } 759 }
762 } 760 }
763 761
764 void genPutStatic(int cpi, RiField field) { 762 void genPutStatic(int cpi, RiField field) {
765 RiType holder = field.holder(); 763 RiType holder = field.holder();
766 boolean isInitialized = !C1XOptions.TestPatching && field.isResolved() && holder.isResolved() && holder.isInitialized(); 764 Value container = genResolveClass(RiType.Representation.StaticFields, holder, field.isResolved(), cpi);
767 Value container = genResolveClass(RiType.Representation.StaticFields, holder, isInitialized, cpi);
768 Value value = pop(field.kind().stackKind()); 765 Value value = pop(field.kind().stackKind());
769 StoreField store = new StoreField(container, field, value, null, isInitialized); 766 StoreField store = new StoreField(container, field, value, null);
770 appendOptimizedStoreField(store); 767 appendOptimizedStoreField(store);
771 } 768 }
772 769
773 private Value genResolveClass(RiType.Representation representation, RiType holder, boolean initialized, int cpi) { 770 private Value genResolveClass(RiType.Representation representation, RiType holder, boolean initialized, int cpi) {
774 Value holderInstr; 771 Value holderInstr;