changeset 13454:aba12e3603b4

Merge.
author Doug Simon <doug.simon@oracle.com>
date Wed, 18 Dec 2013 13:06:06 +0100
parents e3ec81d3e976 (current diff) 6a4160635fef (diff)
children 163b418ec095
files
diffstat 17 files changed, 22 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/HighTier.java	Wed Dec 18 11:35:04 2013 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/HighTier.java	Wed Dec 18 13:06:06 2013 +0100
@@ -48,7 +48,7 @@
     }
 
     public HighTier() {
-        CanonicalizerPhase canonicalizer = new CanonicalizerPhase(!AOTCompilation.getValue());
+        CanonicalizerPhase canonicalizer = new CanonicalizerPhase(!ImmutableCode.getValue());
 
         if (VerifyUsageWithEquals.getValue()) {
             appendPhase(new VerifyUsageWithEquals(Value.class));
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LowTier.java	Wed Dec 18 11:35:04 2013 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LowTier.java	Wed Dec 18 13:06:06 2013 +0100
@@ -31,7 +31,7 @@
 public class LowTier extends PhaseSuite<LowTierContext> {
 
     public LowTier() {
-        CanonicalizerPhase canonicalizer = new CanonicalizerPhase(!AOTCompilation.getValue());
+        CanonicalizerPhase canonicalizer = new CanonicalizerPhase(!ImmutableCode.getValue());
 
         appendPhase(new LoweringPhase(canonicalizer));
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/MidTier.java	Wed Dec 18 11:35:04 2013 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/MidTier.java	Wed Dec 18 13:06:06 2013 +0100
@@ -33,7 +33,7 @@
 public class MidTier extends PhaseSuite<MidTierContext> {
 
     public MidTier() {
-        CanonicalizerPhase canonicalizer = new CanonicalizerPhase(!AOTCompilation.getValue());
+        CanonicalizerPhase canonicalizer = new CanonicalizerPhase(!ImmutableCode.getValue());
 
         if (OptPushThroughPi.getValue()) {
             appendPhase(new PushThroughPiPhase());
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java	Wed Dec 18 11:35:04 2013 +0100
+++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java	Wed Dec 18 13:06:06 2013 +0100
@@ -201,7 +201,7 @@
         StructuredGraph graph = parse(test);
         ResolvedJavaMethod method = graph.method();
 
-        try (OverrideScope s = OptionValue.override(AOTCompilation, compileAOT)) {
+        try (OverrideScope s = OptionValue.override(ImmutableCode, compileAOT)) {
             PhasePlan phasePlan = new PhasePlan();
             GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(getMetaAccess(), getForeignCalls(), GraphBuilderConfiguration.getDefault(), OptimisticOptimizations.ALL);
             phasePlan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java	Wed Dec 18 11:35:04 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java	Wed Dec 18 13:06:06 2013 +0100
@@ -160,7 +160,7 @@
      * in AOT mode, some fields should never be embedded even for snippets/replacements.
      */
     private boolean isEmbeddable() {
-        if (AOTCompilation.getValue() && notEmbeddable.contains(this)) {
+        if (ImmutableCode.getValue() && notEmbeddable.contains(this)) {
             return false;
         }
         return true;
@@ -176,7 +176,7 @@
      */
     @Override
     public Constant readConstantValue(Constant receiver) {
-        assert !AOTCompilation.getValue() || isCalledForSnippets() : receiver;
+        assert !ImmutableCode.getValue() || isCalledForSnippets() : receiver;
 
         if (receiver == null) {
             assert Modifier.isStatic(modifiers);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSuitesProvider.java	Wed Dec 18 11:35:04 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSuitesProvider.java	Wed Dec 18 13:06:06 2013 +0100
@@ -48,7 +48,7 @@
     public Suites createSuites() {
         Suites ret = Suites.createDefaultSuites();
 
-        if (AOTCompilation.getValue()) {
+        if (ImmutableCode.getValue()) {
             // lowering introduces class constants, therefore it must be after lowering
             ret.getHighTier().appendPhase(new LoadJavaMirrorWithKlassPhase(runtime.getConfig().classMirrorOffset));
             if (VerifyPhases.getValue()) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectGetClassNode.java	Wed Dec 18 11:35:04 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectGetClassNode.java	Wed Dec 18 13:06:06 2013 +0100
@@ -49,7 +49,7 @@
 
     @Override
     public void virtualize(VirtualizerTool tool) {
-        if (AOTCompilation.getValue()) {
+        if (ImmutableCode.getValue()) {
             return;
         }
         State state = tool.getObjectState(getObject());
@@ -61,7 +61,7 @@
 
     @Override
     public Node canonical(CanonicalizerTool tool) {
-        if (AOTCompilation.getValue()) {
+        if (ImmutableCode.getValue()) {
             return this;
         }
         if (usages().isEmpty()) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/SystemSubstitutions.java	Wed Dec 18 11:35:04 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/SystemSubstitutions.java	Wed Dec 18 13:06:06 2013 +0100
@@ -65,7 +65,7 @@
 
         @Override
         protected Constant evaluate(Constant param, MetaAccessProvider metaAccess) {
-            return AOTCompilation.getValue() || param.isNull() ? null : Constant.forInt(System.identityHashCode(param.asObject()));
+            return ImmutableCode.getValue() || param.isNull() ? null : Constant.forInt(System.identityHashCode(param.asObject()));
         }
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CompareAndSwapNode.java	Wed Dec 18 11:35:04 2013 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CompareAndSwapNode.java	Wed Dec 18 13:06:06 2013 +0100
@@ -25,8 +25,6 @@
 import static com.oracle.graal.graph.UnsafeAccess.*;
 
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.spi.*;
 import com.oracle.graal.nodes.*;
 import com.oracle.graal.nodes.extended.*;
 import com.oracle.graal.nodes.spi.*;
@@ -36,14 +34,13 @@
  * Represents an atomic compare-and-swap operation The result is a boolean that contains whether the
  * value matched the expected value.
  */
-public class CompareAndSwapNode extends AbstractMemoryCheckpoint implements Lowerable, MemoryCheckpoint.Single, Canonicalizable {
+public class CompareAndSwapNode extends AbstractMemoryCheckpoint implements Lowerable, MemoryCheckpoint.Single {
 
     @Input private ValueNode object;
     @Input private ValueNode offset;
     @Input private ValueNode expected;
     @Input private ValueNode newValue;
     private final int displacement;
-    private final LocationIdentity locationIdentity;
 
     public ValueNode object() {
         return object;
@@ -66,10 +63,6 @@
     }
 
     public CompareAndSwapNode(ValueNode object, int displacement, ValueNode offset, ValueNode expected, ValueNode newValue) {
-        this(object, displacement, offset, expected, newValue, LocationIdentity.ANY_LOCATION);
-    }
-
-    public CompareAndSwapNode(ValueNode object, int displacement, ValueNode offset, ValueNode expected, ValueNode newValue, LocationIdentity locationIdentity) {
         super(StampFactory.forKind(Kind.Boolean.getStackKind()));
         assert expected.kind() == newValue.kind();
         this.object = object;
@@ -77,12 +70,11 @@
         this.expected = expected;
         this.newValue = newValue;
         this.displacement = displacement;
-        this.locationIdentity = locationIdentity;
     }
 
     @Override
     public LocationIdentity getLocationIdentity() {
-        return locationIdentity;
+        return LocationIdentity.ANY_LOCATION;
     }
 
     @Override
@@ -90,24 +82,6 @@
         tool.getLowerer().lower(this, tool);
     }
 
-    @Override
-    public Node canonical(CanonicalizerTool tool) {
-        if (getLocationIdentity() == LocationIdentity.ANY_LOCATION) {
-            Constant offsetConstant = offset().asConstant();
-            if (offsetConstant != null) {
-                ResolvedJavaType receiverType = ObjectStamp.typeOrNull(object());
-                if (receiverType != null) {
-                    long constantOffset = offsetConstant.asLong();
-                    ResolvedJavaField field = receiverType.findInstanceFieldWithOffset(constantOffset);
-                    if (field != null && expected().kind() == field.getKind() && newValue().kind() == field.getKind()) {
-                        return graph().add(new CompareAndSwapNode(object, displacement, offset, expected, newValue, field));
-                    }
-                }
-            }
-        }
-        return this;
-    }
-
     // specialized on value type until boxing/unboxing is sorted out in intrinsification
     @NodeIntrinsic
     public static boolean compareAndSwap(Object object, @ConstantNodeParameter int displacement, long offset, Object expected, Object newValue) {
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java	Wed Dec 18 11:35:04 2013 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java	Wed Dec 18 13:06:06 2013 +0100
@@ -711,7 +711,7 @@
                     metricInliningTailDuplication.increment();
                     Debug.log("MultiTypeGuardInlineInfo starting tail duplication (%d opportunities)", opportunities);
                     PhaseContext phaseContext = new PhaseContext(providers, assumptions);
-                    CanonicalizerPhase canonicalizer = new CanonicalizerPhase(!AOTCompilation.getValue());
+                    CanonicalizerPhase canonicalizer = new CanonicalizerPhase(!ImmutableCode.getValue());
                     TailDuplicationPhase.tailDuplicate(returnMerge, TailDuplicationPhase.TRUE_DECISION, replacementNodes, phaseContext, canonicalizer);
                 }
             }
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java	Wed Dec 18 11:35:04 2013 +0100
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java	Wed Dec 18 13:06:06 2013 +0100
@@ -229,8 +229,8 @@
     public static final OptionValue<Double> MinTableSwitchDensity = new OptionValue<>(0.5);
 
     // Ahead of time compilation
-    @Option(help = "Configure compiler to emit code  compatible with AOT requirements for HotSpot")
-    public static final OptionValue<Boolean> AOTCompilation = new OptionValue<>(false);
+    @Option(help = "Try to avoid emitting code where patching is required")
+    public static final OptionValue<Boolean> ImmutableCode = new OptionValue<>(false);
 
     // Runtime settings
     @Option(help = "")
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/BoxingSnippets.java	Wed Dec 18 11:35:04 2013 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/BoxingSnippets.java	Wed Dec 18 13:06:06 2013 +0100
@@ -218,7 +218,7 @@
         public void lower(BoxNode box, LoweringTool tool) {
             FloatingNode canonical = canonicalizeBoxing(box, providers.getMetaAccess());
             // if in AOT mode, we don't want to embed boxed constants.
-            if (canonical != null && !AOTCompilation.getValue()) {
+            if (canonical != null && !ImmutableCode.getValue()) {
                 box.graph().replaceFloating(box, canonical);
             } else {
                 Arguments args = new Arguments(boxSnippets.get(box.getBoxingKind()), box.graph().getGuardsStage());
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/CompositeValueClassSubstitutions.java	Wed Dec 18 11:35:04 2013 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/CompositeValueClassSubstitutions.java	Wed Dec 18 13:06:06 2013 +0100
@@ -51,7 +51,7 @@
         @SuppressWarnings("unchecked")
         @Override
         protected Constant evaluate(Constant param, MetaAccessProvider metaAccess) {
-            if (param.isNull() || AOTCompilation.getValue()) {
+            if (param.isNull() || ImmutableCode.getValue()) {
                 return null;
             }
             return Constant.forObject(CompositeValueClass.get((Class<? extends CompositeValue>) param.asObject()));
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeClassSubstitutions.java	Wed Dec 18 11:35:04 2013 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeClassSubstitutions.java	Wed Dec 18 13:06:06 2013 +0100
@@ -55,7 +55,7 @@
 
         @Override
         protected Constant evaluate(Constant param, MetaAccessProvider metaAccess) {
-            return param.isNull() || AOTCompilation.getValue() ? null : Constant.forObject(NodeClass.get((Class<?>) param.asObject()));
+            return param.isNull() || ImmutableCode.getValue() ? null : Constant.forObject(NodeClass.get((Class<?>) param.asObject()));
         }
     }
 
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java	Wed Dec 18 11:35:04 2013 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java	Wed Dec 18 13:06:06 2013 +0100
@@ -76,7 +76,7 @@
     public PartialEvaluator(RuntimeProvider runtime, Providers providers, TruffleCache truffleCache) {
         this.providers = providers;
         CustomCanonicalizer customCanonicalizer = new PartialEvaluatorCanonicalizer(providers.getMetaAccess(), providers.getConstantReflection());
-        this.canonicalizer = new CanonicalizerPhase(!AOTCompilation.getValue(), customCanonicalizer);
+        this.canonicalizer = new CanonicalizerPhase(!ImmutableCode.getValue(), customCanonicalizer);
         this.skippedExceptionTypes = TruffleCompilerImpl.getSkippedExceptionTypes(providers.getMetaAccess());
         this.cache = runtime.getGraphCache();
         this.truffleCache = truffleCache;
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCache.java	Wed Dec 18 11:35:04 2013 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCache.java	Wed Dec 18 13:06:06 2013 +0100
@@ -110,7 +110,7 @@
             // Convert deopt to guards.
             new ConvertDeoptimizeToGuardPhase().apply(graph);
 
-            CanonicalizerPhase canonicalizerPhase = new CanonicalizerPhase(!AOTCompilation.getValue());
+            CanonicalizerPhase canonicalizerPhase = new CanonicalizerPhase(!ImmutableCode.getValue());
             PartialEscapePhase partialEscapePhase = new PartialEscapePhase(false, canonicalizerPhase);
 
             Mark mark = null;
--- a/mx/mx_graal.py	Wed Dec 18 11:35:04 2013 +0100
+++ b/mx/mx_graal.py	Wed Dec 18 13:06:06 2013 +0100
@@ -970,8 +970,8 @@
         tasks.append(t.stop())
 
     with VM('graal', 'product'):
-        t = Task('BootstrapWithAOTConfiguration:product')
-        vm(['-G:+AOTCompilation', '-G:+VerifyPhases', '-esa', '-version'])
+        t = Task('BootstrapWithImmutableCode:product')
+        vm(['-G:+ImmutableCode', '-G:+VerifyPhases', '-esa', '-version'])
         tasks.append(t.stop())
 
     with VM('server', 'product'):  # hosted mode