# HG changeset patch # User Thomas Wuerthinger # Date 1397764214 -7200 # Node ID bf37ce7df3fd673a3a5753cf5adbb2e0e07269bb # Parent ff0283a98b7ab79a7fb99279bcad2146c6db70ac# Parent f52e47b757b92f5a84f2b26c8726ae8cf353e532 Merge. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.asm.ptx/src/com/oracle/graal/asm/ptx/PTXAssembler.java --- a/graal/com.oracle.graal.asm.ptx/src/com/oracle/graal/asm/ptx/PTXAssembler.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.asm.ptx/src/com/oracle/graal/asm/ptx/PTXAssembler.java Thu Apr 17 21:50:14 2014 +0200 @@ -28,8 +28,8 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.lir.*; -import com.oracle.graal.nodes.calc.*; public class PTXAssembler extends AbstractPTXAssembler { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java --- a/graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java Thu Apr 17 21:50:14 2014 +0200 @@ -34,6 +34,7 @@ import com.oracle.graal.bytecode.*; import com.oracle.graal.compiler.alloc.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.compiler.target.*; @@ -44,7 +45,6 @@ import com.oracle.graal.java.BciBlockMapping.LocalLiveness; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.BlockEndOp; -import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.calc.FloatConvertNode.FloatConvert; import com.oracle.graal.nodes.cfg.*; import com.oracle.graal.phases.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java --- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Thu Apr 17 21:50:14 2014 +0200 @@ -36,6 +36,7 @@ import com.oracle.graal.asm.amd64.AMD64Address.Scale; import com.oracle.graal.asm.amd64.AMD64Assembler.ConditionFlag; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.JumpOp; @@ -68,7 +69,6 @@ import com.oracle.graal.lir.amd64.AMD64Move.StackLeaOp; import com.oracle.graal.lir.amd64.AMD64Move.ZeroExtendLoadOp; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.calc.FloatConvertNode.FloatConvert; import com.oracle.graal.nodes.type.*; import com.oracle.graal.phases.util.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64MemoryPeephole.java --- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64MemoryPeephole.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64MemoryPeephole.java Thu Apr 17 21:50:14 2014 +0200 @@ -32,6 +32,8 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.debug.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/calc/Condition.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/calc/Condition.java Thu Apr 17 21:50:14 2014 +0200 @@ -0,0 +1,634 @@ +/* + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.compiler.common.calc; + +import com.oracle.graal.api.code.*; +import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.*; + +/** + * Condition codes used in conditionals. + */ +public enum Condition { + /** + * Equal. + */ + EQ("=="), + + /** + * Not equal. + */ + NE("!="), + + /** + * Signed less than. + */ + LT("<"), + + /** + * Signed less than or equal. + */ + LE("<="), + + /** + * Signed greater than. + */ + GT(">"), + + /** + * Signed greater than or equal. + */ + GE(">="), + + /** + * Unsigned greater than or equal ("above than or equal"). + */ + AE("|>=|"), + + /** + * Unsigned less than or equal ("below than or equal"). + */ + BE("|<=|"), + + /** + * Unsigned greater than ("above than"). + */ + AT("|>|"), + + /** + * Unsigned less than ("below than"). + */ + BT("|<|"); + + public final String operator; + + private Condition(String operator) { + this.operator = operator; + } + + public boolean check(int left, int right) { + switch (this) { + case EQ: + return left == right; + case NE: + return left != right; + case LT: + return left < right; + case LE: + return left <= right; + case GT: + return left > right; + case GE: + return left >= right; + case AE: + return UnsignedMath.aboveOrEqual(left, right); + case BE: + return UnsignedMath.belowOrEqual(left, right); + case AT: + return UnsignedMath.aboveThan(left, right); + case BT: + return UnsignedMath.belowThan(left, right); + } + throw new IllegalArgumentException(this.toString()); + } + + /** + * Given a condition and its negation, this method returns true for one of the two and false for + * the other one. This can be used to keep comparisons in a canonical form. + * + * @return true if this condition is considered to be the canonical form, false otherwise. + */ + public boolean isCanonical() { + switch (this) { + case EQ: + return true; + case NE: + return false; + case LT: + return true; + case LE: + return false; + case GT: + return false; + case GE: + return false; + case BT: + return true; + case BE: + return false; + case AT: + return false; + case AE: + return false; + } + throw new IllegalArgumentException(this.toString()); + } + + /** + * Returns true if the condition needs to be mirrored to get to a canonical condition. The + * result of the mirroring operation might still need to be negated to achieve a canonical form. + */ + public boolean canonicalMirror() { + switch (this) { + case EQ: + return false; + case NE: + return false; + case LT: + return false; + case LE: + return true; + case GT: + return true; + case GE: + return false; + case BT: + return false; + case BE: + return true; + case AT: + return true; + case AE: + return false; + } + throw new IllegalArgumentException(this.toString()); + } + + /** + * Returns true if the condition needs to be negated to get to a canonical condition. The result + * of the negation might still need to be mirrored to achieve a canonical form. + */ + public boolean canonicalNegate() { + switch (this) { + case EQ: + return false; + case NE: + return true; + case LT: + return false; + case LE: + return true; + case GT: + return false; + case GE: + return true; + case BT: + return false; + case BE: + return true; + case AT: + return false; + case AE: + return true; + } + throw new IllegalArgumentException(this.toString()); + } + + /** + * Negate this conditional. + * + * @return the condition that represents the negation + */ + public final Condition negate() { + switch (this) { + case EQ: + return NE; + case NE: + return EQ; + case LT: + return GE; + case LE: + return GT; + case GT: + return LE; + case GE: + return LT; + case BT: + return AE; + case BE: + return AT; + case AT: + return BE; + case AE: + return BT; + } + throw new IllegalArgumentException(this.toString()); + } + + public boolean implies(Condition other) { + if (other == this) { + return true; + } + switch (this) { + case EQ: + return other == LE || other == GE || other == BE || other == AE; + case NE: + return false; + case LT: + return other == LE || other == NE; + case LE: + return false; + case GT: + return other == GE || other == NE; + case GE: + return false; + case BT: + return other == BE || other == NE; + case BE: + return false; + case AT: + return other == AE || other == NE; + case AE: + return false; + } + throw new IllegalArgumentException(this.toString()); + } + + /** + * Mirror this conditional (i.e. commute "a op b" to "b op' a") + * + * @return the condition representing the equivalent commuted operation + */ + public final Condition mirror() { + switch (this) { + case EQ: + return EQ; + case NE: + return NE; + case LT: + return GT; + case LE: + return GE; + case GT: + return LT; + case GE: + return LE; + case BT: + return AT; + case BE: + return AE; + case AT: + return BT; + case AE: + return BE; + } + throw new IllegalArgumentException(); + } + + /** + * Returns true if this condition represents an unsigned comparison. EQ and NE are not + * considered to be unsigned. + */ + public final boolean isUnsigned() { + return this == Condition.BT || this == Condition.BE || this == Condition.AT || this == Condition.AE; + } + + /** + * Checks if this conditional operation is commutative. + * + * @return {@code true} if this operation is commutative + */ + public final boolean isCommutative() { + return this == EQ || this == NE; + } + + /** + * Attempts to fold a comparison between two constants and return the result. + * + * @param lt the constant on the left side of the comparison + * @param rt the constant on the right side of the comparison + * @param constantReflection needed to compare constants + * @return {@link Boolean#TRUE} if the comparison is known to be true, {@link Boolean#FALSE} if + * the comparison is known to be false + */ + public boolean foldCondition(Constant lt, Constant rt, ConstantReflectionProvider constantReflection) { + assert !lt.getKind().isNumericFloat() && !rt.getKind().isNumericFloat(); + return foldCondition(lt, rt, constantReflection, false); + } + + /** + * Attempts to fold a comparison between two constants and return the result. + * + * @param lt the constant on the left side of the comparison + * @param rt the constant on the right side of the comparison + * @param constantReflection needed to compare constants + * @param unorderedIsTrue true if an undecided float comparison should result in "true" + * @return true if the comparison is known to be true, false if the comparison is known to be + * false + */ + public boolean foldCondition(Constant lt, Constant rt, ConstantReflectionProvider constantReflection, boolean unorderedIsTrue) { + switch (lt.getKind()) { + case Boolean: + case Byte: + case Char: + case Short: + case Int: { + int x = lt.asInt(); + int y = rt.asInt(); + switch (this) { + case EQ: + return x == y; + case NE: + return x != y; + case LT: + return x < y; + case LE: + return x <= y; + case GT: + return x > y; + case GE: + return x >= y; + case AE: + return UnsignedMath.aboveOrEqual(x, y); + case BE: + return UnsignedMath.belowOrEqual(x, y); + case AT: + return UnsignedMath.aboveThan(x, y); + case BT: + return UnsignedMath.belowThan(x, y); + default: + throw new GraalInternalError("expected condition: %s", this); + } + } + case Long: { + long x = lt.asLong(); + long y = rt.asLong(); + switch (this) { + case EQ: + return x == y; + case NE: + return x != y; + case LT: + return x < y; + case LE: + return x <= y; + case GT: + return x > y; + case GE: + return x >= y; + case AE: + return UnsignedMath.aboveOrEqual(x, y); + case BE: + return UnsignedMath.belowOrEqual(x, y); + case AT: + return UnsignedMath.aboveThan(x, y); + case BT: + return UnsignedMath.belowThan(x, y); + default: + throw new GraalInternalError("expected condition: %s", this); + } + } + case Object: { + Boolean equal = constantReflection.constantEquals(lt, rt); + if (equal != null) { + switch (this) { + case EQ: + return equal.booleanValue(); + case NE: + return !equal.booleanValue(); + default: + throw new GraalInternalError("expected condition: %s", this); + } + } + } + case Float: { + float x = lt.asFloat(); + float y = rt.asFloat(); + if (Float.isNaN(x) || Float.isNaN(y)) { + return unorderedIsTrue; + } + switch (this) { + case EQ: + return x == y; + case NE: + return x != y; + case LT: + return x < y; + case LE: + return x <= y; + case GT: + return x > y; + case GE: + return x >= y; + default: + throw new GraalInternalError("expected condition: %s", this); + } + } + case Double: { + double x = lt.asDouble(); + double y = rt.asDouble(); + if (Double.isNaN(x) || Double.isNaN(y)) { + return unorderedIsTrue; + } + switch (this) { + case EQ: + return x == y; + case NE: + return x != y; + case LT: + return x < y; + case LE: + return x <= y; + case GT: + return x > y; + case GE: + return x >= y; + default: + throw new GraalInternalError("expected condition: %s", this); + } + } + default: + throw new GraalInternalError("expected value kind %s while folding condition: %s", lt.getKind(), this); + } + } + + public Condition join(Condition other) { + if (other == this) { + return this; + } + switch (this) { + case EQ: + if (other == LE || other == GE || other == BE || other == AE) { + return EQ; + } else { + return null; + } + case NE: + if (other == LT || other == GT || other == BT || other == AT) { + return other; + } else if (other == LE) { + return LT; + } else if (other == GE) { + return GT; + } else if (other == BE) { + return BT; + } else if (other == AE) { + return AT; + } else { + return null; + } + case LE: + if (other == GE || other == EQ) { + return EQ; + } else if (other == NE || other == LT) { + return LT; + } else { + return null; + } + case LT: + if (other == NE || other == LE) { + return LT; + } else { + return null; + } + case GE: + if (other == LE || other == EQ) { + return EQ; + } else if (other == NE || other == GT) { + return GT; + } else { + return null; + } + case GT: + if (other == NE || other == GE) { + return GT; + } else { + return null; + } + case BE: + if (other == AE || other == EQ) { + return EQ; + } else if (other == NE || other == BT) { + return BT; + } else { + return null; + } + case BT: + if (other == NE || other == BE) { + return BT; + } else { + return null; + } + case AE: + if (other == BE || other == EQ) { + return EQ; + } else if (other == NE || other == AT) { + return AT; + } else { + return null; + } + case AT: + if (other == NE || other == AE) { + return AT; + } else { + return null; + } + } + throw new IllegalArgumentException(this.toString()); + } + + public Condition meet(Condition other) { + if (other == this) { + return this; + } + switch (this) { + case EQ: + if (other == LE || other == GE || other == BE || other == AE) { + return other; + } else if (other == LT) { + return LE; + } else if (other == GT) { + return GE; + } else if (other == BT) { + return BE; + } else if (other == AT) { + return AE; + } else { + return null; + } + case NE: + if (other == LT || other == GT || other == BT || other == AT) { + return NE; + } else { + return null; + } + case LE: + if (other == EQ || other == LT) { + return LE; + } else { + return null; + } + case LT: + if (other == EQ || other == LE) { + return LE; + } else if (other == NE || other == GT) { + return NE; + } else { + return null; + } + case GE: + if (other == EQ || other == GT) { + return GE; + } else { + return null; + } + case GT: + if (other == EQ || other == GE) { + return GE; + } else if (other == NE || other == LT) { + return NE; + } else { + return null; + } + case BE: + if (other == EQ || other == BT) { + return BE; + } else { + return null; + } + case BT: + if (other == EQ || other == BE) { + return BE; + } else if (other == NE || other == AT) { + return NE; + } else { + return null; + } + case AE: + if (other == EQ || other == AT) { + return AE; + } else { + return null; + } + case AT: + if (other == EQ || other == AE) { + return AE; + } else if (other == NE || other == BT) { + return NE; + } else { + return null; + } + } + throw new IllegalArgumentException(this.toString()); + } +} diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/spi/LIRTypeTool.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/spi/LIRTypeTool.java Thu Apr 17 21:50:14 2014 +0200 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.compiler.common.spi; + +import com.oracle.graal.api.meta.*; + +/** + * This interface can be used to access platform and VM specific kinds. + */ +public interface LIRTypeTool { + + PlatformKind getIntegerKind(int bits); + + PlatformKind getFloatingKind(int bits); + + PlatformKind getObjectKind(); +} diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/Stamp.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/Stamp.java Thu Apr 17 21:50:14 2014 +0200 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.compiler.common.type; + +import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.spi.*; + +/** + * A stamp is the basis for a type system over the nodes in a graph. + */ +public abstract class Stamp { + + protected Stamp() { + } + + /** + * Returns the type of the stamp, guaranteed to be non-null. In some cases, this requires the + * lookup of class meta data, therefore the {@link MetaAccessProvider} is mandatory. + */ + public abstract ResolvedJavaType javaType(MetaAccessProvider metaAccess); + + public boolean alwaysDistinct(Stamp other) { + return !join(other).isLegal(); + } + + /** + * Gets a Java {@link Kind} that can be used to store a value of this stamp on the Java bytecode + * stack. Returns {@link Kind#Illegal} if a value of this stamp can not be stored on the + * bytecode stack. + */ + public abstract Kind getStackKind(); + + /** + * Gets a platform dependent {@link PlatformKind} that can be used to store a value of this + * stamp. + */ + public abstract PlatformKind getPlatformKind(LIRTypeTool tool); + + /** + * Returns the union of this stamp and the given stamp. Typically used to create stamps for + * {@link ValuePhiNode}s. + * + * @param other The stamp that will enlarge this stamp. + * @return The union of this stamp and the given stamp. + */ + @SuppressWarnings("javadoc") + public abstract Stamp meet(Stamp other); + + /** + * Returns the intersection of this stamp and the given stamp. + * + * @param other The stamp that will tighten this stamp. + * @return The intersection of this stamp and the given stamp. + */ + public abstract Stamp join(Stamp other); + + /** + * Returns a stamp of the same kind, but allowing the full value range of the kind. + * + * {@link #unrestricted()} is the neutral element of the {@link #join(Stamp)} operation. + */ + public abstract Stamp unrestricted(); + + /** + * Returns a stamp of the same kind, but with no allowed values. + * + * {@link #illegal()} is the neutral element of the {@link #meet(Stamp)} operation. + */ + public abstract Stamp illegal(); + + /** + * Test whether two stamps have the same base type. + */ + public abstract boolean isCompatible(Stamp other); + + /** + * Test whether this stamp has legal values. + */ + public abstract boolean isLegal(); + + /** + * If this stamp represents a single value, the methods returns this single value. It returns + * null otherwise. + * + * @return the constant corresponding to the single value of this stamp and null if this stamp + * can represent less or more than one value. + */ + public Constant asConstant() { + return null; + } +} diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILLIRGenerator.java --- a/graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILLIRGenerator.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILLIRGenerator.java Thu Apr 17 21:50:14 2014 +0200 @@ -32,6 +32,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.JumpOp; @@ -51,7 +52,6 @@ import com.oracle.graal.lir.hsail.HSAILMove.MoveFromRegOp; import com.oracle.graal.lir.hsail.HSAILMove.MoveToRegOp; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.calc.FloatConvertNode.FloatConvert; import com.oracle.graal.phases.util.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java --- a/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java Thu Apr 17 21:50:14 2014 +0200 @@ -33,6 +33,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.JumpOp; @@ -58,7 +59,6 @@ import com.oracle.graal.lir.ptx.PTXMove.MoveFromRegOp; import com.oracle.graal.lir.ptx.PTXMove.MoveToRegOp; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.calc.FloatConvertNode.FloatConvert; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.type.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java --- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Thu Apr 17 21:50:14 2014 +0200 @@ -34,6 +34,7 @@ import com.oracle.graal.asm.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.JumpOp; @@ -58,7 +59,6 @@ import com.oracle.graal.lir.sparc.SPARCMove.MoveToRegOp; import com.oracle.graal.lir.sparc.SPARCMove.StackLoadAddressOp; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.calc.FloatConvertNode.FloatConvert; import com.oracle.graal.nodes.type.*; import com.oracle.graal.phases.util.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionTest.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionTest.java Thu Apr 17 21:50:14 2014 +0200 @@ -29,7 +29,7 @@ import org.junit.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.nodes.calc.*; +import com.oracle.graal.compiler.common.calc.*; public class ConditionTest { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Thu Apr 17 21:50:14 2014 +0200 @@ -34,17 +34,17 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.cfg.*; +import com.oracle.graal.compiler.common.spi.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.debug.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.BlockEndOp; import com.oracle.graal.lir.StandardOp.LabelOp; import com.oracle.graal.lir.StandardOp.NoOp; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.calc.*; -import com.oracle.graal.nodes.cfg.*; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.nodes.type.*; import com.oracle.graal.options.*; import com.oracle.graal.phases.util.*; @@ -93,14 +93,14 @@ * The block that does or will contain {@link #op}. This is initially the block where the * first usage of the constant is seen during LIR generation. */ - Block block; + AbstractBlock block; /** * The variable into which the constant is loaded. */ final Variable variable; - public LoadConstant(Variable variable, Block block, int index, LIRInstruction op) { + public LoadConstant(Variable variable, AbstractBlock block, int index, LIRInstruction op) { this.variable = variable; this.block = block; this.index = index; @@ -244,16 +244,6 @@ return value; } - public LabelRef getLIRBlock(FixedNode b) { - assert res.getLIR().getControlFlowGraph() instanceof ControlFlowGraph; - Block result = ((ControlFlowGraph) res.getLIR().getControlFlowGraph()).blockFor(b); - int suxIndex = currentBlock.getSuccessors().indexOf(result); - assert suxIndex != -1 : "Block not in successor list of current block"; - - assert currentBlock instanceof Block; - return LabelRef.forSuccessor(res.getLIR(), currentBlock, suxIndex); - } - /** * Determines if only oop maps are required for the code generated from the LIR. */ @@ -487,7 +477,7 @@ // Move loads of constant outside of loops if (OptScheduleOutOfLoops.getValue()) { - Block outOfLoopDominator = lc.block; + AbstractBlock outOfLoopDominator = lc.block; while (outOfLoopDominator.getLoop() != null) { outOfLoopDominator = outOfLoopDominator.getDominator(); } @@ -513,7 +503,7 @@ int groupBegin = 0; while (true) { int groupEnd = groupBegin + 1; - Block block = groupedByBlock[groupBegin].block; + AbstractBlock block = groupedByBlock[groupBegin].block; while (groupEnd < groupedByBlock.length && groupedByBlock[groupEnd].block == block) { groupEnd++; } diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java Thu Apr 17 21:50:14 2014 +0200 @@ -32,6 +32,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.compiler.gen.LIRGenerator.LoadConstant; import com.oracle.graal.compiler.target.*; @@ -121,9 +122,9 @@ int index = gen.getResult().getLIR().getLIRforBlock(gen.getCurrentBlock()).size(); loadedValue = gen.emitMove(value); LIRInstruction op = gen.getResult().getLIR().getLIRforBlock(gen.getCurrentBlock()).get(index); - gen.constantLoads.put(value, new LoadConstant(loadedValue, (Block) gen.getCurrentBlock(), index, op)); + gen.constantLoads.put(value, new LoadConstant(loadedValue, gen.getCurrentBlock(), index, op)); } else { - Block dominator = ControlFlowGraph.commonDominator(load.block, (Block) gen.getCurrentBlock()); + AbstractBlock dominator = ControlFlowGraph.commonDominator((Block) load.block, (Block) gen.getCurrentBlock()); loadedValue = load.variable; if (dominator != load.block) { load.unpin(gen.getResult().getLIR()); diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/DistinctFilteredNodeIterable.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/DistinctFilteredNodeIterable.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/DistinctFilteredNodeIterable.java Thu Apr 17 21:50:14 2014 +0200 @@ -39,6 +39,6 @@ @Override public Iterator iterator() { - return new DistinctPredicatedProxyNodeIterator<>(until, nodeIterable.iterator(), predicate); + return new DistinctPredicatedProxyNodeIterator<>(nodeIterable.iterator(), predicate); } } diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/DistinctPredicatedProxyNodeIterator.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/DistinctPredicatedProxyNodeIterator.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/DistinctPredicatedProxyNodeIterator.java Thu Apr 17 21:50:14 2014 +0200 @@ -30,8 +30,8 @@ private NodeBitMap visited; - public DistinctPredicatedProxyNodeIterator(NodePredicate until, Iterator iterator, NodePredicate predicate) { - super(until, iterator, predicate); + public DistinctPredicatedProxyNodeIterator(Iterator iterator, NodePredicate predicate) { + super(iterator, predicate); } @Override diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/FilteredNodeIterable.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/FilteredNodeIterable.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/FilteredNodeIterable.java Thu Apr 17 21:50:14 2014 +0200 @@ -30,7 +30,6 @@ protected final NodeIterable nodeIterable; protected NodePredicate predicate = NodePredicates.alwaysTrue(); - protected NodePredicate until = NodePredicates.isNull(); public FilteredNodeIterable(NodeIterable nodeIterable) { this.nodeIterable = nodeIterable; @@ -47,18 +46,6 @@ } @Override - public NodeIterable until(final T u) { - until = until.or(NodePredicates.equals(u)); - return this; - } - - @Override - public NodeIterable until(final Class clazz) { - until = until.or(NodePredicates.isA(clazz)); - return this; - } - - @Override public FilteredNodeIterable nonNull() { this.predicate = this.predicate.and(NodePredicates.isNotNull()); return this; @@ -68,13 +55,12 @@ public DistinctFilteredNodeIterable distinct() { DistinctFilteredNodeIterable distinct = new DistinctFilteredNodeIterable<>(nodeIterable); distinct.predicate = predicate; - distinct.until = until; return distinct; } @Override public Iterator iterator() { - return new PredicatedProxyNodeIterator<>(until, nodeIterable.iterator(), predicate); + return new PredicatedProxyNodeIterator<>(nodeIterable.iterator(), predicate); } @SuppressWarnings("unchecked") diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/NodeIterable.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/NodeIterable.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/NodeIterable.java Thu Apr 17 21:50:14 2014 +0200 @@ -28,14 +28,6 @@ public interface NodeIterable extends Iterable { - default NodeIterable until(final T u) { - return new FilteredNodeIterable<>(this).until(u); - } - - default NodeIterable until(final Class clazz) { - return new FilteredNodeIterable<>(this).until(clazz); - } - @SuppressWarnings("unchecked") default NodeIterable filter(Class clazz) { return (NodeIterable) new FilteredNodeIterable<>(this).and(NodePredicates.isA(clazz)); diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/PredicatedProxyNodeIterator.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/PredicatedProxyNodeIterator.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/PredicatedProxyNodeIterator.java Thu Apr 17 21:50:14 2014 +0200 @@ -30,10 +30,8 @@ private final Iterator iterator; private final NodePredicate predicate; - private final NodePredicate until; - public PredicatedProxyNodeIterator(NodePredicate until, Iterator iterator, NodePredicate predicate) { - this.until = until; + public PredicatedProxyNodeIterator(Iterator iterator, NodePredicate predicate) { this.iterator = iterator; this.predicate = predicate; } @@ -43,7 +41,7 @@ while ((current == null || !current.isAlive() || !predicate.apply(current)) && iterator.hasNext()) { current = iterator.next(); } - if (current != null && (!current.isAlive() || !predicate.apply(current) || until.apply(current))) { + if (current != null && (!current.isAlive() || !predicate.apply(current))) { current = null; } } diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Thu Apr 17 21:50:14 2014 +0200 @@ -34,6 +34,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.amd64.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.HotSpotVMConfig.CompressEncoding; @@ -55,7 +56,6 @@ import com.oracle.graal.lir.amd64.AMD64Move.StoreConstantOp; import com.oracle.graal.lir.amd64.AMD64Move.StoreOp; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.extended.*; /** diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMemoryPeephole.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMemoryPeephole.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMemoryPeephole.java Thu Apr 17 21:50:14 2014 +0200 @@ -29,6 +29,7 @@ import com.oracle.graal.asm.amd64.*; import com.oracle.graal.compiler.amd64.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.data.*; import com.oracle.graal.hotspot.meta.*; @@ -38,7 +39,6 @@ import com.oracle.graal.lir.amd64.AMD64ControlFlow.BranchOp; import com.oracle.graal.lir.asm.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.extended.*; /** diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java Thu Apr 17 21:50:14 2014 +0200 @@ -28,6 +28,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.compiler.hsail.*; import com.oracle.graal.hotspot.*; @@ -51,7 +52,6 @@ import com.oracle.graal.lir.hsail.HSAILMove.StoreConstantOp; import com.oracle.graal.lir.hsail.HSAILMove.StoreOp; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.phases.util.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXWrapperBuilder.java --- a/graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXWrapperBuilder.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXWrapperBuilder.java Thu Apr 17 21:50:14 2014 +0200 @@ -37,6 +37,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.debug.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Thu Apr 17 21:50:14 2014 +0200 @@ -351,4 +351,6 @@ * invalidated. */ void materializeVirtualObjects(HotSpotStackFrameReference stackFrame, boolean invalidate); + + void resolveInvokeDynamic(long metaspaceConstantPool, int index); } diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java Thu Apr 17 21:50:14 2014 +0200 @@ -180,4 +180,6 @@ public native void materializeVirtualObjects(HotSpotStackFrameReference stackFrame, boolean invalidate); public native long getTimeStamp(); + + public native void resolveInvokeDynamic(long metaspaceConstantPool, int index); } diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantPool.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantPool.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantPool.java Thu Apr 17 21:50:14 2014 +0200 @@ -501,7 +501,7 @@ break; case Bytecodes.INVOKEDYNAMIC: // invokedynamic instructions point to a constant pool cache entry. - index = decodeConstantPoolCacheIndex(cpi); + index = decodeConstantPoolCacheIndex(cpi) + runtime().getConfig().constantPoolCpCacheIndexTag; index = runtime().getCompilerToVM().constantPoolRemapInstructionOperandFromCache(metaspaceConstantPool, index); break; default: @@ -517,13 +517,7 @@ index = getUncachedKlassRefIndexAt(index); tag = getTagAt(index); assert tag == JVM_CONSTANT.Class || tag == JVM_CONSTANT.UnresolvedClass || tag == JVM_CONSTANT.UnresolvedClassInError : tag; - break; - default: - // nothing - break; - } - - switch (tag) { + // fall-through case Class: case UnresolvedClass: case UnresolvedClassInError: @@ -534,6 +528,9 @@ unsafe.ensureClassInitialized(klass); } break; + case InvokeDynamic: + runtime().getCompilerToVM().resolveInvokeDynamic(metaspaceConstantPool, cpi); + break; default: // nothing break; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoweringProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoweringProvider.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoweringProvider.java Thu Apr 17 21:50:14 2014 +0200 @@ -39,6 +39,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.debug.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/NativeCallStubGraphBuilder.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/NativeCallStubGraphBuilder.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/NativeCallStubGraphBuilder.java Thu Apr 17 21:50:14 2014 +0200 @@ -28,6 +28,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CompressionNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CompressionNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CompressionNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,6 +24,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.hotspot.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DeoptimizingStubCall.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DeoptimizingStubCall.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DeoptimizingStubCall.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.hotspot.nodes; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.type.*; public class DeoptimizingStubCall extends DeoptimizingFixedWithNextNode { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/HotSpotDirectCallTargetNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/HotSpotDirectCallTargetNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/HotSpotDirectCallTargetNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -26,9 +26,9 @@ import com.oracle.graal.api.code.CallingConvention.Type; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind; -import com.oracle.graal.nodes.type.*; public class HotSpotDirectCallTargetNode extends DirectCallTargetNode { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/HotSpotIndirectCallTargetNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/HotSpotIndirectCallTargetNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/HotSpotIndirectCallTargetNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -26,8 +26,8 @@ import com.oracle.graal.api.code.CallingConvention.Type; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.type.*; public class HotSpotIndirectCallTargetNode extends IndirectCallTargetNode { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewArrayStubCall.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewArrayStubCall.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewArrayStubCall.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,6 +24,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.compiler.target.*; import com.oracle.graal.hotspot.meta.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,6 +24,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.stubs.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewMultiArrayStubCall.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewMultiArrayStubCall.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewMultiArrayStubCall.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,6 +24,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/NarrowOopStamp.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/NarrowOopStamp.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/NarrowOopStamp.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,8 +23,9 @@ package com.oracle.graal.hotspot.nodes.type; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.spi.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.HotSpotVMConfig.CompressEncoding; -import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; public class NarrowOopStamp extends ObjectStamp { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java Thu Apr 17 21:50:14 2014 +0200 @@ -26,6 +26,7 @@ import static com.oracle.graal.nodes.ConstantNode.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -29,6 +29,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectGetClassNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectGetClassNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectGetClassNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -26,6 +26,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.meta.ResolvedJavaType.Representation; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ForeignCallStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ForeignCallStub.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ForeignCallStub.java Thu Apr 17 21:50:14 2014 +0200 @@ -27,6 +27,7 @@ import static com.oracle.graal.hotspot.HotSpotForeignCallLinkage.RegisterEffect.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.debug.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.HotSpotForeignCallLinkage.Transition; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.java/src/com/oracle/graal/java/AbstractBytecodeParser.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/AbstractBytecodeParser.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/AbstractBytecodeParser.java Thu Apr 17 21:50:14 2014 +0200 @@ -35,10 +35,10 @@ import com.oracle.graal.api.meta.ResolvedJavaType.Representation; import com.oracle.graal.bytecode.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.debug.*; import com.oracle.graal.java.BciBlockMapping.BciBlock; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.calc.FloatConvertNode.FloatConvert; import com.oracle.graal.options.*; import com.oracle.graal.phases.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Thu Apr 17 21:50:14 2014 +0200 @@ -37,6 +37,7 @@ import com.oracle.graal.api.meta.ResolvedJavaType.Representation; import com.oracle.graal.bytecode.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.Node.ValueNumberable; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.java/src/com/oracle/graal/java/HIRFrameStateBuilder.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/HIRFrameStateBuilder.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/HIRFrameStateBuilder.java Thu Apr 17 21:50:14 2014 +0200 @@ -29,6 +29,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.Node.Verbosity; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_less02.java --- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_less02.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_less02.java Thu Apr 17 21:50:14 2014 +0200 @@ -20,8 +20,6 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -/* - */ package com.oracle.graal.jtt.lang; import org.junit.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/JDK_ClassLoaders02.java --- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/JDK_ClassLoaders02.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/JDK_ClassLoaders02.java Thu Apr 17 21:50:14 2014 +0200 @@ -20,26 +20,6 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -/* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. - * - * Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product - * that is described in this document. In particular, and without limitation, these intellectual property - * rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or - * more additional patents or pending patent applications in the U.S. and in other countries. - * - * U.S. Government Rights - Commercial software. Government users are subject to the Sun - * Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its - * supplements. - * - * Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java and Solaris are trademarks or - * registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks - * are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the - * U.S. and other countries. - * - * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open - * Company, Ltd. - */ package com.oracle.graal.jtt.lang; import java.net.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/LambdaEagerTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/LambdaEagerTest.java Thu Apr 17 21:50:14 2014 +0200 @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.jtt.lang; + +import java.util.*; +import java.util.function.*; + +import org.junit.*; + +import com.oracle.graal.api.code.*; +import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.test.*; +import com.oracle.graal.nodes.*; +import com.oracle.graal.options.*; +import com.oracle.graal.options.OptionValue.OverrideScope; +import com.oracle.graal.phases.*; + +public class LambdaEagerTest extends GraalCompilerTest { + + private static final EnumSet UNRESOLVED_UNREACHED = EnumSet.of(DeoptimizationReason.Unresolved, DeoptimizationReason.UnreachedCode); + + private static int doBinary(IntBinaryOperator op, int x, int y) { + return op.applyAsInt(x, y); + } + + private static int add(int x, int y) { + return x + y; + } + + public static int nonCapturing(int x, int y) { + return doBinary((a, b) -> a + b, x, y); + } + + public static int nonCapturing2(int x, int y) { + return doBinary(LambdaEagerTest::add, x, y); + } + + public static int capturing(int x, int y, int z) { + return doBinary((a, b) -> a + b - z, x, y); + } + + @Test + public void testEagerResolveNonCapturing01() { + Result expected = new Result(3, null); + testAgainstExpected(getMethod("nonCapturing"), expected, UNRESOLVED_UNREACHED, 1, 2); + } + + @Test + public void testEagerResolveNonCapturing02() { + Result expected = new Result(3, null); + testAgainstExpected(getMethod("nonCapturing2"), expected, UNRESOLVED_UNREACHED, 1, 2); + } + + @Test + public void testEagerResolveCapturing() { + Result expected = new Result(0, null); + testAgainstExpected(getMethod("capturing"), expected, UNRESOLVED_UNREACHED, 1, 2, 3); + } + + @Override + protected InstalledCode getCode(ResolvedJavaMethod method, StructuredGraph graph, boolean forceCompile) { + try (OverrideScope scope = OptionValue.override(GraalOptions.InlineEverything, true)) { + return super.getCode(method, graph, forceCompile); + } + } +} \ No newline at end of file diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java Thu Apr 17 21:50:14 2014 +0200 @@ -34,11 +34,11 @@ import com.oracle.graal.asm.amd64.AMD64Address.Scale; import com.oracle.graal.asm.amd64.AMD64Assembler.ConditionFlag; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.BlockEndOp; import com.oracle.graal.lir.SwitchStrategy.BaseSwitchClosure; import com.oracle.graal.lir.asm.*; -import com.oracle.graal.nodes.calc.*; public class AMD64ControlFlow { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILCompare.java --- a/graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILCompare.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILCompare.java Thu Apr 17 21:50:14 2014 +0200 @@ -27,9 +27,9 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.hsail.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; -import com.oracle.graal.nodes.calc.*; /** * Implementation of compare operations. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILControlFlow.java --- a/graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILControlFlow.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILControlFlow.java Thu Apr 17 21:50:14 2014 +0200 @@ -30,12 +30,12 @@ import com.oracle.graal.asm.*; import com.oracle.graal.asm.hsail.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.hsail.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.BlockEndOp; import com.oracle.graal.lir.SwitchStrategy.BaseSwitchClosure; import com.oracle.graal.lir.asm.*; -import com.oracle.graal.nodes.calc.*; /** * Implementation of control flow instructions. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXCompare.java --- a/graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXCompare.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXCompare.java Thu Apr 17 21:50:14 2014 +0200 @@ -29,9 +29,9 @@ import com.oracle.graal.asm.ptx.*; import com.oracle.graal.asm.ptx.PTXAssembler.Setp; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; -import com.oracle.graal.nodes.calc.*; public enum PTXCompare { ICMP, diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXControlFlow.java --- a/graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXControlFlow.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXControlFlow.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.lir.ptx; +import static com.oracle.graal.compiler.common.calc.Condition.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static com.oracle.graal.lir.LIRValueUtil.*; -import static com.oracle.graal.nodes.calc.Condition.*; import com.oracle.graal.api.code.CompilationResult.JumpTable; import com.oracle.graal.api.meta.*; @@ -34,11 +34,11 @@ import com.oracle.graal.asm.ptx.*; import com.oracle.graal.asm.ptx.PTXMacroAssembler.Mov; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.BlockEndOp; import com.oracle.graal.lir.SwitchStrategy.BaseSwitchClosure; import com.oracle.graal.lir.asm.*; -import com.oracle.graal.nodes.calc.*; public class PTXControlFlow { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXTestOp.java --- a/graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXTestOp.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXTestOp.java Thu Apr 17 21:50:14 2014 +0200 @@ -28,8 +28,8 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.ptx.*; import com.oracle.graal.asm.ptx.PTXAssembler.Setp; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.lir.asm.*; -import com.oracle.graal.nodes.calc.*; public class PTXTestOp extends PTXLIRInstruction { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCControlFlow.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCControlFlow.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCControlFlow.java Thu Apr 17 21:50:14 2014 +0200 @@ -49,11 +49,11 @@ import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Nop; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Ret; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.BlockEndOp; import com.oracle.graal.lir.SwitchStrategy.BaseSwitchClosure; import com.oracle.graal.lir.asm.*; -import com.oracle.graal.nodes.calc.*; public class SPARCControlFlow { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.lir/src/com/oracle/graal/lir/SwitchStrategy.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/SwitchStrategy.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/SwitchStrategy.java Thu Apr 17 21:50:14 2014 +0200 @@ -26,8 +26,8 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.lir.asm.*; -import com.oracle.graal.nodes.calc.*; /** * This class encapsulates different strategies on how to generate code for switch instructions. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.loop/src/com/oracle/graal/loop/BasicInductionVariable.java --- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/BasicInductionVariable.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/BasicInductionVariable.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.loop; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.type.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.loop/src/com/oracle/graal/loop/CountedLoopInfo.java --- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/CountedLoopInfo.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/CountedLoopInfo.java Thu Apr 17 21:50:14 2014 +0200 @@ -25,6 +25,7 @@ import static com.oracle.graal.nodes.calc.IntegerArithmeticNode.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.loop.InductionVariable.Direction; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.loop/src/com/oracle/graal/loop/DerivedOffsetInductionVariable.java --- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/DerivedOffsetInductionVariable.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/DerivedOffsetInductionVariable.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,9 +23,9 @@ package com.oracle.graal.loop; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; -import com.oracle.graal.nodes.type.*; public class DerivedOffsetInductionVariable extends InductionVariable { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.loop/src/com/oracle/graal/loop/DerivedScaledInductionVariable.java --- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/DerivedScaledInductionVariable.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/DerivedScaledInductionVariable.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.loop; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.type.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.loop/src/com/oracle/graal/loop/InductionVariable.java --- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/InductionVariable.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/InductionVariable.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,8 +23,8 @@ package com.oracle.graal.loop; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.type.*; /** * This class describes a value node that is an induction variable in a counted loop. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopEx.java --- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopEx.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopEx.java Thu Apr 17 21:50:14 2014 +0200 @@ -26,6 +26,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragment.java --- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragment.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragment.java Thu Apr 17 21:50:14 2014 +0200 @@ -29,9 +29,9 @@ import com.oracle.graal.graph.Graph.DuplicationReplacement; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.VirtualState.VirtualClosure; import com.oracle.graal.nodes.cfg.*; import com.oracle.graal.nodes.java.*; +import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.virtual.*; public abstract class LoopFragment { @@ -165,11 +165,9 @@ if (n instanceof Invoke) { nodes.mark(((Invoke) n).callTarget()); } - if (n instanceof StateSplit) { - FrameState stateAfter = ((StateSplit) n).stateAfter(); - if (stateAfter != null) { - nodes.mark(stateAfter); - } + if (n instanceof NodeWithState) { + NodeWithState withState = (NodeWithState) n; + withState.states().forEach(state -> state.applyToVirtual(node -> nodes.mark(node))); } nodes.mark(n); } @@ -181,14 +179,7 @@ FrameState stateAfter = earlyExit.stateAfter(); if (stateAfter != null) { - nodes.mark(stateAfter); - stateAfter.applyToVirtual(new VirtualClosure() { - - @Override - public void apply(VirtualState node) { - nodes.mark(node); - } - }); + stateAfter.applyToVirtual(node -> nodes.mark(node)); } nodes.mark(earlyExit); for (ProxyNode proxy : earlyExit.proxies()) { @@ -345,16 +336,8 @@ * * We now update the original fragment's nodes accordingly: */ - state.applyToVirtual(new VirtualClosure() { - public void apply(VirtualState node) { - original.nodes.clear(node); - } - }); - exitState.applyToVirtual(new VirtualClosure() { - public void apply(VirtualState node) { - original.nodes.mark(node); - } - }); + state.applyToVirtual(node -> original.nodes.clear(node)); + exitState.applyToVirtual(node -> original.nodes.mark(node)); } FrameState finalExitState = exitState; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragmentInside.java --- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragmentInside.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragmentInside.java Thu Apr 17 21:50:14 2014 +0200 @@ -113,7 +113,11 @@ for (LoopExitNode exit : exits()) { FrameState exitState = exit.stateAfter(); if (exitState != null) { - exitState.applyToVirtual(v -> nodes.clear(v)); + exitState.applyToVirtual(v -> { + if (v.usages().filter(n -> nodes.isMarked(n) && !(n instanceof VirtualState && exitState.isPartOfThisState((VirtualState) n))).isEmpty()) { + nodes.clear(v); + } + }); } for (ProxyNode proxy : exit.proxies()) { nodes.clear(proxy); diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/IntegerStampTest.java --- a/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/IntegerStampTest.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/IntegerStampTest.java Thu Apr 17 21:50:14 2014 +0200 @@ -27,6 +27,7 @@ import org.junit.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.type.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampJoinTest.java --- a/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampJoinTest.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampJoinTest.java Thu Apr 17 21:50:14 2014 +0200 @@ -25,6 +25,7 @@ import org.junit.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.type.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractLocalNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractLocalNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractLocalNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.nodes; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.calc.*; -import com.oracle.graal.nodes.type.*; public abstract class AbstractLocalNode extends FloatingNode { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractMemoryCheckpoint.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractMemoryCheckpoint.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractMemoryCheckpoint.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.nodes; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.extended.*; -import com.oracle.graal.nodes.type.*; /** * Provides an implementation of {@link StateSplit}. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractStateSplit.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractStateSplit.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractStateSplit.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.nodes; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; -import com.oracle.graal.nodes.type.*; /** * Provides an implementation of {@link StateSplit}. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BeginNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BeginNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BeginNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -26,6 +26,7 @@ import java.util.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.graph.spi.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BeginStateSplitNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BeginStateSplitNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BeginStateSplitNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.nodes; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; -import com.oracle.graal.nodes.type.*; /** * Base class for {@link BeginNode}s that are associated with a frame state. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/CallTargetNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/CallTargetNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/CallTargetNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,6 +24,7 @@ import java.util.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -26,6 +26,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ControlSinkNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ControlSinkNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ControlSinkNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.nodes.type.*; +import com.oracle.graal.compiler.common.type.*; public abstract class ControlSinkNode extends FixedNode { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ControlSplitNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ControlSplitNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ControlSplitNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.nodes; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; -import com.oracle.graal.nodes.type.*; /** * The {@code ControlSplitNode} is a base class for all instructions that split the control flow diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizingFixedWithNextNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizingFixedWithNextNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizingFixedWithNextNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.nodes; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; -import com.oracle.graal.nodes.type.*; public abstract class DeoptimizingFixedWithNextNode extends FixedWithNextNode implements DeoptimizingNode.DeoptBefore { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DirectCallTargetNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DirectCallTargetNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DirectCallTargetNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -26,7 +26,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.nodes.type.*; +import com.oracle.graal.compiler.common.type.*; public class DirectCallTargetNode extends LoweredCallTargetNode { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DispatchBeginNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DispatchBeginNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DispatchBeginNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.nodes.type.*; +import com.oracle.graal.compiler.common.type.*; /** * The entry node of an exception dispatcher block. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.nodes.type.*; +import com.oracle.graal.compiler.common.type.*; public abstract class FixedNode extends ValueNode { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedWithNextNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedWithNextNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedWithNextNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.nodes.type.*; +import com.oracle.graal.compiler.common.type.*; /** * Base class of all nodes that are fixed within the control flow graph and have an immediate diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FloatingAnchoredNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FloatingAnchoredNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FloatingAnchoredNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.nodes; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.extended.*; -import com.oracle.graal.nodes.type.*; public abstract class FloatingAnchoredNode extends FloatingNode { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FloatingGuardedNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FloatingGuardedNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FloatingGuardedNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.nodes; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.extended.*; -import com.oracle.graal.nodes.type.*; public abstract class FloatingGuardedNode extends FloatingNode implements GuardedNode { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardedValueNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardedValueNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardedValueNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.extended.*; @@ -77,7 +78,7 @@ @Override public Node canonical(CanonicalizerTool tool) { - if (getGuard() == graph().start()) { + if (getGuard() == graph().start() || getGuard() == null) { if (stamp().equals(object().stamp())) { return object(); } else { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.calc.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -27,6 +27,8 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.meta.JavaTypeProfile.ProfiledType; import com.oracle.graal.api.meta.ProfilingInfo.TriState; +import com.oracle.graal.compiler.common.calc.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IndirectCallTargetNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IndirectCallTargetNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IndirectCallTargetNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -26,7 +26,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.nodes.type.*; +import com.oracle.graal.compiler.common.type.*; public class IndirectCallTargetNode extends LoweredCallTargetNode { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/Invoke.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/Invoke.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/Invoke.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.nodes; +import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.spi.*; @@ -52,4 +53,29 @@ boolean isPolymorphic(); void setPolymorphic(boolean value); + + /** + * Returns the {@linkplain ResolvedJavaMethod method} from which this invoke is executed. This + * is the caller method and in the case of inlining may be different from the method of the + * graph this node is in. + * + * @return the method from which this invoke is executed. + */ + default ResolvedJavaMethod getContextMethod() { + FrameState state = stateAfter(); + if (state == null) { + state = stateDuring(); + } + return state.method(); + } + + /** + * Returns the {@linkplain ResolvedJavaType type} from which this invoke is executed. This is + * the declaring type of the caller method. + * + * @return the type from which this invoke is executed. + */ + default ResolvedJavaType getContextType() { + return getContextMethod().getDeclaringClass(); + } } diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -25,11 +25,11 @@ import java.util.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.nodes.type.*; import com.oracle.graal.nodes.util.*; /** diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoweredCallTargetNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoweredCallTargetNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoweredCallTargetNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -26,7 +26,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.nodes.type.*; +import com.oracle.graal.compiler.common.type.*; public abstract class LoweredCallTargetNode extends CallTargetNode { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ParameterNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ParameterNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ParameterNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.nodes; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; -import com.oracle.graal.nodes.type.*; /** * The {@code Parameter} instruction is a placeholder for an incoming argument to a function call. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.nodes; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.calc.*; -import com.oracle.graal.nodes.type.*; public abstract class PhiNode extends FloatingNode { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiArrayNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiArrayNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiArrayNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.nodes; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.nodes.type.*; /** * A {@link PiNode} that also provides an array length in addition to a more refined stamp. A usage diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -25,6 +25,7 @@ //JaCoCo Exclude import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.extended.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ProxyNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ProxyNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ProxyNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,11 +23,11 @@ package com.oracle.graal.nodes; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.Node.ValueNumberable; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.extended.*; -import com.oracle.graal.nodes.type.*; /** * A proxy is inserted at loop exits for any value that is created inside the loop (i.e. was not diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.nodes.type.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValuePhiNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValuePhiNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValuePhiNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.nodes; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.type.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AndNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AndNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AndNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.type.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BitLogicNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BitLogicNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BitLogicNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.nodes.calc; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,6 +24,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/Condition.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/Condition.java Thu Apr 17 17:40:39 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,634 +0,0 @@ -/* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.nodes.calc; - -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; - -/** - * Condition codes used in conditionals. - */ -public enum Condition { - /** - * Equal. - */ - EQ("=="), - - /** - * Not equal. - */ - NE("!="), - - /** - * Signed less than. - */ - LT("<"), - - /** - * Signed less than or equal. - */ - LE("<="), - - /** - * Signed greater than. - */ - GT(">"), - - /** - * Signed greater than or equal. - */ - GE(">="), - - /** - * Unsigned greater than or equal ("above than or equal"). - */ - AE("|>=|"), - - /** - * Unsigned less than or equal ("below than or equal"). - */ - BE("|<=|"), - - /** - * Unsigned greater than ("above than"). - */ - AT("|>|"), - - /** - * Unsigned less than ("below than"). - */ - BT("|<|"); - - public final String operator; - - private Condition(String operator) { - this.operator = operator; - } - - public boolean check(int left, int right) { - switch (this) { - case EQ: - return left == right; - case NE: - return left != right; - case LT: - return left < right; - case LE: - return left <= right; - case GT: - return left > right; - case GE: - return left >= right; - case AE: - return UnsignedMath.aboveOrEqual(left, right); - case BE: - return UnsignedMath.belowOrEqual(left, right); - case AT: - return UnsignedMath.aboveThan(left, right); - case BT: - return UnsignedMath.belowThan(left, right); - } - throw new IllegalArgumentException(this.toString()); - } - - /** - * Given a condition and its negation, this method returns true for one of the two and false for - * the other one. This can be used to keep comparisons in a canonical form. - * - * @return true if this condition is considered to be the canonical form, false otherwise. - */ - public boolean isCanonical() { - switch (this) { - case EQ: - return true; - case NE: - return false; - case LT: - return true; - case LE: - return false; - case GT: - return false; - case GE: - return false; - case BT: - return true; - case BE: - return false; - case AT: - return false; - case AE: - return false; - } - throw new IllegalArgumentException(this.toString()); - } - - /** - * Returns true if the condition needs to be mirrored to get to a canonical condition. The - * result of the mirroring operation might still need to be negated to achieve a canonical form. - */ - public boolean canonicalMirror() { - switch (this) { - case EQ: - return false; - case NE: - return false; - case LT: - return false; - case LE: - return true; - case GT: - return true; - case GE: - return false; - case BT: - return false; - case BE: - return true; - case AT: - return true; - case AE: - return false; - } - throw new IllegalArgumentException(this.toString()); - } - - /** - * Returns true if the condition needs to be negated to get to a canonical condition. The result - * of the negation might still need to be mirrored to achieve a canonical form. - */ - public boolean canonicalNegate() { - switch (this) { - case EQ: - return false; - case NE: - return true; - case LT: - return false; - case LE: - return true; - case GT: - return false; - case GE: - return true; - case BT: - return false; - case BE: - return true; - case AT: - return false; - case AE: - return true; - } - throw new IllegalArgumentException(this.toString()); - } - - /** - * Negate this conditional. - * - * @return the condition that represents the negation - */ - public final Condition negate() { - switch (this) { - case EQ: - return NE; - case NE: - return EQ; - case LT: - return GE; - case LE: - return GT; - case GT: - return LE; - case GE: - return LT; - case BT: - return AE; - case BE: - return AT; - case AT: - return BE; - case AE: - return BT; - } - throw new IllegalArgumentException(this.toString()); - } - - public boolean implies(Condition other) { - if (other == this) { - return true; - } - switch (this) { - case EQ: - return other == LE || other == GE || other == BE || other == AE; - case NE: - return false; - case LT: - return other == LE || other == NE; - case LE: - return false; - case GT: - return other == GE || other == NE; - case GE: - return false; - case BT: - return other == BE || other == NE; - case BE: - return false; - case AT: - return other == AE || other == NE; - case AE: - return false; - } - throw new IllegalArgumentException(this.toString()); - } - - /** - * Mirror this conditional (i.e. commute "a op b" to "b op' a") - * - * @return the condition representing the equivalent commuted operation - */ - public final Condition mirror() { - switch (this) { - case EQ: - return EQ; - case NE: - return NE; - case LT: - return GT; - case LE: - return GE; - case GT: - return LT; - case GE: - return LE; - case BT: - return AT; - case BE: - return AE; - case AT: - return BT; - case AE: - return BE; - } - throw new IllegalArgumentException(); - } - - /** - * Returns true if this condition represents an unsigned comparison. EQ and NE are not - * considered to be unsigned. - */ - public final boolean isUnsigned() { - return this == Condition.BT || this == Condition.BE || this == Condition.AT || this == Condition.AE; - } - - /** - * Checks if this conditional operation is commutative. - * - * @return {@code true} if this operation is commutative - */ - public final boolean isCommutative() { - return this == EQ || this == NE; - } - - /** - * Attempts to fold a comparison between two constants and return the result. - * - * @param lt the constant on the left side of the comparison - * @param rt the constant on the right side of the comparison - * @param constantReflection needed to compare constants - * @return {@link Boolean#TRUE} if the comparison is known to be true, {@link Boolean#FALSE} if - * the comparison is known to be false - */ - public boolean foldCondition(Constant lt, Constant rt, ConstantReflectionProvider constantReflection) { - assert !lt.getKind().isNumericFloat() && !rt.getKind().isNumericFloat(); - return foldCondition(lt, rt, constantReflection, false); - } - - /** - * Attempts to fold a comparison between two constants and return the result. - * - * @param lt the constant on the left side of the comparison - * @param rt the constant on the right side of the comparison - * @param constantReflection needed to compare constants - * @param unorderedIsTrue true if an undecided float comparison should result in "true" - * @return true if the comparison is known to be true, false if the comparison is known to be - * false - */ - public boolean foldCondition(Constant lt, Constant rt, ConstantReflectionProvider constantReflection, boolean unorderedIsTrue) { - switch (lt.getKind()) { - case Boolean: - case Byte: - case Char: - case Short: - case Int: { - int x = lt.asInt(); - int y = rt.asInt(); - switch (this) { - case EQ: - return x == y; - case NE: - return x != y; - case LT: - return x < y; - case LE: - return x <= y; - case GT: - return x > y; - case GE: - return x >= y; - case AE: - return UnsignedMath.aboveOrEqual(x, y); - case BE: - return UnsignedMath.belowOrEqual(x, y); - case AT: - return UnsignedMath.aboveThan(x, y); - case BT: - return UnsignedMath.belowThan(x, y); - default: - throw new GraalInternalError("expected condition: %s", this); - } - } - case Long: { - long x = lt.asLong(); - long y = rt.asLong(); - switch (this) { - case EQ: - return x == y; - case NE: - return x != y; - case LT: - return x < y; - case LE: - return x <= y; - case GT: - return x > y; - case GE: - return x >= y; - case AE: - return UnsignedMath.aboveOrEqual(x, y); - case BE: - return UnsignedMath.belowOrEqual(x, y); - case AT: - return UnsignedMath.aboveThan(x, y); - case BT: - return UnsignedMath.belowThan(x, y); - default: - throw new GraalInternalError("expected condition: %s", this); - } - } - case Object: { - Boolean equal = constantReflection.constantEquals(lt, rt); - if (equal != null) { - switch (this) { - case EQ: - return equal.booleanValue(); - case NE: - return !equal.booleanValue(); - default: - throw new GraalInternalError("expected condition: %s", this); - } - } - } - case Float: { - float x = lt.asFloat(); - float y = rt.asFloat(); - if (Float.isNaN(x) || Float.isNaN(y)) { - return unorderedIsTrue; - } - switch (this) { - case EQ: - return x == y; - case NE: - return x != y; - case LT: - return x < y; - case LE: - return x <= y; - case GT: - return x > y; - case GE: - return x >= y; - default: - throw new GraalInternalError("expected condition: %s", this); - } - } - case Double: { - double x = lt.asDouble(); - double y = rt.asDouble(); - if (Double.isNaN(x) || Double.isNaN(y)) { - return unorderedIsTrue; - } - switch (this) { - case EQ: - return x == y; - case NE: - return x != y; - case LT: - return x < y; - case LE: - return x <= y; - case GT: - return x > y; - case GE: - return x >= y; - default: - throw new GraalInternalError("expected condition: %s", this); - } - } - default: - throw new GraalInternalError("expected value kind %s while folding condition: %s", lt.getKind(), this); - } - } - - public Condition join(Condition other) { - if (other == this) { - return this; - } - switch (this) { - case EQ: - if (other == LE || other == GE || other == BE || other == AE) { - return EQ; - } else { - return null; - } - case NE: - if (other == LT || other == GT || other == BT || other == AT) { - return other; - } else if (other == LE) { - return LT; - } else if (other == GE) { - return GT; - } else if (other == BE) { - return BT; - } else if (other == AE) { - return AT; - } else { - return null; - } - case LE: - if (other == GE || other == EQ) { - return EQ; - } else if (other == NE || other == LT) { - return LT; - } else { - return null; - } - case LT: - if (other == NE || other == LE) { - return LT; - } else { - return null; - } - case GE: - if (other == LE || other == EQ) { - return EQ; - } else if (other == NE || other == GT) { - return GT; - } else { - return null; - } - case GT: - if (other == NE || other == GE) { - return GT; - } else { - return null; - } - case BE: - if (other == AE || other == EQ) { - return EQ; - } else if (other == NE || other == BT) { - return BT; - } else { - return null; - } - case BT: - if (other == NE || other == BE) { - return BT; - } else { - return null; - } - case AE: - if (other == BE || other == EQ) { - return EQ; - } else if (other == NE || other == AT) { - return AT; - } else { - return null; - } - case AT: - if (other == NE || other == AE) { - return AT; - } else { - return null; - } - } - throw new IllegalArgumentException(this.toString()); - } - - public Condition meet(Condition other) { - if (other == this) { - return this; - } - switch (this) { - case EQ: - if (other == LE || other == GE || other == BE || other == AE) { - return other; - } else if (other == LT) { - return LE; - } else if (other == GT) { - return GE; - } else if (other == BT) { - return BE; - } else if (other == AT) { - return AE; - } else { - return null; - } - case NE: - if (other == LT || other == GT || other == BT || other == AT) { - return NE; - } else { - return null; - } - case LE: - if (other == EQ || other == LT) { - return LE; - } else { - return null; - } - case LT: - if (other == EQ || other == LE) { - return LE; - } else if (other == NE || other == GT) { - return NE; - } else { - return null; - } - case GE: - if (other == EQ || other == GT) { - return GE; - } else { - return null; - } - case GT: - if (other == EQ || other == GE) { - return GE; - } else if (other == NE || other == LT) { - return NE; - } else { - return null; - } - case BE: - if (other == EQ || other == BT) { - return BE; - } else { - return null; - } - case BT: - if (other == EQ || other == BE) { - return BE; - } else if (other == NE || other == AT) { - return NE; - } else { - return null; - } - case AE: - if (other == EQ || other == AT) { - return AE; - } else { - return null; - } - case AT: - if (other == EQ || other == AE) { - return AE; - } else if (other == NE || other == BT) { - return NE; - } else { - return null; - } - } - throw new IllegalArgumentException(this.toString()); - } -} diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConditionalNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConditionalNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConditionalNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -25,6 +25,7 @@ import static com.oracle.graal.nodes.calc.CompareNode.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,8 +24,8 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.type.*; /** * Represents a conversion between primitive types. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FixedBinaryNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FixedBinaryNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FixedBinaryNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.nodes.calc; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.type.*; public abstract class FixedBinaryNode extends DeoptimizingFixedWithNextNode { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatAddNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatAddNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatAddNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,12 +23,12 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; 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.*; -import com.oracle.graal.nodes.type.*; @NodeInfo(shortName = "+") public final class FloatAddNode extends FloatArithmeticNode implements Canonicalizable { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatArithmeticNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatArithmeticNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatArithmeticNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.nodes.calc; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatConvertNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatConvertNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatConvertNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,6 +24,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatDivNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatDivNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatDivNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,12 +23,12 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; 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.*; -import com.oracle.graal.nodes.type.*; @NodeInfo(shortName = "/") public final class FloatDivNode extends FloatArithmeticNode implements Canonicalizable { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatEqualsNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatEqualsNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatEqualsNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.nodes.calc; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.type.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatLessThanNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatLessThanNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatLessThanNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.nodes.calc; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatMulNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatMulNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatMulNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,12 +23,12 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; 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.*; -import com.oracle.graal.nodes.type.*; @NodeInfo(shortName = "*") public final class FloatMulNode extends FloatArithmeticNode implements Canonicalizable { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatRemNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatRemNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatRemNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,12 +23,12 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; 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.*; -import com.oracle.graal.nodes.type.*; @NodeInfo(shortName = "%") public final class FloatRemNode extends FloatArithmeticNode implements Canonicalizable { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatSubNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatSubNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatSubNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,12 +23,12 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; 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.*; -import com.oracle.graal.nodes.type.*; @NodeInfo(shortName = "-") public final class FloatSubNode extends FloatArithmeticNode implements Canonicalizable { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatingNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatingNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatingNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.nodes.calc; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.type.*; public abstract class FloatingNode extends ValueNode implements Node.ValueNumberable { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerAddNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerAddNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerAddNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerArithmeticNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerArithmeticNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerArithmeticNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.nodes.calc; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerBelowThanNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerBelowThanNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerBelowThanNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerConvertNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerConvertNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerConvertNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerDivNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerDivNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerDivNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.code.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerMulNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerMulNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerMulNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,6 +24,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerRemNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerRemNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerRemNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.code.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerSubNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerSubNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerSubNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/LeftShiftNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/LeftShiftNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/LeftShiftNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/OrNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/OrNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/OrNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ReinterpretNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ReinterpretNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ReinterpretNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,6 +24,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/RightShiftNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/RightShiftNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/RightShiftNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ShiftNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ShiftNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ShiftNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,9 +23,9 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.nodes.type.*; /** * The {@code ShiftOp} class represents shift operations. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedDivNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedDivNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedDivNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,6 +24,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRemNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRemNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRemNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,6 +24,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRightShiftNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRightShiftNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRightShiftNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ZeroExtendNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ZeroExtendNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ZeroExtendNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/ControlFlowGraph.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/ControlFlowGraph.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/ControlFlowGraph.java Thu Apr 17 21:50:14 2014 +0200 @@ -321,15 +321,15 @@ dominator.dominated.add(block); } - public static Block commonDominator(Block a, Block b) { + public static > T commonDominator(T a, T b) { if (a == null) { return b; } if (b == null) { return a; } - Block iterA = a; - Block iterB = b; + T iterA = a; + T iterB = b; while (iterA != iterB) { if (iterA.getId() > iterB.getId()) { iterA = iterA.getDominator(); diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ArrayRangeWriteNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ArrayRangeWriteNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ArrayRangeWriteNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.nodes.extended; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.type.*; /** * Base class for nodes that modify a range of an array. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BranchProbabilityNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BranchProbabilityNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BranchProbabilityNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.extended; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ComputeAddressNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ComputeAddressNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ComputeAddressNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,11 +23,11 @@ package com.oracle.graal.nodes.extended; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.nodes.type.*; public class ComputeAddressNode extends FloatingNode implements LIRLowerable { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FixedAccessNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FixedAccessNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FixedAccessNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.nodes.extended; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.type.*; /** * Accesses a value at an memory address specified by an {@linkplain #object object} and a diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatableAccessNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatableAccessNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatableAccessNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,8 +23,8 @@ package com.oracle.graal.nodes.extended; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.type.*; /** * An {@link FixedAccessNode} that can be converted to a {@link FloatingAccessNode}. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingAccessNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingAccessNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingAccessNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,9 +23,9 @@ package com.oracle.graal.nodes.extended; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.type.*; public abstract class FloatingAccessNode extends FloatingGuardedNode implements Access, MemoryAccess { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingReadNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingReadNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingReadNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,11 +23,11 @@ package com.oracle.graal.nodes.extended; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.nodes.type.*; /** * A floating read of a value from memory specified in terms of an object base and an object diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ForeignCallNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ForeignCallNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ForeignCallNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -26,6 +26,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadHubNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadHubNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadHubNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,6 +24,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.meta.ResolvedJavaType.Representation; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LocationNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LocationNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LocationNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,11 +23,11 @@ package com.oracle.graal.nodes.extended; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.Node.ValueNumberable; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.nodes.type.*; /** * A location for a memory access in terms of the kind of value accessed and how to access it. All diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/OSRLocalNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/OSRLocalNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/OSRLocalNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.nodes.extended; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.type.*; @NodeInfo(nameTemplate = "OSRLocal({p#index})") public class OSRLocalNode extends AbstractLocalNode implements IterableNodeType { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.extended; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeAccessNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeAccessNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeAccessNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.extended; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.extended; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AbstractNewArrayNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AbstractNewArrayNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AbstractNewArrayNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.nodes.java; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AbstractNewObjectNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AbstractNewObjectNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AbstractNewObjectNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,12 +24,12 @@ import java.util.*; +import com.oracle.graal.compiler.common.type.*; 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.*; -import com.oracle.graal.nodes.type.*; /** * The {@code AbstractNewObjectNode} is the base class for the new instance and new array nodes. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessArrayNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessArrayNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessArrayNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.nodes.java; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.type.*; /** * This the base class of all array operations. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -25,9 +25,9 @@ import java.lang.reflect.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.nodes.type.*; /** * The base class of all instructions that access fields. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessIndexedNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessIndexedNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessIndexedNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,9 +23,9 @@ package com.oracle.graal.nodes.java; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.nodes.type.*; /** * The {@code AccessIndexedNode} class is the base class of instructions that read or write elements diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -28,6 +28,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.meta.ProfilingInfo.TriState; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.java; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadExceptionObjectNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadExceptionObjectNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadExceptionObjectNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,9 +23,9 @@ package com.oracle.graal.nodes.java; import com.oracle.graal.api.code.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.nodes.type.*; /** * Loads an exception object passed by the runtime from a callee to an exception handler in a diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -27,6 +27,7 @@ import java.lang.reflect.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.java; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -25,6 +25,7 @@ import java.lang.reflect.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/ArithmeticLIRGenerator.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/ArithmeticLIRGenerator.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/ArithmeticLIRGenerator.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,9 +23,9 @@ package com.oracle.graal.nodes.spi; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.FloatConvertNode.FloatConvert; -import com.oracle.graal.nodes.type.*; /** * This interface can be used to generate LIR for arithmetic operations. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRTypeTool.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRTypeTool.java Thu Apr 17 17:40:39 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.nodes.spi; - -import com.oracle.graal.api.meta.*; - -/** - * This interface can be used to access platform and VM specific kinds. - */ -public interface LIRTypeTool { - - PlatformKind getIntegerKind(int bits); - - PlatformKind getFloatingKind(int bits); - - PlatformKind getObjectKind(); -} diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/MemoryArithmeticLIRLowerer.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/MemoryArithmeticLIRLowerer.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/MemoryArithmeticLIRLowerer.java Thu Apr 17 21:50:14 2014 +0200 @@ -25,10 +25,10 @@ import java.util.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.FloatConvertNode.FloatConvert; import com.oracle.graal.nodes.extended.*; -import com.oracle.graal.nodes.type.*; /** * This interface can be used to generate LIR for arithmetic operations where one of the operations diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/NodeWithState.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/NodeWithState.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/NodeWithState.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.nodes.spi; import com.oracle.graal.graph.*; +import com.oracle.graal.graph.iterators.*; import com.oracle.graal.nodes.*; /** @@ -31,4 +32,8 @@ public interface NodeWithState { Node asNode(); + + default NodeIterable states() { + return asNode().inputs().filter(FrameState.class); + } } diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/FloatStamp.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/FloatStamp.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/FloatStamp.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,7 +24,8 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; -import com.oracle.graal.nodes.spi.*; +import com.oracle.graal.compiler.common.spi.*; +import com.oracle.graal.compiler.common.type.*; public class FloatStamp extends PrimitiveStamp { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/IllegalStamp.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/IllegalStamp.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/IllegalStamp.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,7 +24,8 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; -import com.oracle.graal.nodes.spi.*; +import com.oracle.graal.compiler.common.spi.*; +import com.oracle.graal.compiler.common.type.*; /** * This stamp represents the illegal type. Values with this type can not exist at run time. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/IntegerStamp.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/IntegerStamp.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/IntegerStamp.java Thu Apr 17 21:50:14 2014 +0200 @@ -26,8 +26,9 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.spi.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.spi.*; /** * Describes the possible values of a {@link ValueNode} that produces an int or long result. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/ObjectStamp.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/ObjectStamp.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/ObjectStamp.java Thu Apr 17 21:50:14 2014 +0200 @@ -26,8 +26,9 @@ import java.util.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.spi.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.spi.*; public class ObjectStamp extends Stamp { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/PrimitiveStamp.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/PrimitiveStamp.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/PrimitiveStamp.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.nodes.type; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; /** diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/Stamp.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/Stamp.java Thu Apr 17 17:40:39 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.nodes.type; - -import com.oracle.graal.api.meta.*; -import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.spi.*; - -/** - * A stamp is the basis for a type system over the nodes in a graph. - */ -public abstract class Stamp { - - protected Stamp() { - } - - /** - * Returns the type of the stamp, guaranteed to be non-null. In some cases, this requires the - * lookup of class meta data, therefore the {@link MetaAccessProvider} is mandatory. - */ - public abstract ResolvedJavaType javaType(MetaAccessProvider metaAccess); - - public boolean alwaysDistinct(Stamp other) { - return !join(other).isLegal(); - } - - /** - * Gets a Java {@link Kind} that can be used to store a value of this stamp on the Java bytecode - * stack. Returns {@link Kind#Illegal} if a value of this stamp can not be stored on the - * bytecode stack. - */ - public abstract Kind getStackKind(); - - /** - * Gets a platform dependent {@link PlatformKind} that can be used to store a value of this - * stamp. - */ - public abstract PlatformKind getPlatformKind(LIRTypeTool tool); - - /** - * Returns the union of this stamp and the given stamp. Typically used to create stamps for - * {@link ValuePhiNode}s. - * - * @param other The stamp that will enlarge this stamp. - * @return The union of this stamp and the given stamp. - */ - public abstract Stamp meet(Stamp other); - - /** - * Returns the intersection of this stamp and the given stamp. - * - * @param other The stamp that will tighten this stamp. - * @return The intersection of this stamp and the given stamp. - */ - public abstract Stamp join(Stamp other); - - /** - * Returns a stamp of the same kind, but allowing the full value range of the kind. - * - * {@link #unrestricted()} is the neutral element of the {@link #join(Stamp)} operation. - */ - public abstract Stamp unrestricted(); - - /** - * Returns a stamp of the same kind, but with no allowed values. - * - * {@link #illegal()} is the neutral element of the {@link #meet(Stamp)} operation. - */ - public abstract Stamp illegal(); - - /** - * Test whether two stamps have the same base type. - */ - public abstract boolean isCompatible(Stamp other); - - /** - * Test whether this stamp has legal values. - */ - public abstract boolean isLegal(); - - /** - * If this stamp represents a single value, the methods returns this single value. It returns - * null otherwise. - * - * @return the constant corresponding to the single value of this stamp and null if this stamp - * can represent less or more than one value. - */ - public Constant asConstant() { - return null; - } -} diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,6 +24,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; public class StampFactory { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampProvider.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampProvider.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampProvider.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,6 +22,8 @@ */ package com.oracle.graal.nodes.type; +import com.oracle.graal.compiler.common.type.*; + public interface StampProvider { Stamp stamp(); diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampTool.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampTool.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampTool.java Thu Apr 17 21:50:14 2014 +0200 @@ -25,6 +25,7 @@ import java.util.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.calc.*; /** diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/VoidStamp.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/VoidStamp.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/VoidStamp.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,7 +24,8 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; -import com.oracle.graal.nodes.spi.*; +import com.oracle.graal.compiler.common.spi.*; +import com.oracle.graal.compiler.common.type.*; /** * Singleton stamp representing the value of type {@code void}. diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/ComputeImmediateDominator.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/ComputeImmediateDominator.java Thu Apr 17 17:40:39 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,263 +0,0 @@ -/* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.nodes.util; - -import java.util.*; - -import com.oracle.graal.compiler.common.*; -import com.oracle.graal.graph.*; -import com.oracle.graal.nodes.*; - -public final class ComputeImmediateDominator { - - private final MergeNode dominated; - private final Queue toExplore; - private final Queue speculativeExplore; - private final NodeMap infoMap; - private final DominatorInfo fullInfo; - private FixedNode dominator; - private int nextBit = 1; - - public ComputeImmediateDominator(MergeNode dominated) { - this.dominated = dominated; - this.toExplore = new LinkedList<>(); - this.speculativeExplore = new LinkedList<>(); - this.infoMap = dominated.graph().createNodeMap(); - fullInfo = new DominatorInfo(dominated, true); - - this.processMerge(dominated, fullInfo); - if (toExplore.size() == 1) { - dominator = toExplore.remove(); - } - } - - public FixedNode compute() { - try { - while (dominator == null && (!toExplore.isEmpty() || !speculativeExplore.isEmpty())) { - while (!toExplore.isEmpty()) { - exploreUp(toExplore.remove()); - if (dominator != null) { - return dominator; - } - } - exploreUp(speculativeExplore.remove()); - } - return dominator; - } catch (Throwable t) { - throw GraalGraphInternalError.transformAndAddContext(new GraalInternalError(t).addContext("Could not find a dominator"), dominated); - } - } - - private void exploreUp(FixedNode from) { - FixedNode p = from; - DominatorInfo info = infoMap.get(from); - if (info.isExplored()) { - return; - } - // TTY.println("exploreUp(" + from + ") with " + info); - info.setExplored(); - while (p != null) { - if (p instanceof MergeNode) { - processMerge((MergeNode) p, info); - p = null; - } else if (p instanceof ControlSplitNode) { - processControlSplit((ControlSplitNode) p, info); - p = null; - } else { - p = (FixedNode) p.predecessor(); - } - } - } - - private void processControlSplit(ControlSplitNode cs, DominatorInfo info) { - // TTY.println("processControlSplit(" + cs + ", " + info + ")"); - DominatorInfo csInfo = infoMap.get(cs); - if (csInfo == null) { - csInfo = new DominatorInfo(cs, false); - infoMap.set(cs, csInfo); - } - csInfo.add(info); - FixedNode next = (FixedNode) cs.predecessor(); - if (checkControlSplitInfo(csInfo)) { - return; - } - if (csInfo.isExplored()) { - // TTY.println(" Already explored, propagate update"); - propagateUpdate(csInfo); - } else { - if (csInfo.parentCount() == cs.successors().count()) { // all paths leading to this CS - // have been explored - // TTY.println(" All parents explored, Enqueue"); - toExplore.add(next); - speculativeExplore.remove(next); - } else { - // TTY.println(" Not all parents explored : Enqueue speculative"); - speculativeExplore.add(next); - } - } - infoMap.set(next, csInfo); - } - - private boolean propagateUpdate(DominatorInfo di) { - // TTY.println(" propagateUpdate(" + di + ")"); - for (DominatorInfo child : di.children()) { - // TTY.println(" add to child " + child); - if (child.add(di, false)) { - if (child.equals(fullInfo)) { - // TTY.println(" Found DOM!"); - dominator = child.node(); - return true; - } - if (propagateUpdate(child)) { - return true; - } - } - } - return false; - } - - private boolean checkControlSplitInfo(DominatorInfo di) { - // TTY.println(" checkControlSplitInfo(" + di + ")"); - if (di.equals(fullInfo)) { - dominator = di.node(); - // TTY.println(" Found DOM!"); - return true; - } - return false; - } - - private void processMerge(MergeNode merge, DominatorInfo info) { - // TTY.println("processMerge(" + merge + ", " + info + ")"); - for (AbstractEndNode end : merge.cfgPredecessors()) { - toExplore.add(end); - infoMap.set(end, info.createChild(end)); - // TTY.println(" Enqueue end : " + end + " with " + infoMap.get(end)); - } - } - - private class DominatorInfo { - - private final FixedNode node; - private final BitSet bits; - private final BitSet ownBits; - private final Collection children; - private final Collection parents; - private boolean explored; - - public DominatorInfo(FixedNode node, boolean full) { - this.node = node; - this.bits = new BitSet(); - this.ownBits = new BitSet(); - this.children = new ArrayList<>(2); - this.parents = new ArrayList<>(2); - if (full) { - addOwnBits(0); - } - } - - public boolean isExplored() { - return explored; - } - - public void setExplored() { - explored = true; - } - - public DominatorInfo createChild(FixedNode childNode) { - DominatorInfo di = new DominatorInfo(childNode, false); - di.bits.or(bits); - di.ownBits.or(ownBits); - if (!children.isEmpty() || di.ownBits.isEmpty()) { - int newBit = nextBit++; - di.bits.xor(ownBits); - di.bits.set(newBit); - di.ownBits.clear(); - di.ownBits.set(newBit); - addOwnBits(newBit); - } - children.add(di); - di.parents.add(this); - return di; - } - - private void addOwnBits(int newBit) { - if (!bits.get(newBit)) { - ownBits.set(newBit); - bits.set(newBit); - for (DominatorInfo parent : parents) { - parent.addOwnBits(newBit); - } - } - } - - public boolean add(DominatorInfo i) { - return add(i, true); - } - - public boolean add(DominatorInfo i, boolean addParent) { - boolean ret = true; - if (addParent) { - parents.add(i); - i.children.add(this); - bits.or(i.bits); - } else { - BitSet newBits = (BitSet) i.bits.clone(); - newBits.andNot(bits); - newBits.andNot(i.ownBits); - ret = !newBits.isEmpty(); - bits.or(newBits); - } - return ret; - } - - public int parentCount() { - return parents.size(); - } - - public FixedNode node() { - return node; - } - - public Collection children() { - return children; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof DominatorInfo)) { - return false; - } - return ((DominatorInfo) obj).bits.equals(bits); - } - - @Override - public String toString() { - return bits + " (o" + ownBits + ") " + node; - } - - @Override - public int hashCode() { - return bits.hashCode(); - } - } -} diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/NodeIterators.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/NodeIterators.java Thu Apr 17 17:40:39 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.nodes.util; - -import java.util.*; - -import com.oracle.graal.graph.iterators.*; -import com.oracle.graal.nodes.*; - -public class NodeIterators { - - public static NodeIterable dominators(final FixedNode n) { - return new NodeIterable() { - - @Override - public Iterator iterator() { - return new NodeIterator() { - - FixedNode p = n; - - @Override - protected void forward() { - if (current == null) { - if (p instanceof MergeNode) { - current = new ComputeImmediateDominator((MergeNode) p).compute(); - } else { - current = (FixedNode) p.predecessor(); - } - p = current; - } - } - }; - } - }; - } -} diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/TreeIterators.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/TreeIterators.java Thu Apr 17 17:40:39 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.nodes.util; - -import java.util.*; - -public class TreeIterators { - - public abstract static class PrefixTreeIterator implements Iterator { - - private Deque stack = new LinkedList<>(); - - public PrefixTreeIterator(T root) { - stack.push(root); - } - - public PrefixTreeIterator(Iterable roots) { - for (T root : roots) { - stack.addLast(root); - } - } - - @Override - public boolean hasNext() { - return !stack.isEmpty(); - } - - @Override - public T next() { - T top = stack.pop(); - LinkedList list = new LinkedList<>(); - for (T child : children(top)) { - list.addFirst(child); - } - for (T child : list) { - stack.push(child); - } - return top; - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - - protected abstract Iterable children(T node); - } -} diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java Thu Apr 17 21:50:14 2014 +0200 @@ -26,6 +26,7 @@ import java.util.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; import com.oracle.graal.graph.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java Thu Apr 17 21:50:14 2014 +0200 @@ -30,6 +30,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; import com.oracle.graal.graph.*; @@ -37,7 +38,6 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.nodes.type.*; import com.oracle.graal.nodes.util.*; import com.oracle.graal.options.*; import com.oracle.graal.phases.common.InliningUtil.InlineInfo; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java Thu Apr 17 21:50:14 2014 +0200 @@ -37,6 +37,8 @@ import com.oracle.graal.api.meta.JavaTypeProfile.ProfiledType; import com.oracle.graal.api.meta.ResolvedJavaType.Representation; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; import com.oracle.graal.graph.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/TailDuplicationPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/TailDuplicationPhase.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/TailDuplicationPhase.java Thu Apr 17 21:50:14 2014 +0200 @@ -27,6 +27,7 @@ import java.util.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.Graph.DuplicationReplacement; import com.oracle.graal.graph.Graph.Mark; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64FloatConvertNode.java --- a/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64FloatConvertNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64FloatConvertNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -24,11 +24,11 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.calc.FloatConvertNode.FloatConvert; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.nodes.type.*; /** * This node has the semantics of the AMD64 floating point conversions. It is used in the lowering diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InstanceOfSnippetsTemplates.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InstanceOfSnippetsTemplates.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InstanceOfSnippetsTemplates.java Thu Apr 17 21:50:14 2014 +0200 @@ -28,6 +28,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.replacements.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java Thu Apr 17 21:50:14 2014 +0200 @@ -31,6 +31,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.internal.*; import com.oracle.graal.graph.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Thu Apr 17 21:50:14 2014 +0200 @@ -36,6 +36,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; import com.oracle.graal.debug.internal.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/UnsignedMathSubstitutions.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/UnsignedMathSubstitutions.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/UnsignedMathSubstitutions.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.replacements; -import static com.oracle.graal.nodes.calc.Condition.*; +import static com.oracle.graal.compiler.common.calc.Condition.*; import static com.oracle.graal.nodes.calc.ConditionalNode.*; import com.oracle.graal.api.code.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/LoadSnippetVarargParameterNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/LoadSnippetVarargParameterNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/LoadSnippetVarargParameterNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.replacements.nodes; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.type.*; import com.oracle.graal.replacements.Snippet.VarargsParameter; /** diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/LoadIndexedFinalNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/LoadIndexedFinalNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/LoadIndexedFinalNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.truffle.nodes; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerAddExactSplitNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerAddExactSplitNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerAddExactSplitNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,9 +23,9 @@ package com.oracle.graal.truffle.nodes.arithmetic; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.nodes.type.*; public class IntegerAddExactSplitNode extends IntegerExactArithmeticSplitNode { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerExactArithmeticSplitNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerExactArithmeticSplitNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerExactArithmeticSplitNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,10 +23,10 @@ package com.oracle.graal.truffle.nodes.arithmetic; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.nodes.type.*; public abstract class IntegerExactArithmeticSplitNode extends ControlSplitNode implements LIRLowerable { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerMulExactSplitNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerMulExactSplitNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerMulExactSplitNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,9 +23,9 @@ package com.oracle.graal.truffle.nodes.arithmetic; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.nodes.type.*; public class IntegerMulExactSplitNode extends IntegerExactArithmeticSplitNode { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerSubExactSplitNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerSubExactSplitNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerSubExactSplitNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,9 +23,9 @@ package com.oracle.graal.truffle.nodes.arithmetic; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.nodes.type.*; public class IntegerSubExactSplitNode extends IntegerExactArithmeticSplitNode { diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/NewFrameNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/NewFrameNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/NewFrameNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -28,6 +28,7 @@ import com.oracle.graal.api.replacements.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadFinalNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadFinalNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadFinalNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.truffle.nodes.typesystem; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadMacroNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadMacroNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadMacroNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.truffle.nodes.typesystem; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/UnsafeTypeCastMacroNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/UnsafeTypeCastMacroNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/UnsafeTypeCastMacroNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,8 @@ package com.oracle.graal.truffle.nodes.typesystem; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.calc.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java Thu Apr 17 21:50:14 2014 +0200 @@ -26,6 +26,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; @@ -132,78 +133,75 @@ } private void processNodeWithState(NodeWithState nodeWithState, final BlockT state, final GraphEffectList effects) { - for (Node input : nodeWithState.asNode().inputs()) { - if (input instanceof FrameState) { - FrameState frameState = (FrameState) input; - if (frameState.usages().count() > 1) { - FrameState copy = (FrameState) frameState.copyWithInputs(); - nodeWithState.asNode().replaceFirstInput(frameState, copy); - frameState = copy; - } - final Set virtual = new ArraySet<>(); - frameState.applyToNonVirtual(new NodeClosure() { + for (FrameState frameState : nodeWithState.states()) { + if (frameState.usages().count() > 1) { + FrameState copy = (FrameState) frameState.copyWithInputs(); + nodeWithState.asNode().replaceFirstInput(frameState, copy); + frameState = copy; + } + final Set virtual = new ArraySet<>(); + frameState.applyToNonVirtual(new NodeClosure() { - @Override - public void apply(Node usage, ValueNode value) { - ObjectState valueObj = getObjectState(state, value); - if (valueObj != null) { - virtual.add(valueObj); - effects.replaceFirstInput(usage, value, valueObj.virtual); - } else if (value instanceof VirtualObjectNode) { - ObjectState virtualObj = null; - for (ObjectState obj : state.getStates()) { - if (value == obj.virtual) { - virtualObj = obj; - break; - } - } - if (virtualObj != null) { - virtual.add(virtualObj); + @Override + public void apply(Node usage, ValueNode value) { + ObjectState valueObj = getObjectState(state, value); + if (valueObj != null) { + virtual.add(valueObj); + effects.replaceFirstInput(usage, value, valueObj.virtual); + } else if (value instanceof VirtualObjectNode) { + ObjectState virtualObj = null; + for (ObjectState obj : state.getStates()) { + if (value == obj.virtual) { + virtualObj = obj; + break; } } - } - }); - for (ObjectState obj : state.getStates()) { - if (obj.isVirtual() && obj.hasLocks()) { - virtual.add(obj); + if (virtualObj != null) { + virtual.add(virtualObj); + } } } + }); + for (ObjectState obj : state.getStates()) { + if (obj.isVirtual() && obj.hasLocks()) { + virtual.add(obj); + } + } - ArrayDeque queue = new ArrayDeque<>(virtual); - while (!queue.isEmpty()) { - ObjectState obj = queue.removeLast(); - if (obj.isVirtual()) { - for (ValueNode field : obj.getEntries()) { - if (field instanceof VirtualObjectNode) { - ObjectState fieldObj = state.getObjectState((VirtualObjectNode) field); - if (fieldObj.isVirtual() && !virtual.contains(fieldObj)) { - virtual.add(fieldObj); - queue.addLast(fieldObj); - } + ArrayDeque queue = new ArrayDeque<>(virtual); + while (!queue.isEmpty()) { + ObjectState obj = queue.removeLast(); + if (obj.isVirtual()) { + for (ValueNode field : obj.getEntries()) { + if (field instanceof VirtualObjectNode) { + ObjectState fieldObj = state.getObjectState((VirtualObjectNode) field); + if (fieldObj.isVirtual() && !virtual.contains(fieldObj)) { + virtual.add(fieldObj); + queue.addLast(fieldObj); } } } } - for (ObjectState obj : virtual) { - EscapeObjectState v; - if (obj.isVirtual()) { - ValueNode[] fieldState = obj.getEntries().clone(); - for (int i = 0; i < fieldState.length; i++) { - ObjectState valueObj = getObjectState(state, fieldState[i]); - if (valueObj != null) { - if (valueObj.isVirtual()) { - fieldState[i] = valueObj.virtual; - } else { - fieldState[i] = valueObj.getMaterializedValue(); - } + } + for (ObjectState obj : virtual) { + EscapeObjectState v; + if (obj.isVirtual()) { + ValueNode[] fieldState = obj.getEntries().clone(); + for (int i = 0; i < fieldState.length; i++) { + ObjectState valueObj = getObjectState(state, fieldState[i]); + if (valueObj != null) { + if (valueObj.isVirtual()) { + fieldState[i] = valueObj.virtual; + } else { + fieldState[i] = valueObj.getMaterializedValue(); } } - v = new VirtualObjectState(obj.virtual, fieldState); - } else { - v = new MaterializedObjectState(obj.virtual, obj.getMaterializedValue()); } - effects.addVirtualMapping(frameState, v); + v = new VirtualObjectState(obj.virtual, fieldState); + } else { + v = new MaterializedObjectState(obj.virtual, obj.getMaterializedValue()); } + effects.addVirtualMapping(frameState, v); } } } diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java Thu Apr 17 21:50:14 2014 +0200 @@ -27,12 +27,12 @@ import java.util.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.cfg.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.java.*; -import com.oracle.graal.nodes.type.*; import com.oracle.graal.nodes.util.*; import com.oracle.graal.phases.schedule.*; import com.oracle.graal.virtual.phases.ea.ReadEliminationBlockState.CacheEntry; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.word/src/com/oracle/graal/word/Word.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/Word.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/Word.java Thu Apr 17 21:50:14 2014 +0200 @@ -29,6 +29,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.nodes.HeapAccess.BarrierType; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/WordCastNode.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/WordCastNode.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/WordCastNode.java Thu Apr 17 21:50:14 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.word.nodes; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r ff0283a98b7a -r bf37ce7df3fd graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java Thu Apr 17 17:40:39 2014 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java Thu Apr 17 21:50:14 2014 +0200 @@ -29,6 +29,8 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.compiler.common.calc.*; +import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.HeapAccess.BarrierType; diff -r ff0283a98b7a -r bf37ce7df3fd mx/mx_graal.py --- a/mx/mx_graal.py Thu Apr 17 17:40:39 2014 +0200 +++ b/mx/mx_graal.py Thu Apr 17 21:50:14 2014 +0200 @@ -965,8 +965,7 @@ parsed_args = parser.parse_args(ut_args) else: # parse all know arguments - parsed_args, remaining_args = parser.parse_known_args(ut_args) - args = remaining_args + args + parsed_args, args = parser.parse_known_args(ut_args) whitelist = None if parsed_args.baseline_whitelist: diff -r ff0283a98b7a -r bf37ce7df3fd mx/projects --- a/mx/projects Thu Apr 17 17:40:39 2014 +0200 +++ b/mx/projects Thu Apr 17 21:50:14 2014 +0200 @@ -253,7 +253,7 @@ # graal.graph project@com.oracle.graal.graph@subDir=graal project@com.oracle.graal.graph@sourceDirs=src -project@com.oracle.graal.graph@dependencies=com.oracle.graal.debug,com.oracle.graal.api.code,com.oracle.graal.compiler.common,FINDBUGS +project@com.oracle.graal.graph@dependencies=com.oracle.graal.debug,com.oracle.graal.compiler.common,FINDBUGS project@com.oracle.graal.graph@javaCompliance=1.8 project@com.oracle.graal.graph@workingSets=Graal,Graph @@ -502,7 +502,7 @@ # graal.compiler.common project@com.oracle.graal.compiler.common@subDir=graal project@com.oracle.graal.compiler.common@sourceDirs=src -project@com.oracle.graal.compiler.common@dependencies= +project@com.oracle.graal.compiler.common@dependencies=com.oracle.graal.api.code project@com.oracle.graal.compiler.common@checkstyle=com.oracle.graal.graph project@com.oracle.graal.compiler.common@javaCompliance=1.8 project@com.oracle.graal.compiler.common@workingSets=Graal,Java diff -r ff0283a98b7a -r bf37ce7df3fd src/share/vm/graal/graalCompilerToVM.cpp --- a/src/share/vm/graal/graalCompilerToVM.cpp Thu Apr 17 17:40:39 2014 +0200 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Thu Apr 17 21:50:14 2014 +0200 @@ -933,7 +933,13 @@ return NULL; C2V_END - +C2V_VMENTRY(void, resolveInvokeDynamic, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index)) + ConstantPool* cp = (ConstantPool*)metaspace_constant_pool; + CallInfo callInfo; + LinkResolver::resolve_invokedynamic(callInfo, cp, index, CHECK); + ConstantPoolCacheEntry* cp_cache_entry = cp->invokedynamic_cp_cache_entry_at(index); + cp_cache_entry->set_dynamic_call(cp, callInfo); +C2V_END // public native void materializeVirtualObjects(HotSpotStackFrameReference stackFrame, boolean invalidate); C2V_VMENTRY(void, materializeVirtualObjects, (JNIEnv *env, jobject, jobject hs_frame, bool invalidate)) @@ -1078,6 +1084,7 @@ {CC"lookupMethodInPool", CC"("METASPACE_CONSTANT_POOL"IB)"METASPACE_METHOD, FN_PTR(lookupMethodInPool)}, {CC"constantPoolRemapInstructionOperandFromCache", CC"("METASPACE_CONSTANT_POOL"I)I", FN_PTR(constantPoolRemapInstructionOperandFromCache)}, {CC"resolveField", CC"("METASPACE_CONSTANT_POOL"IB[J)"METASPACE_KLASS, FN_PTR(resolveField)}, + {CC"resolveInvokeDynamic", CC"("METASPACE_CONSTANT_POOL"I)V", FN_PTR(resolveInvokeDynamic)}, {CC"resolveMethod", CC"("METASPACE_KLASS STRING STRING")"METASPACE_METHOD, FN_PTR(resolveMethod)}, {CC"getClassInitializer", CC"("METASPACE_KLASS")"METASPACE_METHOD, FN_PTR(getClassInitializer)}, {CC"hasFinalizableSubclass", CC"("METASPACE_KLASS")Z", FN_PTR(hasFinalizableSubclass)}, diff -r ff0283a98b7a -r bf37ce7df3fd src/share/vm/runtime/gpu.hpp --- a/src/share/vm/runtime/gpu.hpp Thu Apr 17 17:40:39 2014 +0200 +++ b/src/share/vm/runtime/gpu.hpp Thu Apr 17 21:50:14 2014 +0200 @@ -32,7 +32,7 @@ #define MAX_GPUS 2 // Defines the interface to the graphics processor(s). -class Gpu { +class Gpu : public CHeapObj { private: static int _initialized_gpus_count; static Gpu* _initialized_gpus[MAX_GPUS];