changeset 7494:63eb224c2c36

Merge.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 17 Jan 2013 00:06:39 +0100
parents 741ceb12ff7d (current diff) 90c4a8029bcd (diff)
children bf7a1be7c709
files
diffstat 8 files changed, 32 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/MonitorSnippets.java	Thu Jan 17 00:06:27 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/MonitorSnippets.java	Thu Jan 17 00:06:39 2013 +0100
@@ -28,6 +28,7 @@
 import static com.oracle.graal.hotspot.nodes.VMErrorNode.*;
 import static com.oracle.graal.hotspot.snippets.HotSpotSnippetUtils.*;
 import static com.oracle.graal.snippets.SnippetTemplate.*;
+import static com.oracle.graal.snippets.nodes.BranchProbabilityNode.*;
 
 import java.util.*;
 
@@ -102,6 +103,7 @@
             if (biasableLockBits != Word.unsigned(biasedLockPattern())) {
                 // Biasing not enabled -> fall through to lightweight locking
             } else {
+                probability(0.75);
                 // The bias pattern is present in the object's mark word. Need to check
                 // whether the bias owner and the epoch are both still current.
                 Word hub = loadHub(object);
@@ -113,6 +115,7 @@
                 trace(trace, "              tmp: 0x%016lx\n", tmp);
                 if (tmp == Word.zero()) {
                     // Object is already biased to current thread -> done
+                    probability(0.75);
                     traceObject(trace, "+lock{bias:existing}", object);
                     return;
                 }
@@ -127,6 +130,7 @@
                 // the prototype header is no longer biasable and we have to revoke
                 // the bias on this object.
                 if (tmp.and(biasedLockMaskInPlace()) == Word.zero()) {
+                    probability(0.75);
                     // Biasing is still enabled for object's type. See whether the
                     // epoch of the current bias is still valid, meaning that the epoch
                     // bits of the mark word are equal to the epoch bits of the
@@ -137,6 +141,7 @@
                     // otherwise the manipulations it performs on the mark word are
                     // illegal.
                     if (tmp.and(epochMaskInPlace()) == Word.zero()) {
+                        probability(0.75);
                         // The epoch of the current bias is still valid but we know nothing
                         // about the owner; it might be set or it might be clear. Try to
                         // acquire the bias of the object using an atomic operation. If this
@@ -155,6 +160,7 @@
                         // If the biasing toward our thread failed, this means that another thread
                         // owns the bias and we need to revoke that bias. The revocation will occur
                         // in the interpreter runtime.
+                        probability(0.0001);
                         traceObject(trace, "+lock{stub:revoke}", object);
                         MonitorEnterStubCall.call(object, lock);
                         return;
@@ -175,6 +181,7 @@
                         // If the biasing toward our thread failed, then another thread
                         // succeeded in biasing it toward itself and we need to revoke that
                         // bias. The revocation will occur in the runtime in the slow case.
+                        probability(0.0001);
                         traceObject(trace, "+lock{stub:epoch-expired}", object);
                         MonitorEnterStubCall.call(object, lock);
                         return;
@@ -232,6 +239,7 @@
             final Word stackPointer = stackPointer();
             if (currentMark.subtract(stackPointer).and(alignedMask.subtract(pageSize())) != Word.zero()) {
                 // Most likely not a recursive lock, go into a slow runtime call
+                probability(0.001);
                 traceObject(trace, "+lock{stub:failed-cas}", object);
                 MonitorEnterStubCall.call(object, lock);
                 return;
@@ -281,6 +289,7 @@
             final Word mark = loadWordFromObject(object, markOffset());
             trace(trace, "             mark: 0x%016lx\n", mark);
             if (mark.and(biasedLockMaskInPlace()) == Word.unsigned(biasedLockPattern())) {
+                probability(0.75);
                 endLockScope();
                 decCounter();
                 traceObject(trace, "-lock{bias}", object);
@@ -303,8 +312,9 @@
             // the displaced mark in the object - if the object's mark word is not pointing to
             // the displaced mark word, do unlocking via runtime call.
             if (DirectCompareAndSwapNode.compareAndSwap(object, markOffset(), lock, displacedMark) != lock) {
-              // The object's mark word was not pointing to the displaced header,
-              // we do unlocking via runtime call.
+                // The object's mark word was not pointing to the displaced header,
+                // we do unlocking via runtime call.
+                probability(0.001);
                 traceObject(trace, "-lock{stub}", object);
                 MonitorExitStubCall.call(object);
             } else {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java	Thu Jan 17 00:06:27 2013 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java	Thu Jan 17 00:06:39 2013 +0100
@@ -26,6 +26,7 @@
 import com.oracle.graal.graph.*;
 import com.oracle.graal.nodes.*;
 import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
 
 @NodeInfo(shortName = "^")
 public final class XorNode extends LogicNode implements Canonicalizable, LIRLowerable {
@@ -35,6 +36,11 @@
     }
 
     @Override
+    public boolean inferStamp() {
+        return updateStamp(StampTool.xor(x().integerStamp(), y().integerStamp()));
+    }
+
+    @Override
     public ValueNode canonical(CanonicalizerTool tool) {
         if (x() == y()) {
             return ConstantNode.forIntegerKind(kind(), 0, graph());
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Thu Jan 17 00:06:27 2013 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Thu Jan 17 00:06:39 2013 +0100
@@ -38,11 +38,11 @@
         super(object, location, stamp);
     }
 
-    public ReadNode(ValueNode object, int displacement, Object locationIdentity, Kind kind) {
+    private ReadNode(ValueNode object, int displacement, Object locationIdentity, Kind kind) {
         super(object, object.graph().add(new LocationNode(locationIdentity, kind, displacement)), StampFactory.forKind(kind));
     }
 
-    public ReadNode(ValueNode object, ValueNode location) {
+    private ReadNode(ValueNode object, ValueNode location) {
         // Used by node intrinsics. Since the initial value for location is a parameter, i.e., a LocalNode, the
         // constructor cannot use the declared type LocationNode
         this(object, location, StampFactory.forNodeIntrinsic());
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/IntegerStamp.java	Thu Jan 17 00:06:27 2013 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/IntegerStamp.java	Thu Jan 17 00:06:39 2013 +0100
@@ -38,7 +38,7 @@
     private final long mask;
 
     public IntegerStamp(Kind kind) {
-        this(kind, kind.getMinValue(), kind.getMaxValue(), defaultMask(kind));
+        this(kind.getStackKind(), kind.getMinValue(), kind.getMaxValue(), defaultMask(kind));
     }
 
     public IntegerStamp(Kind kind, long lowerBound, long upperBound, long mask) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java	Thu Jan 17 00:06:27 2013 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java	Thu Jan 17 00:06:39 2013 +0100
@@ -64,8 +64,8 @@
     }
 
     public static Stamp forKind(Kind kind) {
-        assert stampCache[kind.getStackKind().ordinal()] != null : "unexpected forKind(" + kind + ")";
-        return stampCache[kind.getStackKind().ordinal()];
+        assert stampCache[kind.ordinal()] != null : "unexpected forKind(" + kind + ")";
+        return stampCache[kind.ordinal()];
     }
 
     public static Stamp forVoid() {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampTool.java	Thu Jan 17 00:06:27 2013 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampTool.java	Thu Jan 17 00:06:39 2013 +0100
@@ -130,6 +130,12 @@
         return stampForMask(kind, mask);
     }
 
+    public static Stamp xor(IntegerStamp stamp1, IntegerStamp stamp2) {
+        Kind kind = stamp1.kind();
+        long mask = stamp1.mask() | stamp2.mask();
+        return stampForMask(kind, mask);
+    }
+
     public static Stamp unsignedRightShift(IntegerStamp value, IntegerStamp shift) {
         Kind kind = value.kind();
         if (shift.lowerBound() == shift.upperBound()) {
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java	Thu Jan 17 00:06:27 2013 +0100
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java	Thu Jan 17 00:06:39 2013 +0100
@@ -106,8 +106,8 @@
     public static boolean ReassociateInvariants              = true;
     public static boolean FullUnroll                         = true;
     public static boolean LoopUnswitch                       = true;
-    public static int     FullUnrollMaxNodes                 = 150;
-    public static int     ExactFullUnrollMaxNodes            = 600;
+    public static int     FullUnrollMaxNodes                 = 300;
+    public static int     ExactFullUnrollMaxNodes            = 1200;
     public static float   MinimumPeelProbability             = 0.35f;
     public static int     LoopMaxUnswitch                    = 3;
     public static int     LoopUnswitchMaxIncrease            = 50;
--- a/hotspot/.cproject	Thu Jan 17 00:06:27 2013 +0100
+++ b/hotspot/.cproject	Thu Jan 17 00:06:39 2013 +0100
@@ -44,6 +44,7 @@
 									<listOptionValue builtIn="false" value="TARGET_ARCH_MODEL_x86_64=1"/>
 									<listOptionValue builtIn="false" value="GRAAL=1"/>
 									<listOptionValue builtIn="false" value="COMPILER2=1"/>
+									<listOptionValue builtIn="false" value="GRAALVM=1"/>
 								</option>
 								<option id="gnu.cpp.compiler.option.preprocessor.undef.2137486146" name="Undefined symbols (-U)" superClass="gnu.cpp.compiler.option.preprocessor.undef"/>
 								<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.866181452" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>