# HG changeset patch # User Doug Simon # Date 1432589434 -7200 # Node ID 93c50cefb9e8bc6cf0a9ebac30652edd3cfe470e # Parent 543957c1c6a6da90191eb82aacc7caac02e803c1 moved GraalInternalError to com.oracle.jvmci.common and renamed it to JVMCIError (JBS:GRAAL-53) diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAddress.java --- a/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAddress.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAddress.java Mon May 25 23:30:34 2015 +0200 @@ -25,8 +25,8 @@ import static com.oracle.graal.sparc.SPARC.*; import com.oracle.graal.api.code.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.sparc.*; +import com.oracle.jvmci.common.*; public class SPARCAddress extends AbstractAddress { @@ -113,7 +113,7 @@ */ public int getDisplacement() { if (hasIndex()) { - throw GraalInternalError.shouldNotReachHere("address has index register"); + throw JVMCIError.shouldNotReachHere("address has index register"); } // TODO Should we also hide the register save area size here? if (getBase().equals(sp) || getBase().equals(fp)) { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java --- a/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java Mon May 25 23:30:34 2015 +0200 @@ -34,10 +34,10 @@ import com.oracle.graal.api.code.*; 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.sparc.*; import com.oracle.graal.sparc.SPARC.CPUFeature; +import com.oracle.jvmci.common.*; /** * This class implements an assembler that can encode most SPARC instructions. @@ -580,7 +580,7 @@ } else if (isFloat) { return Fcc0; } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } @@ -696,7 +696,7 @@ case OverflowSet : return OverflowClear; case OverflowClear : return OverflowSet; default: - GraalInternalError.unimplemented(); + JVMCIError.unimplemented(); } //@formatter:on return null; @@ -753,7 +753,7 @@ case GT: return Greater; } - throw GraalInternalError.shouldNotReachHere("Unimplemented for: " + cond); + throw JVMCIError.shouldNotReachHere("Unimplemented for: " + cond); case Fcc0: case Fcc1: case Fcc2: @@ -772,9 +772,9 @@ case GT: return unorderedIsTrue ? F_UnorderedOrGreater : F_Greater; } - throw GraalInternalError.shouldNotReachHere("Unkown condition: " + cond); + throw JVMCIError.shouldNotReachHere("Unkown condition: " + cond); } - throw GraalInternalError.shouldNotReachHere("Unknown condition flag register " + conditionFlagsRegister); + throw JVMCIError.shouldNotReachHere("Unknown condition flag register " + conditionFlagsRegister); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCMacroAssembler.java --- a/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCMacroAssembler.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCMacroAssembler.java Mon May 25 23:30:34 2015 +0200 @@ -30,7 +30,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.asm.*; -import com.oracle.graal.compiler.common.*; +import com.oracle.jvmci.common.*; public class SPARCMacroAssembler extends SPARCAssembler { @@ -103,7 +103,7 @@ } break; default: - throw GraalInternalError.shouldNotReachHere("Unknown op2 " + op2); + throw JVMCIError.shouldNotReachHere("Unknown op2 " + op2); } int newInst = ~maskBits & inst; newInst |= setBits; diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Mon May 25 23:30:34 2015 +0200 @@ -49,7 +49,6 @@ import com.oracle.graal.asm.amd64.AMD64Assembler.ConditionFlag; import com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize; import com.oracle.graal.asm.amd64.AMD64Assembler.SSEOp; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.spi.*; import com.oracle.graal.compiler.common.util.*; @@ -75,6 +74,7 @@ import com.oracle.graal.lir.framemap.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.phases.util.*; +import com.oracle.jvmci.common.*; /** * This class implements the AMD64 specific portion of the LIR generator. @@ -327,7 +327,7 @@ append(new AMD64Unary.MemoryOp(MOVSD, SD, result, loadAddress, state)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } return result; } @@ -371,7 +371,7 @@ imm = Double.doubleToRawLongBits(value.asDouble()); break; default: - throw GraalInternalError.shouldNotReachHere("unexpected kind " + kind); + throw JVMCIError.shouldNotReachHere("unexpected kind " + kind); } if (NumUtil.isInt(imm)) { @@ -406,7 +406,7 @@ append(new AMD64BinaryConsumer.MemoryMROp(AMD64MROp.MOVSD, SD, address, value, state)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -564,7 +564,7 @@ append(new AMD64BinaryConsumer.Op(SSEOp.UCOMIS, PD, left, asAllocatable(right))); return; default: - throw GraalInternalError.shouldNotReachHere("unexpected kind: " + cmpKind); + throw JVMCIError.shouldNotReachHere("unexpected kind: " + cmpKind); } if (isConstant(right)) { @@ -615,7 +615,7 @@ append(new AMD64BinaryConsumer.MemoryRMOp(SSEOp.UCOMIS, PD, asAllocatable(a), b, state)); return false; default: - throw GraalInternalError.shouldNotReachHere("unexpected kind: " + cmpKind); + throw JVMCIError.shouldNotReachHere("unexpected kind: " + cmpKind); } if (isConstant(a)) { @@ -683,7 +683,7 @@ append(new AMD64Binary.DataOp(SSEOp.XOR, PD, result, input, JavaConstant.forDouble(Double.longBitsToDouble(0x8000000000000000L)), 16)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } return result; } @@ -700,7 +700,7 @@ append(new AMD64Unary.MOp(NOT, QWORD, result, input)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } return result; } @@ -763,7 +763,7 @@ case Double: return emitBinary(SSEOp.ADD, SD, true, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -779,7 +779,7 @@ case Double: return emitBinary(SSEOp.SUB, SD, false, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -823,7 +823,7 @@ case Double: return emitBinary(SSEOp.MUL, SD, true, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -846,7 +846,7 @@ case Long: return emitMulHigh(AMD64MOp.IMUL, QWORD, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -858,7 +858,7 @@ case Long: return emitMulHigh(AMD64MOp.MUL, QWORD, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -894,7 +894,7 @@ append(new AMD64Unary.MemoryOp(MOV, QWORD, result, address, state)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } return result; } @@ -925,7 +925,7 @@ op = emitIDIV(QWORD, a, b, state); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } return new Value[]{emitMove(op.getQuotient()), emitMove(op.getRemainder())}; } @@ -944,7 +944,7 @@ case Double: return emitBinary(SSEOp.DIV, SD, false, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -968,7 +968,7 @@ return result; } default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -983,7 +983,7 @@ op = emitDIV(QWORD, a, b, state); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } return emitMove(op.getQuotient()); } @@ -999,7 +999,7 @@ op = emitDIV(QWORD, a, b, state); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } return emitMove(op.getRemainder()); } @@ -1016,7 +1016,7 @@ case Double: return emitBinary(SSEOp.AND, PD, true, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -1032,7 +1032,7 @@ case Double: return emitBinary(SSEOp.OR, PD, true, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -1048,7 +1048,7 @@ case Double: return emitBinary(SSEOp.XOR, PD, true, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -1081,7 +1081,7 @@ case Long: return emitShift(SHL, QWORD, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -1093,7 +1093,7 @@ case Long: return emitShift(SAR, QWORD, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -1105,7 +1105,7 @@ case Long: return emitShift(SHR, QWORD, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -1116,7 +1116,7 @@ case Long: return emitShift(ROL, QWORD, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -1127,7 +1127,7 @@ case Long: return emitShift(ROR, QWORD, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -1182,7 +1182,7 @@ } break; } - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public Value emitFloatConvert(FloatConvert op, Value input) { @@ -1208,7 +1208,7 @@ case L2F: return emitConvertOp(LIRKind.derive(input).changeType(Kind.Float), SSEOp.CVTSI2SS, QWORD, input); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -1237,7 +1237,7 @@ case 32: return emitConvertOp(LIRKind.derive(inputVal).changeType(Kind.Long), MOVSXD, QWORD, inputVal); default: - throw GraalInternalError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)"); + throw JVMCIError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)"); } } else { // sign extend to 32 bits (smaller values are internally represented as 32 bit values) @@ -1249,7 +1249,7 @@ case 32: return inputVal; default: - throw GraalInternalError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)"); + throw JVMCIError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)"); } } } @@ -1380,7 +1380,7 @@ append(new AMD64Binary.DataOp(SSEOp.AND, PD, result, asAllocatable(input), JavaConstant.forDouble(Double.longBitsToDouble(0x7FFFFFFFFFFFFFFFL)), 16)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } return result; } @@ -1396,7 +1396,7 @@ append(new AMD64Unary.RMOp(SSEOp.SQRT, SD, result, asAllocatable(input))); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } return result; } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java --- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java Mon May 25 23:30:34 2015 +0200 @@ -35,7 +35,6 @@ import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64RMOp; import com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize; import com.oracle.graal.asm.amd64.AMD64Assembler.SSEOp; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.compiler.match.*; @@ -48,6 +47,7 @@ import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.memory.*; +import com.oracle.jvmci.common.*; public abstract class AMD64NodeLIRBuilder extends NodeLIRBuilder { @@ -132,7 +132,7 @@ case Double: return OperandSize.SD; default: - throw GraalInternalError.shouldNotReachHere("unsupported memory access type " + getMemoryKind(access)); + throw JVMCIError.shouldNotReachHere("unsupported memory access type " + getMemoryKind(access)); } } @@ -258,7 +258,7 @@ op = MOVSXD; break; default: - throw GraalInternalError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)"); + throw JVMCIError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)"); } } else { kind = Kind.Int; @@ -274,7 +274,7 @@ case 32: return null; default: - throw GraalInternalError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)"); + throw JVMCIError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)"); } } if (kind != null && op != null) { @@ -460,7 +460,7 @@ case L2F: return emitConvertMemoryOp(Kind.Float, SSEOp.CVTSI2SS, QWORD, access); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/Fields.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/Fields.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/Fields.java Mon May 25 23:30:34 2015 +0200 @@ -26,6 +26,8 @@ import java.util.*; +import com.oracle.jvmci.common.*; + import sun.misc.*; /** @@ -209,7 +211,7 @@ } else if (type == Byte.TYPE) { return unsafe.getByte(object, offset); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -308,7 +310,7 @@ } else if (type == Byte.TYPE) { unsafe.putByte(object, offset, (byte) value); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/GraalInternalError.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/GraalInternalError.java Mon May 25 22:30:44 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +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.compiler.common; - -import java.util.*; - -/** - * This error represents a conditions that should never occur during normal operation. - */ -public class GraalInternalError extends Error { - - private static final long serialVersionUID = 531632331813456233L; - private final ArrayList context = new ArrayList<>(); - - public static RuntimeException unimplemented() { - throw new GraalInternalError("unimplemented"); - } - - public static RuntimeException unimplemented(String msg) { - throw new GraalInternalError("unimplemented: %s", msg); - } - - public static RuntimeException shouldNotReachHere() { - throw new GraalInternalError("should not reach here"); - } - - public static RuntimeException shouldNotReachHere(String msg) { - throw new GraalInternalError("should not reach here: %s", msg); - } - - public static RuntimeException shouldNotReachHere(Throwable cause) { - throw new GraalInternalError(cause); - } - - /** - * Checks a given condition and throws a {@link GraalInternalError} if it is false. Guarantees - * are stronger than assertions in that they are always checked. Error messages for guarantee - * violations should clearly indicate the nature of the problem as well as a suggested solution - * if possible. - * - * @param condition the condition to check - * @param msg the message that will be associated with the error, in - * {@link String#format(String, Object...)} syntax - * @param args arguments to the format string - */ - public static void guarantee(boolean condition, String msg, Object... args) { - if (!condition) { - throw new GraalInternalError("failed guarantee: " + msg, args); - } - } - - /** - * This constructor creates a {@link GraalInternalError} with a message assembled via - * {@link String#format(String, Object...)}. It always uses the ENGLISH locale in order to - * always generate the same output. - * - * @param msg the message that will be associated with the error, in String.format syntax - * @param args parameters to String.format - parameters that implement {@link Iterable} will be - * expanded into a [x, x, ...] representation. - */ - public GraalInternalError(String msg, Object... args) { - super(format(msg, args)); - } - - /** - * This constructor creates a {@link GraalInternalError} for a given causing Throwable instance. - * - * @param cause the original exception that contains additional information on this error - */ - public GraalInternalError(Throwable cause) { - super(cause); - } - - /** - * This constructor creates a {@link GraalInternalError} from a given GraalInternalError - * instance. - * - * @param e the original GraalInternalError - */ - public GraalInternalError(GraalInternalError e) { - super(e); - context.addAll(e.context); - } - - @Override - public String toString() { - StringBuilder str = new StringBuilder(); - str.append(super.toString()); - for (String s : context) { - str.append("\n\tat ").append(s); - } - return str.toString(); - } - - private static String format(String msg, Object... args) { - if (args != null) { - // expand Iterable parameters into a list representation - for (int i = 0; i < args.length; i++) { - if (args[i] instanceof Iterable) { - ArrayList list = new ArrayList<>(); - for (Object o : (Iterable) args[i]) { - list.add(o); - } - args[i] = list.toString(); - } - } - } - return String.format(Locale.ENGLISH, msg, args); - } - - public GraalInternalError addContext(String newContext) { - this.context.add(newContext); - return this; - } - - public GraalInternalError addContext(String name, Object obj) { - return addContext(format("%s: %s", name, obj)); - } - -} diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/calc/Condition.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/calc/Condition.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/calc/Condition.java Mon May 25 23:30:34 2015 +0200 @@ -24,7 +24,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; +import com.oracle.jvmci.common.*; /** * Condition codes used in conditionals. @@ -370,7 +370,7 @@ case BT: return UnsignedMath.belowThan(x, y); default: - throw new GraalInternalError("expected condition: %s", this); + throw new JVMCIError("expected condition: %s", this); } } case Long: { @@ -398,7 +398,7 @@ case BT: return UnsignedMath.belowThan(x, y); default: - throw new GraalInternalError("expected condition: %s", this); + throw new JVMCIError("expected condition: %s", this); } } case Float: { @@ -421,7 +421,7 @@ case GE: return x >= y; default: - throw new GraalInternalError("expected condition: %s", this); + throw new JVMCIError("expected condition: %s", this); } } case Double: { @@ -444,16 +444,16 @@ case GE: return x >= y; default: - throw new GraalInternalError("expected condition: %s", this); + throw new JVMCIError("expected condition: %s", this); } } default: - throw new GraalInternalError("expected value kind %s while folding condition: %s", lp.getKind(), this); + throw new JVMCIError("expected value kind %s while folding condition: %s", lp.getKind(), this); } } else { Boolean equal = constantReflection.constantEquals(lt, rt); if (equal == null) { - throw new GraalInternalError("could not fold %s %s %s", lt, this, rt); + throw new JVMCIError("could not fold %s %s %s", lt, this, rt); } switch (this) { case EQ: @@ -461,7 +461,7 @@ case NE: return !equal.booleanValue(); default: - throw new GraalInternalError("expected condition: %s", this); + throw new JVMCIError("expected condition: %s", this); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/calc/FloatConvert.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/calc/FloatConvert.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/calc/FloatConvert.java Mon May 25 23:30:34 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.compiler.common.calc; -import com.oracle.graal.compiler.common.*; +import com.oracle.jvmci.common.*; public enum FloatConvert { F2I, @@ -59,7 +59,7 @@ case L2F: return F2L; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/FloatStamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/FloatStamp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/FloatStamp.java Mon May 25 23:30:34 2015 +0200 @@ -28,11 +28,11 @@ import java.util.function.*; 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.ArithmeticOpTable.BinaryOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.FloatConvertOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.UnaryOp; +import com.oracle.jvmci.common.*; public class FloatStamp extends PrimitiveStamp { @@ -78,7 +78,7 @@ case 64: return JavaConstant.forDouble(buffer.getDouble()); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -109,7 +109,7 @@ case 64: return metaAccess.lookupJavaType(Double.TYPE); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -282,7 +282,7 @@ case Double: return JavaConstant.forDouble(-value.asDouble()); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -306,7 +306,7 @@ case Double: return JavaConstant.forDouble(a.asDouble() + b.asDouble()); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -325,7 +325,7 @@ case Double: return Double.compare(n.asDouble(), -0.0) == 0; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } }, @@ -343,7 +343,7 @@ case Double: return JavaConstant.forDouble(a.asDouble() - b.asDouble()); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -362,7 +362,7 @@ case Double: return Double.compare(n.asDouble(), 0.0) == 0; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } }, @@ -380,7 +380,7 @@ case Double: return JavaConstant.forDouble(a.asDouble() * b.asDouble()); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -399,7 +399,7 @@ case Double: return Double.compare(n.asDouble(), 1.0) == 0; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } }, @@ -417,7 +417,7 @@ case Double: return JavaConstant.forDouble(a.asDouble() / b.asDouble()); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -436,7 +436,7 @@ case Double: return Double.compare(n.asDouble(), 1.0) == 0; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } }, @@ -454,7 +454,7 @@ case Double: return JavaConstant.forDouble(a.asDouble() % b.asDouble()); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -478,7 +478,7 @@ long d = Double.doubleToRawLongBits(value.asDouble()); return JavaConstant.forDouble(Double.longBitsToDouble(~d)); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -505,7 +505,7 @@ long db = Double.doubleToRawLongBits(b.asDouble()); return JavaConstant.forDouble(Double.longBitsToDouble(da & db)); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -523,7 +523,7 @@ case Double: return Double.doubleToRawLongBits(value.asDouble()) == 0xFFFFFFFFFFFFFFFFL; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } }, @@ -545,7 +545,7 @@ long db = Double.doubleToRawLongBits(b.asDouble()); return JavaConstant.forDouble(Double.longBitsToDouble(da | db)); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -563,7 +563,7 @@ case Double: return Double.doubleToRawLongBits(value.asDouble()) == 0L; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } }, @@ -585,7 +585,7 @@ long db = Double.doubleToRawLongBits(b.asDouble()); return JavaConstant.forDouble(Double.longBitsToDouble(da ^ db)); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -603,7 +603,7 @@ case Double: return Double.doubleToRawLongBits(value.asDouble()) == 0L; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } }, @@ -621,7 +621,7 @@ case Double: return JavaConstant.forDouble(Math.abs(value.asDouble())); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -646,7 +646,7 @@ case Double: return JavaConstant.forDouble(Math.sqrt(value.asDouble())); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java Mon May 25 23:30:34 2015 +0200 @@ -23,8 +23,8 @@ package com.oracle.graal.compiler.common.type; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.spi.*; +import com.oracle.jvmci.common.*; /** * This stamp represents the type of the {@link Kind#Illegal} value in the second slot of @@ -43,7 +43,7 @@ @Override public LIRKind getLIRKind(LIRKindTool tool) { - throw GraalInternalError.shouldNotReachHere("illegal stamp should not reach backend"); + throw JVMCIError.shouldNotReachHere("illegal stamp should not reach backend"); } @Override @@ -64,7 +64,7 @@ @Override public ResolvedJavaType javaType(MetaAccessProvider metaAccess) { - throw GraalInternalError.shouldNotReachHere("illegal stamp has no Java type"); + throw JVMCIError.shouldNotReachHere("illegal stamp has no Java type"); } @Override @@ -102,7 +102,7 @@ @Override public Constant readConstant(MemoryAccessProvider provider, Constant base, long displacement) { - throw GraalInternalError.shouldNotReachHere("can't read values of illegal stamp"); + throw JVMCIError.shouldNotReachHere("can't read values of illegal stamp"); } private static final IllegalStamp instance = new IllegalStamp(); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IntegerStamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IntegerStamp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IntegerStamp.java Mon May 25 23:30:34 2015 +0200 @@ -29,13 +29,13 @@ import com.oracle.graal.api.code.*; 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.ArithmeticOpTable.BinaryOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.FloatConvertOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.IntegerConvertOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.ShiftOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.UnaryOp; +import com.oracle.jvmci.common.*; /** * Describes the possible values of a node that produces an int or long result. @@ -113,7 +113,7 @@ case 64: return JavaConstant.forLong(buffer.getLong()); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -150,7 +150,7 @@ case 64: return metaAccess.lookupJavaType(Long.TYPE); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -703,7 +703,7 @@ case Long: return JavaConstant.forLong(c.asLong() << amount); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -763,7 +763,7 @@ case Long: return JavaConstant.forLong(c.asLong() >> amount); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -807,7 +807,7 @@ case Long: return JavaConstant.forLong(c.asLong() >>> amount); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/StampFactory.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/StampFactory.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/StampFactory.java Mon May 25 23:30:34 2015 +0200 @@ -24,7 +24,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; +import com.oracle.jvmci.common.*; public class StampFactory { @@ -196,7 +196,7 @@ return objectNonNull(); } default: - throw new GraalInternalError("unexpected kind: %s", kind); + throw new JVMCIError("unexpected kind: %s", kind); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java Mon May 25 23:30:34 2015 +0200 @@ -23,8 +23,8 @@ package com.oracle.graal.compiler.common.type; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.spi.*; +import com.oracle.jvmci.common.*; /** * Singleton stamp representing the value of type {@code void}. @@ -52,7 +52,7 @@ @Override public LIRKind getLIRKind(LIRKindTool tool) { - throw GraalInternalError.shouldNotReachHere("void stamp has no value"); + throw JVMCIError.shouldNotReachHere("void stamp has no value"); } @Override @@ -100,12 +100,12 @@ @Override public Constant readConstant(MemoryAccessProvider provider, Constant base, long displacement) { - throw GraalInternalError.shouldNotReachHere("can't read values of void stamp"); + throw JVMCIError.shouldNotReachHere("can't read values of void stamp"); } @Override public Stamp constant(Constant c, MetaAccessProvider meta) { - throw GraalInternalError.shouldNotReachHere("void stamp has no value"); + throw JVMCIError.shouldNotReachHere("void stamp has no value"); } private static final VoidStamp instance = new VoidStamp(); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler.match.processor/src/com/oracle/graal/compiler/match/processor/MatchProcessor.java --- a/graal/com.oracle.graal.compiler.match.processor/src/com/oracle/graal/compiler/match/processor/MatchProcessor.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.match.processor/src/com/oracle/graal/compiler/match/processor/MatchProcessor.java Mon May 25 23:30:34 2015 +0200 @@ -34,11 +34,11 @@ import javax.tools.Diagnostic.Kind; import javax.tools.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.compiler.match.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.common.*; /** * Processes classes annotated with {@link MatchRule}. A {@link MatchStatementSet} service is @@ -360,7 +360,7 @@ if (p != null) { return p.getQualifiedName().toString(); } - throw new GraalInternalError("can't find package for %s", type); + throw new JVMCIError("can't find package for %s", type); } class MatchDescriptor { @@ -755,7 +755,7 @@ } } - private void processMatchableNode(Element element, TypeElement topDeclaringType, MatchableNode matchable, AnnotationMirror mirror) throws GraalInternalError { + private void processMatchableNode(Element element, TypeElement topDeclaringType, MatchableNode matchable, AnnotationMirror mirror) throws JVMCIError { logMessage("processMatchableNode %s %s %s\n", topDeclaringType, element, matchable); String nodeClass; String nodePackage; @@ -766,7 +766,7 @@ nodeClassMirror = e.getTypeMirror(); } if (nodeClassMirror == null) { - throw new GraalInternalError("Can't get mirror for node class %s", element); + throw new JVMCIError("Can't get mirror for node class %s", element); } if (nodeClassMirror.toString().equals(MatchableNode.class.getName())) { nodeClass = topDeclaringType.getQualifiedName().toString(); diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Mon May 25 23:30:34 2015 +0200 @@ -34,7 +34,6 @@ import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCAssembler.CC; import com.oracle.graal.asm.sparc.SPARCAssembler.ConditionFlag; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.spi.*; import com.oracle.graal.lir.*; @@ -52,10 +51,20 @@ import com.oracle.graal.lir.sparc.SPARCControlFlow.ReturnOp; import com.oracle.graal.lir.sparc.SPARCControlFlow.StrategySwitchOp; import com.oracle.graal.lir.sparc.SPARCControlFlow.TableSwitchOp; -import com.oracle.graal.lir.sparc.SPARCMove.*; +import com.oracle.graal.lir.sparc.SPARCMove.LoadAddressOp; +import com.oracle.graal.lir.sparc.SPARCMove.LoadDataAddressOp; +import com.oracle.graal.lir.sparc.SPARCMove.LoadOp; +import com.oracle.graal.lir.sparc.SPARCMove.MembarOp; +import com.oracle.graal.lir.sparc.SPARCMove.MoveFpGp; +import com.oracle.graal.lir.sparc.SPARCMove.MoveFpGpVIS3; +import com.oracle.graal.lir.sparc.SPARCMove.MoveFromRegOp; +import com.oracle.graal.lir.sparc.SPARCMove.MoveToRegOp; +import com.oracle.graal.lir.sparc.SPARCMove.SPARCStackMove; +import com.oracle.graal.lir.sparc.SPARCMove.StackLoadAddressOp; import com.oracle.graal.phases.util.*; import com.oracle.graal.sparc.*; import com.oracle.graal.sparc.SPARC.CPUFeature; +import com.oracle.jvmci.common.*; /** * This class implements the SPARC specific portion of the LIR generator. @@ -270,7 +279,7 @@ opcode = DCMP; break; default: - throw GraalInternalError.shouldNotReachHere(actualCmpKind.toString()); + throw JVMCIError.shouldNotReachHere(actualCmpKind.toString()); } append(new SPARCControlFlow.CompareBranchOp(opcode, left, right, actualCondition, trueDestination, falseDestination, actualCmpKind, unorderedIsTrue, trueDestinationProbability)); } @@ -334,7 +343,7 @@ actualFalseValue = load(falseValue); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } Variable result = newVariable(trueValue.getLIRKind()); ConditionFlag finalCondition = ConditionFlag.fromCondtition(conditionFlags, mirrored ? cond.mirror() : cond, unorderedIsTrue); @@ -388,7 +397,7 @@ append(new CompareOp(DCMP, left, right)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } return mirrored; } @@ -411,7 +420,7 @@ conditionCode = CC.Icc; break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } ConditionFlag flag = ConditionFlag.fromCondtition(conditionCode, Condition.EQ, false); append(new CondMoveOp(result, conditionCode, flag, loadSimm11(trueValue), loadSimm11(falseValue))); @@ -511,7 +520,7 @@ case Double: return emitUnary(DNEG, input); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -523,7 +532,7 @@ case Long: return emitUnary(LNOT, input); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -589,7 +598,7 @@ case Double: return emitBinary(DADD, true, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -605,7 +614,7 @@ case Double: return emitBinary(DSUB, false, a, b); default: - throw GraalInternalError.shouldNotReachHere("missing: " + a.getKind()); + throw JVMCIError.shouldNotReachHere("missing: " + a.getKind()); } } @@ -627,7 +636,7 @@ case Double: return emitBinary(DMUL, true, a, b); default: - throw GraalInternalError.shouldNotReachHere("missing: " + a.getKind()); + throw JVMCIError.shouldNotReachHere("missing: " + a.getKind()); } } @@ -639,7 +648,7 @@ case Long: return emitMulHigh(LMUL, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -651,7 +660,7 @@ case Long: return emitMulHigh(LUMUL, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -674,7 +683,7 @@ case Double: return emitBinary(DDIV, false, a, b, state); default: - throw GraalInternalError.shouldNotReachHere("missing: " + a.getKind()); + throw JVMCIError.shouldNotReachHere("missing: " + a.getKind()); } } @@ -706,7 +715,7 @@ append(new BinaryRegReg(DSUB, result, a, q)); break; default: - throw GraalInternalError.shouldNotReachHere("missing: " + a.getKind()); + throw JVMCIError.shouldNotReachHere("missing: " + a.getKind()); } return result; } @@ -722,7 +731,7 @@ append(new RemOp(LUREM, result, load(a), loadNonConst(b), state, this)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } return result; @@ -743,7 +752,7 @@ op = LUDIV; break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } return emitBinary(op, false, actualA, actualB, state); } @@ -757,7 +766,7 @@ return emitBinary(LAND, true, a, b); default: - throw GraalInternalError.shouldNotReachHere("missing: " + a.getKind()); + throw JVMCIError.shouldNotReachHere("missing: " + a.getKind()); } } @@ -769,7 +778,7 @@ case Long: return emitBinary(LOR, true, a, b); default: - throw GraalInternalError.shouldNotReachHere("missing: " + a.getKind()); + throw JVMCIError.shouldNotReachHere("missing: " + a.getKind()); } } @@ -781,7 +790,7 @@ case Long: return emitBinary(LXOR, true, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -803,7 +812,7 @@ case Long: return emitShift(LSHL, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -815,7 +824,7 @@ case Long: return emitShift(LSHR, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -827,7 +836,7 @@ case Long: return emitShift(LUSHR, a, b); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -907,7 +916,7 @@ return convertedFloatReg; } default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -955,7 +964,7 @@ case 32: return emitConvert2Op(LIRKind.derive(inputVal).changeType(Kind.Long), I2L, asAllocatable(inputVal)); default: - throw GraalInternalError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)"); + throw JVMCIError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)"); } } else { // sign extend to 32 bits (smaller values are internally represented as 32 bit values) @@ -967,7 +976,7 @@ case 32: return inputVal; default: - throw GraalInternalError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)"); + throw JVMCIError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)"); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCNodeLIRBuilder.java --- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCNodeLIRBuilder.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCNodeLIRBuilder.java Mon May 25 23:30:34 2015 +0200 @@ -25,7 +25,6 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.compiler.match.*; import com.oracle.graal.lir.*; @@ -35,6 +34,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.memory.*; +import com.oracle.jvmci.common.*; /** * This class implements the SPARC specific portion of the LIR generator. @@ -99,7 +99,7 @@ fromKind = Kind.Int; break; default: - throw GraalInternalError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)"); + throw JVMCIError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)"); } Kind localFromKind = fromKind; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConcreteSubtypeTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConcreteSubtypeTest.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConcreteSubtypeTest.java Mon May 25 23:30:34 2015 +0200 @@ -24,7 +24,8 @@ import org.junit.*; -import com.oracle.graal.api.meta.Assumptions.*; +import com.oracle.graal.api.meta.Assumptions.Assumption; +import com.oracle.graal.api.meta.Assumptions.ConcreteSubtype; import com.oracle.graal.nodes.*; /** diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FindUniqueConcreteMethodBugTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FindUniqueConcreteMethodBugTest.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FindUniqueConcreteMethodBugTest.java Mon May 25 23:30:34 2015 +0200 @@ -24,8 +24,8 @@ import org.junit.*; +import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; public class FindUniqueConcreteMethodBugTest extends GraalCompilerTest { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Mon May 25 23:30:34 2015 +0200 @@ -43,7 +43,6 @@ import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.*; import com.oracle.graal.compiler.GraalCompiler.Request; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.target.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; @@ -70,6 +69,7 @@ import com.oracle.graal.printer.*; import com.oracle.graal.runtime.*; import com.oracle.graal.test.*; +import com.oracle.jvmci.common.*; /** * Base class for Graal compiler unit tests. @@ -677,7 +677,7 @@ try (Scope s = Debug.scope("CodeInstall", getCodeCache(), installedCodeOwner)) { installedCode = addMethod(installedCodeOwner, compResult); if (installedCode == null) { - throw new GraalInternalError("Could not install code for " + installedCodeOwner.format("%H.%n(%p)")); + throw new JVMCIError("Could not install code for " + installedCodeOwner.format("%H.%n(%p)")); } } catch (Throwable e) { throw Debug.handle(e); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/StaticAnalysis.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/StaticAnalysis.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/StaticAnalysis.java Mon May 25 23:30:34 2015 +0200 @@ -25,12 +25,11 @@ import java.util.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; import com.oracle.graal.graph.*; import com.oracle.graal.graphbuilderconf.*; -import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.*; +import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; import com.oracle.graal.java.*; import com.oracle.graal.nodes.CallTargetNode.InvokeKind; import com.oracle.graal.nodes.*; @@ -40,6 +39,7 @@ import com.oracle.graal.nodes.util.*; import com.oracle.graal.phases.*; import com.oracle.graal.phases.graph.*; +import com.oracle.jvmci.common.*; /** * A simple context-insensitive static analysis based on the Graal API. It is intended for @@ -108,7 +108,7 @@ } protected static RuntimeException error(String msg) { - throw GraalInternalError.shouldNotReachHere(msg); + throw JVMCIError.shouldNotReachHere(msg); } /** diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Mon May 25 23:30:34 2015 +0200 @@ -52,7 +52,7 @@ import com.oracle.graal.nodes.cfg.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.options.*; -import com.oracle.graal.options.OptionValue.*; +import com.oracle.graal.options.OptionValue.OverrideScope; import com.oracle.graal.phases.*; import com.oracle.graal.phases.common.*; import com.oracle.graal.phases.schedule.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java Mon May 25 23:30:34 2015 +0200 @@ -27,7 +27,6 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; import com.oracle.graal.lir.*; @@ -35,6 +34,7 @@ import com.oracle.graal.nodes.util.*; import com.oracle.graal.nodes.virtual.*; import com.oracle.graal.virtual.nodes.*; +import com.oracle.jvmci.common.*; /** * Builds {@link LIRFrameState}s from {@link FrameState}s. @@ -145,7 +145,7 @@ caller = computeFrameForState(state.outerFrameState()); } return new BytecodeFrame(caller, state.method(), state.bci, state.rethrowException(), state.duringCall(), values, numLocals, numStack, numLocks); - } catch (GraalInternalError e) { + } catch (JVMCIError e) { throw e.addContext("FrameState: ", state); } } @@ -192,7 +192,7 @@ EscapeObjectState state = objectStates.get(obj); if (state == null && obj.entryCount() > 0) { // null states occur for objects with 0 fields - throw new GraalInternalError("no mapping found for virtual object %s", obj); + throw new JVMCIError("no mapping found for virtual object %s", obj); } if (state instanceof MaterializedObjectState) { return toValue(((MaterializedObjectState) state).materializedValue()); @@ -225,7 +225,7 @@ return Value.ILLEGAL; } } - } catch (GraalInternalError e) { + } catch (JVMCIError e) { throw e.addContext("toValue: ", value); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java Mon May 25 23:30:34 2015 +0200 @@ -32,7 +32,6 @@ 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.common.type.*; @@ -54,6 +53,7 @@ import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.virtual.*; +import com.oracle.jvmci.common.*; /** * This class traverses the HIR instructions and generates LIR instructions from them. @@ -296,10 +296,10 @@ if (!peephole(valueNode)) { try { doRoot(valueNode); - } catch (GraalInternalError e) { - throw GraalGraphInternalError.transformAndAddContext(e, valueNode); + } catch (JVMCIError e) { + throw GraalGraphJVMCIError.transformAndAddContext(e, valueNode); } catch (Throwable e) { - throw new GraalGraphInternalError(e).addContext(valueNode); + throw new GraalGraphJVMCIError(e).addContext(valueNode); } } } else if (ComplexMatchValue.INTERIOR_MATCH.equals(operand)) { @@ -327,7 +327,7 @@ * If we have more than one successor, we cannot just use the first one. Since * successors are unordered, this would be a random choice. */ - throw new GraalInternalError("Block without BlockEndOp: " + block.getEndNode()); + throw new JVMCIError("Block without BlockEndOp: " + block.getEndNode()); } gen.emitJump(getLIRBlock((FixedNode) successors.first())); } @@ -389,7 +389,7 @@ } else if (node instanceof ArithmeticLIRLowerable) { ((ArithmeticLIRLowerable) node).generate(this, gen); } else { - throw GraalInternalError.shouldNotReachHere("node is not LIRLowerable: " + node); + throw JVMCIError.shouldNotReachHere("node is not LIRLowerable: " + node); } } @@ -488,7 +488,7 @@ } else if (node instanceof IntegerTestNode) { emitIntegerTestBranch((IntegerTestNode) node, trueSuccessor, falseSuccessor, trueSuccessorProbability); } else { - throw GraalInternalError.unimplemented(node.toString()); + throw JVMCIError.unimplemented(node.toString()); } } @@ -533,7 +533,7 @@ IntegerTestNode test = (IntegerTestNode) node; return gen.emitIntegerTestMove(operand(test.getX()), operand(test.getY()), trueValue, falseValue); } else { - throw GraalInternalError.unimplemented(node.toString()); + throw JVMCIError.unimplemented(node.toString()); } } @@ -558,7 +558,7 @@ } else if (callTarget instanceof IndirectCallTargetNode) { emitIndirectCall((IndirectCallTargetNode) callTarget, result, parameters, AllocatableValue.NONE, callState); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } if (isLegal(result)) { @@ -586,7 +586,7 @@ result[j] = operand; j++; } else { - throw GraalInternalError.shouldNotReachHere("I thought we no longer have null entries for two-slot types..."); + throw JVMCIError.shouldNotReachHere("I thought we no longer have null entries for two-slot types..."); } } return result; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchContext.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchContext.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchContext.java Mon May 25 23:30:34 2015 +0200 @@ -26,13 +26,13 @@ import java.util.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.compiler.match.MatchPattern.Result; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.virtual.*; +import com.oracle.jvmci.common.*; /** * Container for state captured during a match. @@ -172,7 +172,7 @@ * * @param name the name of a node in the match rule * @return the matched node - * @throws GraalInternalError is the named node doesn't exist. + * @throws JVMCIError is the named node doesn't exist. */ public Node namedNode(String name) { if (namedNodes != null) { @@ -181,7 +181,7 @@ return value.value; } } - throw new GraalInternalError("missing node %s", name); + throw new JVMCIError("missing node %s", name); } @Override diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchRuleRegistry.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchRuleRegistry.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchRuleRegistry.java Mon May 25 23:30:34 2015 +0200 @@ -27,11 +27,11 @@ import java.util.*; import java.util.Map.Entry; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; import com.oracle.graal.graph.*; +import com.oracle.jvmci.common.*; import com.oracle.jvmci.runtime.*; public class MatchRuleRegistry { @@ -55,7 +55,7 @@ } } if (result[i] == null) { - throw new GraalInternalError("unknown field \"%s\" in class %s", names[i], nodeClass); + throw new JVMCIError("unknown field \"%s\" in class %s", names[i], nodeClass); } } return result; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchStatement.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchStatement.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchStatement.java Mon May 25 23:30:34 2015 +0200 @@ -124,7 +124,7 @@ } else { result[i] = context.namedNode(arguments[i]); if (result[i] == null) { - throw new GraalGraphInternalError("Can't find named node %s", arguments[i]); + throw new GraalGraphJVMCIError("Can't find named node %s", arguments[i]); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java Mon May 25 23:30:34 2015 +0200 @@ -26,7 +26,6 @@ import com.oracle.graal.api.code.stack.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; @@ -36,6 +35,7 @@ import com.oracle.graal.nodes.spi.*; import com.oracle.graal.phases.tiers.*; import com.oracle.graal.phases.util.*; +import com.oracle.jvmci.common.*; /** * Represents a compiler backend for Graal. @@ -103,7 +103,7 @@ * @param parser the bytecode parser the BytecodeLIRBuilder should use */ public BytecodeLIRBuilder newBytecodeLIRBuilder(LIRGeneratorTool gen, BytecodeParserTool parser) { - throw GraalInternalError.unimplemented("Baseline compilation is not available for this Backend!"); + throw JVMCIError.unimplemented("Baseline compilation is not available for this Backend!"); } /** diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/GraalGraphInternalError.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/GraalGraphInternalError.java Mon May 25 22:30:44 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +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.graph; - -import com.oracle.graal.compiler.common.*; - -/** - * This error is the graph/node aware extension of GraalInternalError. - */ -public class GraalGraphInternalError extends GraalInternalError { - - private static final long serialVersionUID = -989290015525497919L; - private Node node; - private Graph graph; - - /** - * This constructor creates a {@link GraalGraphInternalError} with a message assembled via - * {@link String#format(String, Object...)}. It always uses the ENGLISH locale in order to - * always generate the same output. - * - * @param msg the message that will be associated with the error, in String.format syntax - * @param args parameters to String.format - parameters that implement {@link Iterable} will be - * expanded into a [x, x, ...] representation. - */ - public GraalGraphInternalError(String msg, Object... args) { - super(msg, args); - } - - /** - * This constructor creates a {@link GraalGraphInternalError} for a given causing Throwable - * instance. - * - * @param cause the original exception that contains additional information on this error - */ - public GraalGraphInternalError(Throwable cause) { - super(cause); - } - - /** - * This constructor creates a {@link GraalGraphInternalError} from a given GraalInternalError - * instance. - * - * @param e the original GraalInternalError - */ - protected GraalGraphInternalError(GraalInternalError e) { - super(e); - if (e instanceof GraalGraphInternalError) { - node = ((GraalGraphInternalError) e).node; - graph = ((GraalGraphInternalError) e).graph; - } - } - - /** - * Adds a graph to the context of this VerificationError. The first graph added via this method - * will be returned by {@link #graph()}. - * - * @param newGraph the graph which is in a incorrect state, if the verification error was not - * caused by a specific node - */ - GraalGraphInternalError addContext(Graph newGraph) { - if (newGraph != this.graph) { - addContext("graph", newGraph); - if (this.graph == null) { - this.graph = newGraph; - } - } - return this; - } - - /** - * Adds a node to the context of this VerificationError. The first node added via this method - * will be returned by {@link #node()}. - * - * @param newNode the node which is in a incorrect state, if the verification error was caused - * by a node - */ - public GraalGraphInternalError addContext(Node newNode) { - if (newNode != this.node) { - addContext("node", newNode); - if (this.node == null) { - this.node = newNode; - } - } - return this; - } - - /** - * Transform a GraalInternalError into a GraalGraphInternalError and add a graph to the context. - * - * @param e the previous error - * @param newGraph the graph which is in a incorrect state, if the verification error was not - * caused by a specific node - */ - public static GraalGraphInternalError transformAndAddContext(GraalInternalError e, Graph newGraph) { - GraalGraphInternalError graphError; - if (e instanceof GraalGraphInternalError) { - graphError = (GraalGraphInternalError) e; - } else { - graphError = new GraalGraphInternalError(e); - } - return graphError.addContext(newGraph); - } - - /** - * Transform a GraalInternalError into a GraalGraphInternalError and add a node to the context. - * - * @param e the previous error - * @param newNode the node which is in a incorrect state, if the verification error was caused - * by a node - */ - public static GraalGraphInternalError transformAndAddContext(GraalInternalError e, Node newNode) { - GraalGraphInternalError graphError; - if (e instanceof GraalGraphInternalError) { - graphError = (GraalGraphInternalError) e; - } else { - graphError = new GraalGraphInternalError(e); - } - return graphError.addContext(newNode); - } - - public Node node() { - return node; - } - - public Graph graph() { - return graph; - } -} diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/GraalGraphJVMCIError.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/GraalGraphJVMCIError.java Mon May 25 23:30:34 2015 +0200 @@ -0,0 +1,148 @@ +/* + * 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.graph; + +import com.oracle.jvmci.common.*; + +/** + * This error is the graph/node aware extension of JVMCIError. + */ +public class GraalGraphJVMCIError extends JVMCIError { + + private static final long serialVersionUID = -989290015525497919L; + private Node node; + private Graph graph; + + /** + * This constructor creates a {@link GraalGraphJVMCIError} with a message assembled via + * {@link String#format(String, Object...)}. It always uses the ENGLISH locale in order to + * always generate the same output. + * + * @param msg the message that will be associated with the error, in String.format syntax + * @param args parameters to String.format - parameters that implement {@link Iterable} will be + * expanded into a [x, x, ...] representation. + */ + public GraalGraphJVMCIError(String msg, Object... args) { + super(msg, args); + } + + /** + * This constructor creates a {@link GraalGraphJVMCIError} for a given causing Throwable + * instance. + * + * @param cause the original exception that contains additional information on this error + */ + public GraalGraphJVMCIError(Throwable cause) { + super(cause); + } + + /** + * This constructor creates a {@link GraalGraphJVMCIError} from a given JVMCIError + * instance. + * + * @param e the original JVMCIError + */ + protected GraalGraphJVMCIError(JVMCIError e) { + super(e); + if (e instanceof GraalGraphJVMCIError) { + node = ((GraalGraphJVMCIError) e).node; + graph = ((GraalGraphJVMCIError) e).graph; + } + } + + /** + * Adds a graph to the context of this VerificationError. The first graph added via this method + * will be returned by {@link #graph()}. + * + * @param newGraph the graph which is in a incorrect state, if the verification error was not + * caused by a specific node + */ + GraalGraphJVMCIError addContext(Graph newGraph) { + if (newGraph != this.graph) { + addContext("graph", newGraph); + if (this.graph == null) { + this.graph = newGraph; + } + } + return this; + } + + /** + * Adds a node to the context of this VerificationError. The first node added via this method + * will be returned by {@link #node()}. + * + * @param newNode the node which is in a incorrect state, if the verification error was caused + * by a node + */ + public GraalGraphJVMCIError addContext(Node newNode) { + if (newNode != this.node) { + addContext("node", newNode); + if (this.node == null) { + this.node = newNode; + } + } + return this; + } + + /** + * Transform a JVMCIError into a GraalGraphInternalError and add a graph to the context. + * + * @param e the previous error + * @param newGraph the graph which is in a incorrect state, if the verification error was not + * caused by a specific node + */ + public static GraalGraphJVMCIError transformAndAddContext(JVMCIError e, Graph newGraph) { + GraalGraphJVMCIError graphError; + if (e instanceof GraalGraphJVMCIError) { + graphError = (GraalGraphJVMCIError) e; + } else { + graphError = new GraalGraphJVMCIError(e); + } + return graphError.addContext(newGraph); + } + + /** + * Transform a JVMCIError into a GraalGraphInternalError and add a node to the context. + * + * @param e the previous error + * @param newNode the node which is in a incorrect state, if the verification error was caused + * by a node + */ + public static GraalGraphJVMCIError transformAndAddContext(JVMCIError e, Node newNode) { + GraalGraphJVMCIError graphError; + if (e instanceof GraalGraphJVMCIError) { + graphError = (GraalGraphJVMCIError) e; + } else { + graphError = new GraalGraphJVMCIError(e); + } + return graphError.addContext(newNode); + } + + public Node node() { + return node; + } + + public Graph graph() { + return graph; + } +} diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java Mon May 25 23:30:34 2015 +0200 @@ -32,6 +32,7 @@ import com.oracle.graal.graph.Node.ValueNumberable; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.options.*; +import com.oracle.jvmci.common.*; /** * This class is a graph container, it contains the set of nodes that belong to this graph. @@ -906,12 +907,12 @@ try { assert node.verify(); } catch (AssertionError t) { - throw new GraalInternalError(t); + throw new JVMCIError(t); } catch (RuntimeException t) { - throw new GraalInternalError(t); + throw new JVMCIError(t); } - } catch (GraalInternalError e) { - throw GraalGraphInternalError.transformAndAddContext(e, node).addContext(this); + } catch (JVMCIError e) { + throw GraalGraphJVMCIError.transformAndAddContext(e, node).addContext(this); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java Mon May 25 23:30:34 2015 +0200 @@ -35,6 +35,7 @@ import com.oracle.graal.debug.*; import com.oracle.graal.graph.Graph.NodeEvent; import com.oracle.graal.graph.Graph.NodeEventListener; +import com.oracle.graal.graph.Graph.Options; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; @@ -829,7 +830,7 @@ copyOrClearEdgesForClone(newNode, Successors, edgesToCopy); } } catch (Exception e) { - throw new GraalGraphInternalError(e).addContext(this); + throw new GraalGraphJVMCIError(e).addContext(this); } newNode.graph = into; newNode.id = INITIAL_ID; @@ -918,7 +919,7 @@ } } - protected VerificationError fail(String message, Object... args) throws GraalGraphInternalError { + protected VerificationError fail(String message, Object... args) throws GraalGraphJVMCIError { throw new VerificationError(message, args).addContext(this); } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeClass.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeClass.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeClass.java Mon May 25 23:30:34 2015 +0200 @@ -23,10 +23,10 @@ package com.oracle.graal.graph; import static com.oracle.graal.compiler.common.Fields.*; -import static com.oracle.graal.compiler.common.GraalInternalError.*; import static com.oracle.graal.graph.Edges.*; import static com.oracle.graal.graph.InputEdges.*; import static com.oracle.graal.graph.Node.*; +import static com.oracle.jvmci.common.JVMCIError.*; import java.lang.annotation.*; import java.lang.reflect.*; @@ -367,11 +367,11 @@ if (INPUT_LIST_CLASS.isAssignableFrom(type)) { // NodeInputList fields should not be final since they are // written (via Unsafe) in clearInputs() - GraalInternalError.guarantee(!Modifier.isFinal(modifiers), "NodeInputList input field %s should not be final", field); - GraalInternalError.guarantee(!Modifier.isPublic(modifiers), "NodeInputList input field %s should not be public", field); + JVMCIError.guarantee(!Modifier.isFinal(modifiers), "NodeInputList input field %s should not be final", field); + JVMCIError.guarantee(!Modifier.isPublic(modifiers), "NodeInputList input field %s should not be public", field); } else { - GraalInternalError.guarantee(NODE_CLASS.isAssignableFrom(type) || type.isInterface(), "invalid input type: %s", type); - GraalInternalError.guarantee(!Modifier.isFinal(modifiers), "Node input field %s should not be final", field); + JVMCIError.guarantee(NODE_CLASS.isAssignableFrom(type) || type.isInterface(), "invalid input type: %s", type); + JVMCIError.guarantee(!Modifier.isFinal(modifiers), "Node input field %s should not be final", field); directInputs++; } InputType inputType; @@ -386,18 +386,18 @@ if (SUCCESSOR_LIST_CLASS.isAssignableFrom(type)) { // NodeSuccessorList fields should not be final since they are // written (via Unsafe) in clearSuccessors() - GraalInternalError.guarantee(!Modifier.isFinal(modifiers), "NodeSuccessorList successor field % should not be final", field); - GraalInternalError.guarantee(!Modifier.isPublic(modifiers), "NodeSuccessorList successor field %s should not be public", field); + JVMCIError.guarantee(!Modifier.isFinal(modifiers), "NodeSuccessorList successor field % should not be final", field); + JVMCIError.guarantee(!Modifier.isPublic(modifiers), "NodeSuccessorList successor field %s should not be public", field); } else { - GraalInternalError.guarantee(NODE_CLASS.isAssignableFrom(type), "invalid successor type: %s", type); - GraalInternalError.guarantee(!Modifier.isFinal(modifiers), "Node successor field %s should not be final", field); + JVMCIError.guarantee(NODE_CLASS.isAssignableFrom(type), "invalid successor type: %s", type); + JVMCIError.guarantee(!Modifier.isFinal(modifiers), "Node successor field %s should not be final", field); directSuccessors++; } successors.add(new EdgeInfo(offset, field.getName(), type, field.getDeclaringClass())); } else { - GraalInternalError.guarantee(!NODE_CLASS.isAssignableFrom(type) || field.getName().equals("Null"), "suspicious node field: %s", field); - GraalInternalError.guarantee(!INPUT_LIST_CLASS.isAssignableFrom(type), "suspicious node input list field: %s", field); - GraalInternalError.guarantee(!SUCCESSOR_LIST_CLASS.isAssignableFrom(type), "suspicious node successor list field: %s", field); + JVMCIError.guarantee(!NODE_CLASS.isAssignableFrom(type) || field.getName().equals("Null"), "suspicious node field: %s", field); + JVMCIError.guarantee(!INPUT_LIST_CLASS.isAssignableFrom(type), "suspicious node input list field: %s", field); + JVMCIError.guarantee(!SUCCESSOR_LIST_CLASS.isAssignableFrom(type), "suspicious node successor list field: %s", field); super.scanField(field, offset); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeInputList.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeInputList.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeInputList.java Mon May 25 23:30:34 2015 +0200 @@ -26,7 +26,7 @@ import java.util.*; -import com.oracle.graal.graph.Edges.*; +import com.oracle.graal.graph.Edges.Type; public final class NodeInputList extends NodeList { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeSuccessorList.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeSuccessorList.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeSuccessorList.java Mon May 25 23:30:34 2015 +0200 @@ -26,7 +26,7 @@ import java.util.*; -import com.oracle.graal.graph.Edges.*; +import com.oracle.graal.graph.Edges.Type; public final class NodeSuccessorList extends NodeList { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/VerificationError.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/VerificationError.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/VerificationError.java Mon May 25 23:30:34 2015 +0200 @@ -26,7 +26,7 @@ * This error represents a failed verification of a node . It must only be used for conditions that * should never occur during normal operation. */ -public class VerificationError extends GraalGraphInternalError { +public class VerificationError extends GraalGraphJVMCIError { private static final long serialVersionUID = 8459607567446819822L; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/NodePredicate.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/NodePredicate.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/NodePredicate.java Mon May 25 23:30:34 2015 +0200 @@ -23,7 +23,9 @@ package com.oracle.graal.graph.iterators; import com.oracle.graal.graph.*; -import com.oracle.graal.graph.iterators.NodePredicates.*; +import com.oracle.graal.graph.iterators.NodePredicates.AndPredicate; +import com.oracle.graal.graph.iterators.NodePredicates.NotPredicate; +import com.oracle.graal.graph.iterators.NodePredicates.OrPredicate; public interface NodePredicate { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugin.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugin.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugin.java Mon May 25 23:30:34 2015 +0200 @@ -26,9 +26,9 @@ import java.lang.reflect.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graphbuilderconf.MethodIdMap.Receiver; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.common.*; /** * Plugin for handling a specific method invocation. @@ -165,7 +165,7 @@ * Handles an invocation when a specific {@code apply} method is not available. */ default boolean defaultHandler(@SuppressWarnings("unused") GraphBuilderContext b, ResolvedJavaMethod targetMethod, @SuppressWarnings("unused") Receiver receiver, ValueNode... args) { - throw new GraalInternalError("Invocation plugin for %s does not handle invocations with %d arguments", targetMethod.format("%H.%n(%p)"), args.length); + throw new JVMCIError("Invocation plugin for %s does not handle invocations with %d arguments", targetMethod.format("%H.%n(%p)"), args.length); } default StackTraceElement getApplySourceLocation(MetaAccessProvider metaAccess) { @@ -177,6 +177,6 @@ return metaAccess.lookupJavaMethod(m).asStackTraceElement(0); } } - throw new GraalInternalError("could not find method named \"apply\" or \"defaultHandler\" in " + c.getName()); + throw new JVMCIError("could not find method named \"apply\" or \"defaultHandler\" in " + c.getName()); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/MethodIdMap.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/MethodIdMap.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/MethodIdMap.java Mon May 25 23:30:34 2015 +0200 @@ -28,10 +28,10 @@ import java.util.stream.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graphbuilderconf.MethodIdHolder.MethodIdAllocator; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.type.*; +import com.oracle.jvmci.common.*; /** * A map whose keys are {@link MethodIdHolder}s that doesn't require eager resolution of @@ -124,7 +124,7 @@ assert Modifier.isStatic(res.getModifiers()) == isStatic; return res; } catch (NoSuchMethodException | SecurityException e) { - throw new GraalInternalError(e); + throw new JVMCIError(e); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/MethodSubstitutionPlugin.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/MethodSubstitutionPlugin.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/MethodSubstitutionPlugin.java Mon May 25 23:30:34 2015 +0200 @@ -29,9 +29,9 @@ import sun.misc.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graphbuilderconf.MethodIdMap.Receiver; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.common.*; /** * An {@link InvocationPlugin} for a method where the implementation of the method is provided by a @@ -107,14 +107,14 @@ /** * Gets the reflection API version of the substitution method. */ - Method getJavaSubstitute() throws GraalInternalError { + Method getJavaSubstitute() throws JVMCIError { Method substituteMethod = lookupSubstitute(); int modifiers = substituteMethod.getModifiers(); if (Modifier.isAbstract(modifiers) || Modifier.isNative(modifiers)) { - throw new GraalInternalError("Substitution method must not be abstract or native: " + substituteMethod); + throw new JVMCIError("Substitution method must not be abstract or native: " + substituteMethod); } if (!Modifier.isStatic(modifiers)) { - throw new GraalInternalError("Substitution method must be static: " + substituteMethod); + throw new JVMCIError("Substitution method must be static: " + substituteMethod); } return substituteMethod; } @@ -153,7 +153,7 @@ return m; } } - throw new GraalInternalError("No method found specified by %s", this); + throw new JVMCIError("No method found specified by %s", this); } /** @@ -173,7 +173,7 @@ if (optional) { return null; } - throw new GraalInternalError("Could not resolve type " + className); + throw new JVMCIError("Could not resolve type " + className); } } @@ -194,7 +194,7 @@ return metaAccess.lookupJavaMethod(m).asStackTraceElement(0); } } - throw new GraalInternalError("could not find method named \"execute\" in " + c.getName()); + throw new JVMCIError("could not find method named \"execute\" in " + c.getName()); } @Override diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCounterOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCounterOp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCounterOp.java Mon May 25 23:30:34 2015 +0200 @@ -24,7 +24,7 @@ import static com.oracle.graal.amd64.AMD64.*; import static com.oracle.graal.api.code.ValueUtil.*; -import static com.oracle.graal.compiler.common.GraalInternalError.*; +import static com.oracle.jvmci.common.JVMCIError.*; import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Mon May 25 23:30:34 2015 +0200 @@ -42,7 +42,7 @@ import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.debug.*; import com.oracle.graal.hotspot.jvmci.*; -import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.*; +import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.CompressEncoding; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.stubs.*; import com.oracle.graal.lir.*; @@ -54,6 +54,7 @@ import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.framemap.*; import com.oracle.graal.lir.gen.*; +import com.oracle.jvmci.common.*; /** * LIR generator specialized for AMD64 HotSpot. @@ -192,7 +193,7 @@ return r; } } - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } private Register pollOnReturnScratchRegister; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMove.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMove.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMove.java Mon May 25 23:30:34 2015 +0200 @@ -33,11 +33,12 @@ import com.oracle.graal.compiler.common.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.jvmci.*; -import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.*; +import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.CompressEncoding; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.MoveOp; import com.oracle.graal.lir.amd64.*; import com.oracle.graal.lir.asm.*; +import com.oracle.jvmci.common.*; public class AMD64HotSpotMove { @@ -77,7 +78,7 @@ if (compressed) { masm.movl((AMD64Address) crb.asAddress(result), 0xDEADDEAD); } else { - throw GraalInternalError.shouldNotReachHere("Cannot store 64-bit constants to memory"); + throw JVMCIError.shouldNotReachHere("Cannot store 64-bit constants to memory"); } } } else { @@ -89,7 +90,7 @@ masm.movq(asRegister(result), address); } } else { - throw GraalInternalError.shouldNotReachHere("Cannot directly store data patch to memory"); + throw JVMCIError.shouldNotReachHere("Cannot directly store data patch to memory"); } } } else if (input instanceof HotSpotMetaspaceConstant) { @@ -122,12 +123,12 @@ assert isStackSlot(result); if (compressed) { if (isImmutable && generatePIC) { - throw GraalInternalError.shouldNotReachHere("Unsupported operation offset(%rip) -> mem (mem -> mem)"); + throw JVMCIError.shouldNotReachHere("Unsupported operation offset(%rip) -> mem (mem -> mem)"); } else { masm.movl((AMD64Address) crb.asAddress(result), input.asInt()); } } else { - throw GraalInternalError.shouldNotReachHere("Cannot store 64-bit constants to memory"); + throw JVMCIError.shouldNotReachHere("Cannot store 64-bit constants to memory"); } } } else { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java Mon May 25 23:30:34 2015 +0200 @@ -31,7 +31,9 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; -import com.oracle.graal.asm.amd64.AMD64Assembler.*; +import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64RMOp; +import com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize; +import com.oracle.graal.asm.amd64.AMD64Assembler.SSEOp; import com.oracle.graal.compiler.amd64.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRegisterConfig.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRegisterConfig.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRegisterConfig.java Mon May 25 23:30:34 2015 +0200 @@ -33,6 +33,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.hotspot.jvmci.*; +import com.oracle.jvmci.common.*; public class AMD64HotSpotRegisterConfig implements RegisterConfig { @@ -207,7 +208,7 @@ } break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } if (locations[i] == null) { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64PrefetchOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64PrefetchOp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64PrefetchOp.java Mon May 25 23:30:34 2015 +0200 @@ -26,10 +26,10 @@ import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import com.oracle.graal.asm.amd64.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.*; import com.oracle.graal.lir.asm.*; +import com.oracle.jvmci.common.*; public final class AMD64PrefetchOp extends AMD64LIRInstruction { public static final LIRInstructionClass TYPE = LIRInstructionClass.create(AMD64PrefetchOp.class); @@ -59,7 +59,7 @@ masm.prefetchw(address.toAddress()); break; default: - throw GraalInternalError.shouldNotReachHere("unspported prefetch op " + instr); + throw JVMCIError.shouldNotReachHere("unspported prefetch op " + instr); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot.sourcegen/src/com/oracle/graal/hotspot/sourcegen/GenGraalRuntimeInlineHpp.java --- a/graal/com.oracle.graal.hotspot.sourcegen/src/com/oracle/graal/hotspot/sourcegen/GenGraalRuntimeInlineHpp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sourcegen/src/com/oracle/graal/hotspot/sourcegen/GenGraalRuntimeInlineHpp.java Mon May 25 23:30:34 2015 +0200 @@ -28,8 +28,9 @@ import java.util.stream.*; import java.util.zip.*; -import com.oracle.graal.compiler.common.*; +import com.oracle.graal.hotspot.jvmci.*; import com.oracle.graal.options.*; +import com.oracle.jvmci.common.*; import com.oracle.jvmci.runtime.*; /** @@ -220,6 +221,6 @@ if (desc.getType() == Double.class) { return 'd'; } - throw GraalInternalError.shouldNotReachHere("Unexpected primitive option type: " + desc.getType().getName()); + throw JVMCIError.shouldNotReachHere("Unexpected primitive option type: " + desc.getType().getName()); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java Mon May 25 23:30:34 2015 +0200 @@ -31,14 +31,13 @@ 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.spi.*; import com.oracle.graal.compiler.sparc.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.debug.*; import com.oracle.graal.hotspot.jvmci.*; -import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.*; +import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.CompressEncoding; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.stubs.*; import com.oracle.graal.lir.*; @@ -51,6 +50,7 @@ import com.oracle.graal.lir.sparc.SPARCMove.StoreConstantOp; import com.oracle.graal.lir.sparc.SPARCMove.StoreOp; import com.oracle.graal.sparc.*; +import com.oracle.jvmci.common.*; public class SPARCHotSpotLIRGenerator extends SPARCLIRGenerator implements HotSpotLIRGenerator { @@ -159,7 +159,7 @@ @Override public void emitTailcall(Value[] args, Value address) { // append(new AMD64TailcallOp(args, address)); - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } @Override diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotMove.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotMove.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotMove.java Mon May 25 23:30:34 2015 +0200 @@ -38,12 +38,13 @@ import com.oracle.graal.compiler.common.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.jvmci.*; -import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.*; +import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.CompressEncoding; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.MoveOp; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.sparc.*; import com.oracle.graal.sparc.*; +import com.oracle.jvmci.common.*; public class SPARCHotSpotMove { @@ -82,7 +83,7 @@ masm.stx(sr1, addr); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } @@ -106,7 +107,7 @@ new SPARCMacroAssembler.Setx(0xDEADDEADDEADDEADL, asRegister(dest), true).emit(masm); } } else { - GraalInternalError.unimplemented(); + JVMCIError.unimplemented(); } } else if (constant instanceof HotSpotMetaspaceConstant) { assert constant.getKind() == Kind.Int || constant.getKind() == Kind.Long; @@ -116,13 +117,13 @@ crb.recordInlineDataInCode(constant); if (compressed) { if (isImmutable && generatePIC) { - GraalInternalError.unimplemented(); + JVMCIError.unimplemented(); } else { new SPARCMacroAssembler.Setx(constant.asInt(), asRegister(dest), true).emit(masm); } } else { if (isImmutable && generatePIC) { - GraalInternalError.unimplemented(); + JVMCIError.unimplemented(); } else { new SPARCMacroAssembler.Setx(constant.asLong(), asRegister(dest), true).emit(masm); } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotRegisterConfig.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotRegisterConfig.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotRegisterConfig.java Mon May 25 23:30:34 2015 +0200 @@ -30,10 +30,10 @@ import com.oracle.graal.api.code.CallingConvention.Type; import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.hotspot.jvmci.*; import com.oracle.graal.lir.framemap.*; import com.oracle.graal.sparc.*; +import com.oracle.jvmci.common.*; public class SPARCHotSpotRegisterConfig implements RegisterConfig { @@ -178,7 +178,7 @@ if (type == Type.JavaCallee) { return callingConvention(cpuCalleeParameterRegisters, returnType, parameterTypes, type, target, stackOnly); } - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public Register[] getCallingConventionRegisters(Type type, Kind kind) { @@ -230,7 +230,7 @@ } break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } if (locations[i] == null) { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotMonitorValueTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotMonitorValueTest.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotMonitorValueTest.java Mon May 25 23:30:34 2015 +0200 @@ -33,8 +33,8 @@ import com.oracle.graal.api.code.CompilationResult.Call; import com.oracle.graal.api.code.CompilationResult.Infopoint; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.test.*; +import com.oracle.jvmci.common.*; public class HotSpotMonitorValueTest extends GraalCompilerTest { @@ -80,7 +80,7 @@ try { return getMetaAccess().lookupJavaMethod(Object.class.getDeclaredMethod("wait", long.class)); } catch (Exception e) { - throw new GraalInternalError("Could not find Object.wait(long): %s", e); + throw new JVMCIError("Could not find Object.wait(long): %s", e); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java Mon May 25 23:30:34 2015 +0200 @@ -42,8 +42,8 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; import com.oracle.graal.nodes.extended.*; +import com.oracle.graal.nodes.memory.HeapAccess.BarrierType; import com.oracle.graal.nodes.memory.*; -import com.oracle.graal.nodes.memory.HeapAccess.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.phases.*; import com.oracle.graal.phases.common.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationStatistics.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationStatistics.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationStatistics.java Mon May 25 23:30:34 2015 +0200 @@ -32,7 +32,6 @@ import java.util.concurrent.*; import com.oracle.graal.hotspot.jvmci.*; -import com.oracle.graal.hotspot.meta.*; import com.sun.management.ThreadMXBean; @SuppressWarnings("unused") diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java Mon May 25 23:30:34 2015 +0200 @@ -40,7 +40,6 @@ import com.oracle.graal.bytecode.*; import com.oracle.graal.compiler.*; import com.oracle.graal.compiler.CompilerThreadFactory.DebugConfigAccess; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.internal.*; import com.oracle.graal.hotspot.jvmci.*; @@ -49,6 +48,7 @@ import com.oracle.graal.options.OptionValue.OverrideScope; import com.oracle.graal.printer.*; import com.oracle.graal.replacements.*; +import com.oracle.jvmci.common.*; /** * This class implements compile-the-world functionality in Graal. @@ -126,7 +126,7 @@ if (options != null) { for (String option : options.split("\\s+")) { if (!HotSpotOptions.parseOption(option, this)) { - throw new GraalInternalError("Invalid option specified: %s", option); + throw new JVMCIError("Invalid option specified: %s", option); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/DebugValuesPrinter.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/DebugValuesPrinter.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/DebugValuesPrinter.java Mon May 25 23:30:34 2015 +0200 @@ -29,9 +29,9 @@ import java.util.regex.*; import java.util.stream.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.internal.*; +import com.oracle.jvmci.common.*; /** * Facility for printing the {@linkplain KeyRegistry#getDebugValues() values} collected across all @@ -39,7 +39,7 @@ */ public class DebugValuesPrinter { - public void printDebugValues() throws GraalInternalError { + public void printDebugValues() throws JVMCIError { TTY.println(); TTY.println(""); List topLevelMaps = DebugValueMap.getTopLevelMaps(); @@ -91,7 +91,7 @@ } break; default: - throw new GraalInternalError("Unknown summary type: %s", summary); + throw new JVMCIError("Unknown summary type: %s", summary); } for (DebugValueMap topLevelMap : topLevelMaps) { topLevelMap.reset(); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCounterOp.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCounterOp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCounterOp.java Mon May 25 23:30:34 2015 +0200 @@ -29,11 +29,11 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.hotspot.debug.*; import com.oracle.graal.hotspot.jvmci.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.lir.*; +import com.oracle.jvmci.common.*; public abstract class HotSpotCounterOp extends LIRInstruction { public static final LIRInstructionClass TYPE = LIRInstructionClass.create(HotSpotCounterOp.class); @@ -64,7 +64,7 @@ protected static int getDisplacementForLongIndex(TargetDescription target, long index) { long finalDisp = index * target.getSizeInBytes(Kind.Long); if (!NumUtil.isInt(finalDisp)) { - throw GraalInternalError.unimplemented("cannot deal with indices that big: " + index); + throw JVMCIError.unimplemented("cannot deal with indices that big: " + index); } return (int) finalDisp; } @@ -127,7 +127,7 @@ * @param increment */ public void patchCounterIncrement(Assembler asm, int[] increment) { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } private static long asLong(JavaConstant value) { @@ -148,7 +148,7 @@ protected static int asInt(JavaConstant value) { long l = asLong(value); if (!NumUtil.isInt(l)) { - throw GraalInternalError.shouldNotReachHere("value does not fit into int: " + l); + throw JVMCIError.shouldNotReachHere("value does not fit into int: " + l); } return (int) l; } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugInfoBuilder.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugInfoBuilder.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugInfoBuilder.java Mon May 25 23:30:34 2015 +0200 @@ -26,10 +26,10 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.common.*; /** * Extends {@link DebugInfoBuilder} to allocate the extra debug information required for locks. @@ -65,7 +65,7 @@ protected BytecodeFrame computeFrameForState(FrameState state) { if (isPlaceholderBci(state.bci) && state.bci != BytecodeFrame.BEFORE_BCI) { // This is really a hard error since an incorrect state could crash hotspot - throw GraalInternalError.shouldNotReachHere("Invalid state " + BytecodeFrame.getPlaceholderBciName(state.bci) + " " + state); + throw JVMCIError.shouldNotReachHere("Invalid state " + BytecodeFrame.getPlaceholderBciName(state.bci) + " " + state); } return super.computeFrameForState(state); } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Mon May 25 23:30:34 2015 +0200 @@ -37,7 +37,6 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.api.runtime.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.target.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; @@ -50,6 +49,7 @@ import com.oracle.graal.printer.*; import com.oracle.graal.replacements.*; import com.oracle.graal.runtime.*; +import com.oracle.jvmci.common.*; import com.oracle.jvmci.runtime.*; //JaCoCo Exclude @@ -137,7 +137,7 @@ if (!GraalRuntime.getValue().equals("")) { // Fail fast if a non-default value for GraalRuntime was specified // and the corresponding factory is not available - throw new GraalInternalError("Specified runtime \"%s\" not available for the %s architecture", GraalRuntime.getValue(), architecture); + throw new JVMCIError("Specified runtime \"%s\" not available for the %s architecture", GraalRuntime.getValue(), architecture); } else if (nonBasicCount == 1) { // If there is exactly one non-basic runtime, select this one. return nonBasic; @@ -239,7 +239,7 @@ factory = findFactory(arch); } if (factory == null) { - throw new GraalInternalError("No backend available for specified GPU architecture \"%s\"", arch); + throw new JVMCIError("No backend available for specified GPU architecture \"%s\"", arch); } try (InitTimer t = timer("create backend:", arch)) { registerBackend(factory.createBackend(this, null, hostBackend)); @@ -274,7 +274,7 @@ case "Thread": break; default: - throw new GraalInternalError("Unsupported value for DebugSummaryValue: %s", summary); + throw new JVMCIError("Unsupported value for DebugSummaryValue: %s", summary); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotInstructionProfiling.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotInstructionProfiling.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotInstructionProfiling.java Mon May 25 23:30:34 2015 +0200 @@ -27,7 +27,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; -import com.oracle.graal.asm.Assembler.*; +import com.oracle.graal.asm.Assembler.InstructionCounter; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.BlockEndOp; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotLIRGenerator.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotLIRGenerator.java Mon May 25 23:30:34 2015 +0200 @@ -24,12 +24,12 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; -import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.*; +import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.CompressEncoding; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.nodes.*; import com.oracle.graal.lir.StandardOp.SaveRegistersOp; import com.oracle.graal.lir.gen.*; +import com.oracle.jvmci.common.*; /** * This interface defines the contract a HotSpot backend LIR generator needs to fulfill in addition @@ -60,7 +60,7 @@ * @param saveRegisterOp saved registers */ default void emitLeaveCurrentStackFrame(SaveRegistersOp saveRegisterOp) { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } /** @@ -70,7 +70,7 @@ * @param initialInfo */ default void emitLeaveDeoptimizedStackFrame(Value frameSize, Value initialInfo) { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } /** @@ -82,7 +82,7 @@ * @param saveRegisterOp */ default void emitEnterUnpackFramesStackFrame(Value framePc, Value senderSp, Value senderFp, SaveRegistersOp saveRegisterOp) { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } /** @@ -91,7 +91,7 @@ * @param saveRegisterOp */ default void emitLeaveUnpackFramesStackFrame(SaveRegistersOp saveRegisterOp) { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } /** @@ -103,7 +103,7 @@ * @param initialInfo */ default void emitPushInterpreterFrame(Value frameSize, Value framePc, Value senderSp, Value initialInfo) { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } /** @@ -114,7 +114,7 @@ * @return a {@code Deoptimization::UnrollBlock} pointer */ default Value emitUncommonTrapCall(Value trapRequest, SaveRegistersOp saveRegisterOp) { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } /** @@ -124,15 +124,15 @@ * @return a {@code Deoptimization::UnrollBlock} pointer */ default Value emitDeoptimizationFetchUnrollInfoCall(SaveRegistersOp saveRegisterOp) { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } default Value emitCardTableShift() { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } default Value emitCardTableAddress() { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } /** diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java Mon May 25 23:30:34 2015 +0200 @@ -28,12 +28,12 @@ import java.util.concurrent.*; import java.util.concurrent.atomic.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; import com.oracle.graal.hotspot.jvmci.*; import com.oracle.graal.hotspot.replacements.*; import com.oracle.graal.nodes.debug.*; import com.oracle.graal.options.*; +import com.oracle.jvmci.common.*; import edu.umd.cs.findbugs.annotations.*; @@ -123,9 +123,9 @@ } @SuppressFBWarnings(value = "AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION", justification = "concurrent abstraction calls are in synchronized block") - private static Counter getCounter(String name, String group, HotSpotVMConfig config) throws GraalInternalError { + private static Counter getCounter(String name, String group, HotSpotVMConfig config) throws JVMCIError { if (!enabled) { - throw new GraalInternalError("cannot access count index when counters are not enabled: " + group + ", " + name); + throw new JVMCIError("cannot access count index when counters are not enabled: " + group + ", " + name); } String nameGroup = name + "#" + group; Counter counter = counterMap.get(nameGroup); @@ -141,7 +141,7 @@ assert counter.group.equals(group) : "mismatching groups: " + counter.group + " vs. " + group; int countersSize = config.graalCountersSize; if (counter.index >= countersSize) { - throw new GraalInternalError("too many counters, reduce number of counters or increase -XX:GraalCounterSize=... (current value: " + countersSize + ")"); + throw new JVMCIError("too many counters, reduce number of counters or increase -XX:GraalCounterSize=... (current value: " + countersSize + ")"); } return counter; } @@ -357,7 +357,7 @@ if (Options.BenchmarkDynamicCounters.getValue() != null) { String[] arguments = Options.BenchmarkDynamicCounters.getValue().split(","); if (arguments.length == 0 || (arguments.length % 3) != 0) { - throw new GraalInternalError("invalid arguments to BenchmarkDynamicCounters: (err|out),start,end,(err|out),start,end,... (~ matches multiple digits)"); + throw new JVMCIError("invalid arguments to BenchmarkDynamicCounters: (err|out),start,end,(err|out),start,end,... (~ matches multiple digits)"); } for (int i = 0; i < arguments.length; i += 3) { if (arguments[i].equals("err")) { @@ -365,7 +365,7 @@ } else if (arguments[i].equals("out")) { System.setOut(new PrintStream(new BenchmarkCountersOutputStream(System.out, arguments[i + 1], arguments[i + 2]))); } else { - throw new GraalInternalError("invalid arguments to BenchmarkDynamicCounters: err|out"); + throw new JVMCIError("invalid arguments to BenchmarkDynamicCounters: err|out"); } } enabled = true; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/events/EmptyEventProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/events/EmptyEventProvider.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/events/EmptyEventProvider.java Mon May 25 23:30:34 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.events; -import com.oracle.graal.compiler.common.*; +import com.oracle.jvmci.common.*; /** * An empty implementation for {@link EventProvider}. This implementation is used when no logging is @@ -36,7 +36,7 @@ class EmptyCompilationEvent implements CompilationEvent { public void commit() { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public boolean shouldWrite() { @@ -51,31 +51,31 @@ } public void setMethod(String method) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public void setCompileId(int compileId) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public void setCompileLevel(int compileLevel) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public void setSucceeded(boolean succeeded) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public void setIsOsr(boolean isOsr) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public void setCodeSize(int codeSize) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public void setInlinedBytes(int inlinedBytes) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -85,7 +85,7 @@ class EmptyCompilerFailureEvent implements CompilerFailureEvent { public void commit() { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public boolean shouldWrite() { @@ -94,11 +94,11 @@ } public void setCompileId(int compileId) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public void setMessage(String message) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotMemoryAccessProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotMemoryAccessProvider.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotMemoryAccessProvider.java Mon May 25 23:30:34 2015 +0200 @@ -23,7 +23,7 @@ package com.oracle.graal.hotspot.jvmci; import com.oracle.graal.api.meta.*; -import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.*; +import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.CompressEncoding; /** * HotSpot specific extension of {@link MemoryAccessProvider}. diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotMemoryAccessProviderImpl.java diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotMetaspaceConstant.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotMetaspaceConstant.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotMetaspaceConstant.java Mon May 25 23:30:34 2015 +0200 @@ -23,7 +23,7 @@ package com.oracle.graal.hotspot.jvmci; import com.oracle.graal.api.meta.*; -import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.*; +import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.CompressEncoding; public interface HotSpotMetaspaceConstant extends HotSpotConstant, VMConstant { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotMetaspaceConstantImpl.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotMetaspaceConstantImpl.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotMetaspaceConstantImpl.java Mon May 25 23:30:34 2015 +0200 @@ -25,7 +25,7 @@ import java.util.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.*; +import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.CompressEncoding; public final class HotSpotMetaspaceConstantImpl extends PrimitiveConstant implements HotSpotMetaspaceConstant, VMConstant, HotSpotProxified { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotMethodHandleAccessProvider.java diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotObjectConstantImpl.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotObjectConstantImpl.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotObjectConstantImpl.java Mon May 25 23:30:34 2015 +0200 @@ -27,6 +27,7 @@ import java.lang.invoke.*; import com.oracle.graal.api.meta.*; + import edu.umd.cs.findbugs.annotations.*; /** diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotResolvedJavaFieldImpl.java diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotResolvedJavaMethodImpl.java diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotResolvedObjectType.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotResolvedObjectType.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotResolvedObjectType.java Mon May 25 23:30:34 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.hotspot.jvmci; +import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; /** * Implementation of {@link JavaType} for resolved non-primitive HotSpot classes. diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotResolvedPrimitiveType.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotResolvedPrimitiveType.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotResolvedPrimitiveType.java Mon May 25 23:30:34 2015 +0200 @@ -28,8 +28,8 @@ import java.lang.reflect.*; import java.net.*; +import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; /** * Implementation of {@link JavaType} for primitive HotSpot types. diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java Mon May 25 23:30:34 2015 +0200 @@ -32,7 +32,6 @@ 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.graph.*; import com.oracle.graal.hotspot.*; @@ -47,11 +46,12 @@ import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.memory.*; -import com.oracle.graal.nodes.memory.HeapAccess.*; +import com.oracle.graal.nodes.memory.HeapAccess.BarrierType; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; import com.oracle.graal.replacements.*; import com.oracle.graal.replacements.nodes.*; +import com.oracle.jvmci.common.*; /** * HotSpot implementation of {@link LoweringProvider}. @@ -418,7 +418,7 @@ } else if (node.getExceptionClass() == ArrayIndexOutOfBoundsException.class) { exception = Exceptions.cachedArrayIndexOutOfBoundsException; } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } FloatingNode exceptionNode = ConstantNode.forConstant(HotSpotObjectConstantImpl.forObject(exception), metaAccess, graph); graph.replaceFixedWithFloating(node, exceptionNode); @@ -430,7 +430,7 @@ } else if (node.getExceptionClass() == ArrayIndexOutOfBoundsException.class) { descriptor = RuntimeCalls.CREATE_OUT_OF_BOUNDS_EXCEPTION; } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } ForeignCallNode foreignCallNode = graph.add(new ForeignCallNode(foreignCalls, descriptor, node.stamp(), node.getArguments())); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotGraalConstantReflectionProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotGraalConstantReflectionProvider.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotGraalConstantReflectionProvider.java Mon May 25 23:30:34 2015 +0200 @@ -30,11 +30,11 @@ import java.util.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.jvmci.*; import com.oracle.graal.replacements.*; import com.oracle.graal.replacements.SnippetTemplate.Arguments; +import com.oracle.jvmci.common.*; /** * Extends {@link HotSpotConstantReflectionProvider} to override the implementation of @@ -117,7 +117,7 @@ makeGraphMethod = metaAccess.lookupJavaMethod(ReplacementsImpl.class.getDeclaredMethod("makeGraph", rjm, Object[].class, rjm)); initMethod = metaAccess.lookupJavaMethod(SnippetTemplate.AbstractTemplates.class.getDeclaredMethod("template", Arguments.class)); } catch (NoSuchMethodException | SecurityException e) { - throw new GraalInternalError(e); + throw new JVMCIError(e); } StackTraceElement makeGraphSTE = makeGraphMethod.asStackTraceElement(0); StackTraceElement initSTE = initMethod.asStackTraceElement(0); @@ -171,7 +171,7 @@ embeddableFields.add(metaAccess.lookupJavaField(Throwable.class.getDeclaredField("UNASSIGNED_STACK"))); embeddableFields.add(metaAccess.lookupJavaField(Throwable.class.getDeclaredField("SUPPRESSED_SENTINEL"))); } catch (SecurityException | NoSuchFieldException e) { - throw new GraalInternalError(e); + throw new JVMCIError(e); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotGraphBuilderPlugins.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotGraphBuilderPlugins.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotGraphBuilderPlugins.java Mon May 25 23:30:34 2015 +0200 @@ -44,7 +44,7 @@ import com.oracle.graal.hotspot.word.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; -import com.oracle.graal.nodes.memory.HeapAccess.*; +import com.oracle.graal.nodes.memory.HeapAccess.BarrierType; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; import com.oracle.graal.options.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotHostForeignCallsProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotHostForeignCallsProvider.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotHostForeignCallsProvider.java Mon May 25 23:30:34 2015 +0200 @@ -50,11 +50,11 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.jvmci.*; import com.oracle.graal.hotspot.stubs.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.common.*; /** * HotSpot implementation of {@link ForeignCallsProvider}. @@ -256,7 +256,7 @@ // These stubs do callee saving registerForeignCall(ENCRYPT_BLOCK, c.aescryptEncryptBlockStub, NativeCall, PRESERVES_REGISTERS, LEAF_NOFP, NOT_REEXECUTABLE, NamedLocationIdentity.getArrayLocation(Kind.Byte)); registerForeignCall(DECRYPT_BLOCK, c.aescryptDecryptBlockStub, NativeCall, PRESERVES_REGISTERS, LEAF_NOFP, NOT_REEXECUTABLE, NamedLocationIdentity.getArrayLocation(Kind.Byte)); - } catch (GraalInternalError e) { + } catch (JVMCIError e) { if (!(e.getCause() instanceof ClassNotFoundException)) { throw e; } @@ -265,7 +265,7 @@ // These stubs do callee saving registerForeignCall(ENCRYPT, c.cipherBlockChainingEncryptAESCryptStub, NativeCall, PRESERVES_REGISTERS, LEAF_NOFP, NOT_REEXECUTABLE, NamedLocationIdentity.getArrayLocation(Kind.Byte)); registerForeignCall(DECRYPT, c.cipherBlockChainingDecryptAESCryptStub, NativeCall, PRESERVES_REGISTERS, LEAF_NOFP, NOT_REEXECUTABLE, NamedLocationIdentity.getArrayLocation(Kind.Byte)); - } catch (GraalInternalError e) { + } catch (JVMCIError e) { if (!(e.getCause() instanceof ClassNotFoundException)) { throw e; } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodHandleAccessProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodHandleAccessProvider.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodHandleAccessProvider.java Mon May 25 23:30:34 2015 +0200 @@ -27,9 +27,9 @@ import static com.oracle.graal.hotspot.jvmci.HotSpotResolvedObjectTypeImpl.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.jvmci.*; +import com.oracle.jvmci.common.*; public class HotSpotMethodHandleAccessProvider implements MethodHandleAccessProvider, HotSpotProxified { @@ -90,7 +90,7 @@ lambdaFormCompileToBytecodeMethod = findMethodInClass("java.lang.invoke.LambdaForm", "compileToBytecode"); memberNameVmtargetField = findFieldInClass("java.lang.invoke.MemberName", "vmtarget"); } catch (Throwable ex) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotProviders.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotProviders.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotProviders.java Mon May 25 23:30:34 2015 +0200 @@ -24,7 +24,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; -import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.*; +import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; import com.oracle.graal.hotspot.jvmci.*; import com.oracle.graal.hotspot.word.*; import com.oracle.graal.nodes.spi.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSuitesProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSuitesProvider.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSuitesProvider.java Mon May 25 23:30:34 2015 +0200 @@ -25,14 +25,15 @@ import static com.oracle.graal.compiler.common.GraalOptions.*; import com.oracle.graal.graphbuilderconf.*; -import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.*; +import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.DebugInfoMode; +import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.jvmci.*; import com.oracle.graal.hotspot.phases.*; import com.oracle.graal.java.*; import com.oracle.graal.lir.phases.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.StructuredGraph.*; +import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; import com.oracle.graal.options.*; import com.oracle.graal.options.DerivedOptionValue.OptionSupplier; import com.oracle.graal.phases.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotWordOperationPlugin.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotWordOperationPlugin.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotWordOperationPlugin.java Mon May 25 23:30:34 2015 +0200 @@ -28,7 +28,6 @@ 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.graphbuilderconf.*; import com.oracle.graal.hotspot.nodes.type.*; @@ -37,10 +36,11 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.extended.*; +import com.oracle.graal.nodes.memory.HeapAccess.BarrierType; import com.oracle.graal.nodes.memory.*; -import com.oracle.graal.nodes.memory.HeapAccess.*; import com.oracle.graal.replacements.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.common.*; /** * Extends {@link WordOperationPlugin} to handle {@linkplain HotSpotOperation HotSpot word @@ -129,7 +129,7 @@ break; default: - throw GraalInternalError.shouldNotReachHere("unknown operation: " + operation.opcode()); + throw JVMCIError.shouldNotReachHere("unknown operation: " + operation.opcode()); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CompressionNode.java Mon May 25 23:30:34 2015 +0200 @@ -23,19 +23,19 @@ package com.oracle.graal.hotspot.nodes; 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.*; import com.oracle.graal.hotspot.jvmci.*; -import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.*; +import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.CompressEncoding; import com.oracle.graal.hotspot.nodes.type.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; +import com.oracle.jvmci.common.*; /** * Compress or uncompress an oop or metaspace pointer. @@ -80,7 +80,7 @@ } else if (c instanceof HotSpotMetaspaceConstant) { return ((HotSpotMetaspaceConstant) c).compress(encoding); } else { - throw GraalInternalError.shouldNotReachHere("invalid constant input for compress op: " + c); + throw JVMCIError.shouldNotReachHere("invalid constant input for compress op: " + c); } } @@ -92,7 +92,7 @@ } else if (c instanceof HotSpotMetaspaceConstant) { return ((HotSpotMetaspaceConstant) c).uncompress(encoding); } else { - throw GraalInternalError.shouldNotReachHere("invalid constant input for uncompress op: " + c); + throw JVMCIError.shouldNotReachHere("invalid constant input for uncompress op: " + c); } } @@ -104,7 +104,7 @@ case Uncompress: return uncompress(c, encoding); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -116,7 +116,7 @@ case Uncompress: return compress(c, encoding); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -148,7 +148,7 @@ } break; } - throw GraalInternalError.shouldNotReachHere(String.format("Unexpected input stamp %s", input)); + throw JVMCIError.shouldNotReachHere(String.format("Unexpected input stamp %s", input)); } public CompressEncoding getEncoding() { @@ -188,7 +188,7 @@ result = hsGen.emitUncompress(gen.operand(getValue()), encoding, nonNull); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } gen.setResult(this, result); } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/KlassPointerStamp.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/KlassPointerStamp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/KlassPointerStamp.java Mon May 25 23:30:34 2015 +0200 @@ -28,7 +28,7 @@ import com.oracle.graal.compiler.common.spi.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.jvmci.*; -import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.*; +import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.CompressEncoding; public final class KlassPointerStamp extends MetaspacePointerStamp { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/MetaspacePointerStamp.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/MetaspacePointerStamp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/MetaspacePointerStamp.java Mon May 25 23:30:34 2015 +0200 @@ -23,9 +23,9 @@ package com.oracle.graal.hotspot.nodes.type; 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.jvmci.common.*; public abstract class MetaspacePointerStamp extends AbstractPointerStamp { @@ -51,7 +51,7 @@ @Override public ResolvedJavaType javaType(MetaAccessProvider metaAccess) { - throw GraalInternalError.shouldNotReachHere("metaspace pointer has no Java type"); + throw JVMCIError.shouldNotReachHere("metaspace pointer has no Java type"); } protected void appendString(StringBuilder str) { diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/NarrowOopStamp.java Mon May 25 23:30:34 2015 +0200 @@ -26,7 +26,7 @@ import com.oracle.graal.compiler.common.spi.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.jvmci.*; -import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.*; +import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.CompressEncoding; public class NarrowOopStamp extends AbstractObjectStamp { diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java Mon May 25 23:30:34 2015 +0200 @@ -27,10 +27,9 @@ import static com.oracle.graal.nodes.ConstantNode.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.jvmci.*; -import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.*; +import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.CompressEncoding; import com.oracle.graal.hotspot.nodes.*; import com.oracle.graal.hotspot.nodes.type.*; import com.oracle.graal.nodes.*; @@ -39,6 +38,7 @@ import com.oracle.graal.phases.*; import com.oracle.graal.phases.common.*; import com.oracle.graal.phases.tiers.*; +import com.oracle.jvmci.common.*; /** * For AOT compilation we aren't allowed to use a {@link Class} reference ({@code javaMirror}) @@ -96,7 +96,7 @@ } } if (typeField == null) { - throw new GraalInternalError("Can't find TYPE field in class"); + throw new JVMCIError("Can't find TYPE field in class"); } LocationNode location = graph.unique(new ConstantLocationNode(FINAL_LOCATION, typeField.offset())); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/OnStackReplacementPhase.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/OnStackReplacementPhase.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/OnStackReplacementPhase.java Mon May 25 23:30:34 2015 +0200 @@ -25,7 +25,6 @@ import static com.oracle.graal.phases.common.DeadCodeEliminationPhase.Optionality.*; import com.oracle.graal.api.code.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; @@ -36,6 +35,7 @@ import com.oracle.graal.nodes.util.*; import com.oracle.graal.phases.*; import com.oracle.graal.phases.common.*; +import com.oracle.jvmci.common.*; public class OnStackReplacementPhase extends Phase { @@ -55,7 +55,7 @@ throw new BailoutException("No OnStackReplacementNode generated"); } if (osrNodes.count() > 1) { - throw new GraalInternalError("Multiple OnStackReplacementNodes generated"); + throw new JVMCIError("Multiple OnStackReplacementNodes generated"); } if (osr.stateAfter().locksSize() != 0) { throw new BailoutException("OSR with locks not supported"); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/WriteBarrierAdditionPhase.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/WriteBarrierAdditionPhase.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/WriteBarrierAdditionPhase.java Mon May 25 23:30:34 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.hotspot.phases; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.jvmci.*; import com.oracle.graal.hotspot.nodes.*; @@ -30,9 +29,10 @@ import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.memory.*; -import com.oracle.graal.nodes.memory.HeapAccess.*; +import com.oracle.graal.nodes.memory.HeapAccess.BarrierType; import com.oracle.graal.nodes.type.*; import com.oracle.graal.phases.*; +import com.oracle.jvmci.common.*; public class WriteBarrierAdditionPhase extends Phase { @@ -115,7 +115,7 @@ } break; default: - throw new GraalInternalError("unexpected barrier type: " + barrierType); + throw new JVMCIError("unexpected barrier type: " + barrierType); } } @@ -136,7 +136,7 @@ } break; default: - throw new GraalInternalError("unexpected barrier type: " + barrierType); + throw new JVMCIError("unexpected barrier type: " + barrierType); } } @@ -157,7 +157,7 @@ } break; default: - throw new GraalInternalError("unexpected barrier type: " + barrierType); + throw new JVMCIError("unexpected barrier type: " + barrierType); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/WriteBarrierVerificationPhase.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/WriteBarrierVerificationPhase.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/WriteBarrierVerificationPhase.java Mon May 25 23:30:34 2015 +0200 @@ -27,7 +27,6 @@ import java.util.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.nodes.*; import com.oracle.graal.hotspot.replacements.*; @@ -38,6 +37,7 @@ import com.oracle.graal.nodes.memory.HeapAccess.BarrierType; import com.oracle.graal.nodes.type.*; import com.oracle.graal.phases.*; +import com.oracle.jvmci.common.*; /** * Verification phase that checks if, for every write, at least one write barrier is present at all @@ -145,7 +145,7 @@ } else if (write instanceof LoweredAtomicReadAndWriteNode) { return ((LoweredAtomicReadAndWriteNode) write).getNewValue(); } else { - throw GraalInternalError.shouldNotReachHere(String.format("unexpected write node %s", write)); + throw JVMCIError.shouldNotReachHere(String.format("unexpected write node %s", write)); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java Mon May 25 23:30:34 2015 +0200 @@ -28,7 +28,6 @@ import sun.misc.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; import com.oracle.graal.hotspot.nodes.*; @@ -55,7 +54,7 @@ AESCryptClass = Class.forName("com.sun.crypto.provider.AESCrypt", true, cl); kOffset = UnsafeAccess.unsafe.objectFieldOffset(AESCryptClass.getDeclaredField("K")); } catch (Exception ex) { - throw new GraalInternalError(ex); + throw new JVMCIError(ex); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CipherBlockChainingSubstitutions.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CipherBlockChainingSubstitutions.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CipherBlockChainingSubstitutions.java Mon May 25 23:30:34 2015 +0200 @@ -28,7 +28,6 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; import com.oracle.graal.hotspot.nodes.*; @@ -60,7 +59,7 @@ cipherBlockChainingClass = Class.forName("com.sun.crypto.provider.CipherBlockChaining", true, cl); rOffset = UnsafeAccess.unsafe.objectFieldOffset(cipherBlockChainingClass.getDeclaredField("r")); } catch (Exception ex) { - throw new GraalInternalError(ex); + throw new JVMCIError(ex); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java Mon May 25 23:30:34 2015 +0200 @@ -40,6 +40,7 @@ import com.oracle.graal.replacements.*; import com.oracle.graal.replacements.nodes.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.common.*; //JaCoCo Exclude @@ -819,7 +820,7 @@ try { return unsafe.objectFieldOffset(java.lang.ref.Reference.class.getDeclaredField("referent")); } catch (Exception e) { - throw new GraalInternalError(e); + throw new JVMCIError(e); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/IdentityHashCodeNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/IdentityHashCodeNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/IdentityHashCodeNode.java Mon May 25 23:30:34 2015 +0200 @@ -28,8 +28,8 @@ import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.jvmci.*; import com.oracle.graal.nodeinfo.*; +import com.oracle.graal.nodes.CallTargetNode.InvokeKind; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.CallTargetNode.InvokeKind; import com.oracle.graal.replacements.nodes.*; @NodeInfo diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/InstanceOfSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/InstanceOfSnippets.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/InstanceOfSnippets.java Mon May 25 23:30:34 2015 +0200 @@ -31,7 +31,6 @@ 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.hotspot.jvmci.*; import com.oracle.graal.hotspot.meta.*; @@ -50,6 +49,7 @@ import com.oracle.graal.replacements.SnippetTemplate.Arguments; import com.oracle.graal.replacements.SnippetTemplate.SnippetInfo; import com.oracle.graal.replacements.nodes.*; +import com.oracle.jvmci.common.*; /** * Snippets used for implementing the type test of an instanceof instruction. Since instanceof is a @@ -296,7 +296,7 @@ args.add("falseValue", replacer.falseValue); return args; } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Mon May 25 23:30:34 2015 +0200 @@ -36,7 +36,6 @@ import com.oracle.graal.api.code.*; 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.graph.Node.ConstantNodeParameter; @@ -62,6 +61,7 @@ import com.oracle.graal.replacements.SnippetTemplate.SnippetInfo; import com.oracle.graal.replacements.nodes.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.common.*; /** * Snippets used for implementing NEW, ANEWARRAY and NEWARRAY. @@ -101,7 +101,7 @@ case Total: return "bytes"; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneSnippets.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneSnippets.java Mon May 25 23:30:34 2015 +0200 @@ -26,11 +26,11 @@ import java.util.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.hotspot.replacements.arraycopy.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.replacements.*; +import com.oracle.jvmci.common.*; public class ObjectCloneSnippets implements Snippets { @@ -52,7 +52,7 @@ try { return ObjectCloneSnippets.class.getDeclaredMethod(name, param); } catch (SecurityException | NoSuchMethodException e) { - throw new GraalInternalError(e); + throw new JVMCIError(e); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ReflectionGetCallerClassNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ReflectionGetCallerClassNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ReflectionGetCallerClassNode.java Mon May 25 23:30:34 2015 +0200 @@ -23,7 +23,6 @@ package com.oracle.graal.hotspot.replacements; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.hotspot.jvmci.*; @@ -32,6 +31,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.replacements.nodes.*; +import com.oracle.jvmci.common.*; @NodeInfo public final class ReflectionGetCallerClassNode extends MacroStateSplitNode implements Canonicalizable, Lowerable { @@ -82,7 +82,7 @@ HotSpotResolvedJavaMethod method = (HotSpotResolvedJavaMethod) state.method(); switch (n) { case 0: - throw GraalInternalError.shouldNotReachHere("current frame state does not include the Reflection.getCallerClass frame"); + throw JVMCIError.shouldNotReachHere("current frame state does not include the Reflection.getCallerClass frame"); case 1: // Frame 0 and 1 must be caller sensitive (see JVM_GetCallerClass). if (!method.isCallerSensitive()) { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/UnsafeLoadSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/UnsafeLoadSnippets.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/UnsafeLoadSnippets.java Mon May 25 23:30:34 2015 +0200 @@ -28,7 +28,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.nodes.extended.*; -import com.oracle.graal.nodes.memory.HeapAccess.*; +import com.oracle.graal.nodes.memory.HeapAccess.BarrierType; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.replacements.*; import com.oracle.graal.replacements.SnippetTemplate.AbstractTemplates; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java Mon May 25 23:30:34 2015 +0200 @@ -33,13 +33,13 @@ import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; -import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.*; +import com.oracle.graal.hotspot.jvmci.HotSpotVMConfig.CompressEncoding; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.nodes.*; import com.oracle.graal.hotspot.nodes.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; -import com.oracle.graal.nodes.memory.HeapAccess.*; +import com.oracle.graal.nodes.memory.HeapAccess.BarrierType; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.replacements.*; import com.oracle.graal.replacements.Snippet.ConstantParameter; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopySnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopySnippets.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopySnippets.java Mon May 25 23:30:34 2015 +0200 @@ -33,7 +33,6 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; import com.oracle.graal.graph.*; @@ -55,6 +54,7 @@ import com.oracle.graal.replacements.SnippetTemplate.SnippetInfo; import com.oracle.graal.replacements.nodes.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.common.*; public class ArrayCopySnippets implements Snippets { @@ -307,13 +307,13 @@ super(providers, providers.getSnippetReflection(), target); } - private ResolvedJavaMethod originalArraycopy() throws GraalInternalError { + private ResolvedJavaMethod originalArraycopy() throws JVMCIError { if (originalArraycopy == null) { Method method; try { method = System.class.getDeclaredMethod("arraycopy", Object.class, int.class, Object.class, int.class, int.class); } catch (NoSuchMethodException | SecurityException e) { - throw new GraalInternalError(e); + throw new JVMCIError(e); } originalArraycopy = providers.getMetaAccess().lookupJavaMethod(method); } @@ -516,7 +516,7 @@ CallTargetNode call = invoke.callTarget(); if (!call.targetMethod().equals(originalArraycopy)) { - throw new GraalInternalError("unexpected invoke %s in snippet", call.targetMethod()); + throw new JVMCIError("unexpected invoke %s in snippet", call.targetMethod()); } // Here we need to fix the bci of the invoke InvokeNode newInvoke = graph.add(new InvokeNode(invoke.callTarget(), arraycopy.getBci())); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/DeoptimizationStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/DeoptimizationStub.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/DeoptimizationStub.java Mon May 25 23:30:34 2015 +0200 @@ -32,7 +32,6 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.asm.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; import com.oracle.graal.hotspot.*; @@ -42,6 +41,7 @@ import com.oracle.graal.replacements.*; import com.oracle.graal.replacements.Snippet.ConstantParameter; import com.oracle.graal.word.*; +import com.oracle.jvmci.common.*; /** * Deoptimization stub. @@ -103,7 +103,7 @@ case 1: return providers.getRegisters().getStackPointerRegister(); default: - throw GraalInternalError.shouldNotReachHere("unknown parameter " + name + " at index " + index); + throw JVMCIError.shouldNotReachHere("unknown parameter " + name + " at index " + index); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/SnippetStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/SnippetStub.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/SnippetStub.java Mon May 25 23:30:34 2015 +0200 @@ -27,7 +27,6 @@ import java.lang.reflect.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; import com.oracle.graal.graphbuilderconf.*; @@ -44,6 +43,7 @@ import com.oracle.graal.phases.tiers.*; import com.oracle.graal.replacements.*; import com.oracle.graal.replacements.Snippet.ConstantParameter; +import com.oracle.jvmci.common.*; /** * Base class for a stub defined by a snippet. @@ -147,7 +147,7 @@ } protected Object getConstantParameterValue(int index, String name) { - throw new GraalInternalError("%s must override getConstantParameterValue() to provide a value for parameter %d%s", getClass().getName(), index, name == null ? "" : " (" + name + ")"); + throw new JVMCIError("%s must override getConstantParameterValue() to provide a value for parameter %d%s", getClass().getName(), index, name == null ? "" : " (" + name + ")"); } @Override diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java Mon May 25 23:30:34 2015 +0200 @@ -29,7 +29,6 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.target.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; @@ -46,6 +45,7 @@ import com.oracle.graal.phases.*; import com.oracle.graal.phases.schedule.*; import com.oracle.graal.phases.tiers.*; +import com.oracle.jvmci.common.*; //JaCoCo Exclude @@ -198,7 +198,7 @@ int result = runtime.getCompilerToVM().installCode(hsCompResult, installedCode, null); HotSpotVMConfig config = runtime.getConfig(); if (result != config.codeInstallResultOk) { - throw new GraalInternalError("Error installing stub %s: %s", Stub.this, config.getCodeInstallResultDescription(result)); + throw new JVMCIError("Error installing stub %s: %s", Stub.this, config.getCodeInstallResultDescription(result)); } ((HotSpotCodeCacheProvider) codeCache).logOrDump(installedCode, compResult); code = installedCode; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/UncommonTrapStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/UncommonTrapStub.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/UncommonTrapStub.java Mon May 25 23:30:34 2015 +0200 @@ -30,7 +30,6 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.asm.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; import com.oracle.graal.hotspot.*; @@ -39,6 +38,7 @@ import com.oracle.graal.replacements.*; import com.oracle.graal.replacements.Snippet.ConstantParameter; import com.oracle.graal.word.*; +import com.oracle.jvmci.common.*; /** * Uncommon trap stub. @@ -102,7 +102,7 @@ case 1: return providers.getRegisters().getStackPointerRegister(); default: - throw GraalInternalError.shouldNotReachHere("unknown parameter " + name + " at index " + index); + throw JVMCIError.shouldNotReachHere("unknown parameter " + name + " at index " + index); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/MetaspacePointer.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/MetaspacePointer.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/MetaspacePointer.java Mon May 25 23:30:34 2015 +0200 @@ -26,7 +26,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.extended.*; -import com.oracle.graal.nodes.memory.HeapAccess.*; +import com.oracle.graal.nodes.memory.HeapAccess.BarrierType; import com.oracle.graal.word.*; import com.oracle.graal.word.Word.Opcode; import com.oracle.graal.word.Word.Operation; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.hotspotvmconfig.processor/src/com/oracle/graal/hotspotvmconfig/processor/HotSpotVMConfigProcessor.java --- a/graal/com.oracle.graal.hotspotvmconfig.processor/src/com/oracle/graal/hotspotvmconfig/processor/HotSpotVMConfigProcessor.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspotvmconfig.processor/src/com/oracle/graal/hotspotvmconfig/processor/HotSpotVMConfigProcessor.java Mon May 25 23:30:34 2015 +0200 @@ -34,8 +34,8 @@ import javax.tools.Diagnostic.Kind; import javax.tools.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.hotspotvmconfig.*; +import com.oracle.jvmci.common.*; @SupportedAnnotationTypes({"com.oracle.graal.hotspotvmconfig.HotSpotVMConstant", "com.oracle.graal.hotspotvmconfig.HotSpotVMFlag", "com.oracle.graal.hotspotvmconfig.HotSpotVMField", "com.oracle.graal.hotspotvmconfig.HotSpotVMType", "com.oracle.graal.hotspotvmconfig.HotSpotVMValue"}) @@ -262,7 +262,7 @@ setter = String.format("set_%s(\"%s\", (%s) (intptr_t) %s);", type, field.getSimpleName(), type, name); break; default: - throw new GraalInternalError("unexpected type: " + value.get()); + throw new JVMCIError("unexpected type: " + value.get()); } } @@ -325,7 +325,7 @@ case "sparc": return "defined(SPARC)"; default: - throw new GraalInternalError("unexpected arch: " + arch); + throw new JVMCIError("unexpected arch: " + arch); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.java/src/com/oracle/graal/java/DefaultSuitesProvider.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/DefaultSuitesProvider.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/DefaultSuitesProvider.java Mon May 25 23:30:34 2015 +0200 @@ -23,7 +23,7 @@ package com.oracle.graal.java; import com.oracle.graal.graphbuilderconf.*; -import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.*; +import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; import com.oracle.graal.lir.phases.*; import com.oracle.graal.options.*; import com.oracle.graal.options.DerivedOptionValue.OptionSupplier; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java Mon May 25 23:30:34 2015 +0200 @@ -29,7 +29,6 @@ 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.graphbuilderconf.IntrinsicContext.SideEffectsState; @@ -41,6 +40,7 @@ import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.common.*; public final class FrameStateBuilder implements SideEffectsState { @@ -224,7 +224,7 @@ return newFrameState; } if (bci == BytecodeFrame.INVALID_FRAMESTATE_BCI) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } if (pushedValues != null) { @@ -262,7 +262,7 @@ return FrameState.toBytecodePosition(outerFrameState); } if (bci == BytecodeFrame.INVALID_FRAMESTATE_BCI) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } return new BytecodePosition(outer, method, bci); } diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Mon May 25 23:30:34 2015 +0200 @@ -26,13 +26,13 @@ import static com.oracle.graal.api.meta.DeoptimizationAction.*; import static com.oracle.graal.api.meta.DeoptimizationReason.*; import static com.oracle.graal.bytecode.Bytecodes.*; -import static com.oracle.graal.compiler.common.GraalInternalError.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.compiler.common.type.StampFactory.*; import static com.oracle.graal.graphbuilderconf.IntrinsicContext.CompilationContext.*; import static com.oracle.graal.java.GraphBuilderPhase.Options.*; import static com.oracle.graal.nodes.StructuredGraph.*; import static com.oracle.graal.nodes.type.StampTool.*; +import static com.oracle.jvmci.common.JVMCIError.*; import static java.lang.String.*; import java.util.*; @@ -67,6 +67,7 @@ import com.oracle.graal.options.*; import com.oracle.graal.phases.*; import com.oracle.graal.phases.tiers.*; +import com.oracle.jvmci.common.*; /** * The {@code GraphBuilder} class parses the bytecode of a method and builds the IR graph. @@ -431,7 +432,7 @@ } @SuppressWarnings("serial") - public class BytecodeParserError extends GraalInternalError { + public class BytecodeParserError extends JVMCIError { public BytecodeParserError(Throwable cause) { super(cause); @@ -2836,7 +2837,7 @@ break; } default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -2878,7 +2879,7 @@ v = genFloatRem(x, y); break; default: - throw new GraalInternalError("should not reach"); + throw new JVMCIError("should not reach"); } frameState.push(result, append(v)); } @@ -2897,7 +2898,7 @@ v = genIntegerRem(x, y); break; default: - throw new GraalInternalError("should not reach"); + throw new JVMCIError("should not reach"); } frameState.push(result, append(v)); } @@ -2924,7 +2925,7 @@ v = genUnsignedRightShift(x, s); break; default: - throw new GraalInternalError("should not reach"); + throw new JVMCIError("should not reach"); } frameState.push(kind, append(v)); } @@ -2947,7 +2948,7 @@ v = genXor(x, y); break; default: - throw new GraalInternalError("should not reach"); + throw new JVMCIError("should not reach"); } frameState.push(kind, append(v)); } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.java/src/com/oracle/graal/java/LargeLocalLiveness.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/LargeLocalLiveness.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/LargeLocalLiveness.java Mon May 25 23:30:34 2015 +0200 @@ -24,7 +24,7 @@ import java.util.*; -import com.oracle.graal.java.BciBlockMapping.*; +import com.oracle.graal.java.BciBlockMapping.BciBlock; public final class LargeLocalLiveness extends LocalLiveness { private BitSet[] localsLiveIn; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.java/src/com/oracle/graal/java/LocalLiveness.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/LocalLiveness.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/LocalLiveness.java Mon May 25 23:30:34 2015 +0200 @@ -26,7 +26,7 @@ import com.oracle.graal.bytecode.*; import com.oracle.graal.debug.*; -import com.oracle.graal.java.BciBlockMapping.*; +import com.oracle.graal.java.BciBlockMapping.BciBlock; /** * Encapsulates the liveness calculation, so that subclasses for locals ≤ 64 and locals > 64 diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.java/src/com/oracle/graal/java/SmallLocalLiveness.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/SmallLocalLiveness.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/SmallLocalLiveness.java Mon May 25 23:30:34 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.java; -import com.oracle.graal.java.BciBlockMapping.*; +import com.oracle.graal.java.BciBlockMapping.BciBlock; public final class SmallLocalLiveness extends LocalLiveness { /* diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64AddressValue.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64AddressValue.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64AddressValue.java Mon May 25 23:30:34 2015 +0200 @@ -32,7 +32,8 @@ import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Address.Scale; import com.oracle.graal.lir.*; -import com.oracle.graal.lir.LIRInstruction.*; +import com.oracle.graal.lir.LIRInstruction.OperandFlag; +import com.oracle.graal.lir.LIRInstruction.OperandMode; public final class AMD64AddressValue extends CompositeValue { diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java Mon May 25 23:30:34 2015 +0200 @@ -33,12 +33,12 @@ import com.oracle.graal.asm.amd64.*; 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.jvmci.common.*; public class AMD64ControlFlow { @@ -172,7 +172,7 @@ masm.cmpptr(keyRegister, asObjectReg(scratch)); break; default: - throw new GraalInternalError("switch only supported for int, long and object"); + throw new JVMCIError("switch only supported for int, long and object"); } masm.jcc(intCond(condition), target); } @@ -354,7 +354,7 @@ masm.cmovq(cond, asRegister(result), asRegister(other)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } else { AMD64Address addr = (AMD64Address) crb.asAddress(other); @@ -370,7 +370,7 @@ masm.cmovq(cond, asRegister(result), addr); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } @@ -398,7 +398,7 @@ case BT: return ConditionFlag.Below; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -417,7 +417,7 @@ case GT: return ConditionFlag.Above; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -436,7 +436,7 @@ case NoOverflow: return true; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64MathIntrinsicOp.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64MathIntrinsicOp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64MathIntrinsicOp.java Mon May 25 23:30:34 2015 +0200 @@ -26,9 +26,9 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; +import com.oracle.jvmci.common.*; // @formatter:off public final class AMD64MathIntrinsicOp extends AMD64LIRInstruction { @@ -57,7 +57,7 @@ case SIN: masm.fsin(asDoubleReg(result), asDoubleReg(input)); break; case COS: masm.fcos(asDoubleReg(result), asDoubleReg(input)); break; case TAN: masm.ftan(asDoubleReg(result), asDoubleReg(input)); break; - default: throw GraalInternalError.shouldNotReachHere(); + default: throw JVMCIError.shouldNotReachHere(); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java Mon May 25 23:30:34 2015 +0200 @@ -34,11 +34,11 @@ import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MIOp; import com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.MoveOp; import com.oracle.graal.lir.StandardOp.NullCheck; import com.oracle.graal.lir.asm.*; +import com.oracle.jvmci.common.*; public class AMD64Move { @@ -286,7 +286,7 @@ masm.cmpxchgq(asRegister(newValue), address.toAddress()); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } @@ -323,7 +323,7 @@ masm.xaddq(address.toAddress(), asRegister(result)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } @@ -358,7 +358,7 @@ masm.xchgq(asRegister(result), address.toAddress()); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } @@ -374,13 +374,13 @@ } else if (isStackSlot(result)) { reg2stack(moveKind, crb, masm, result, input); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } else if (isStackSlot(input)) { if (isRegister(result)) { stack2reg(moveKind, crb, masm, result, input); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } else if (isConstant(input)) { if (isRegister(result)) { @@ -388,10 +388,10 @@ } else if (isStackSlot(result)) { const2stack(crb, masm, result, (JavaConstant) input); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -416,7 +416,7 @@ masm.movq(asRegister(result), asRegister(input)); break; default: - throw GraalInternalError.shouldNotReachHere("kind=" + result.getKind()); + throw JVMCIError.shouldNotReachHere("kind=" + result.getKind()); } } @@ -447,7 +447,7 @@ masm.movq(dest, asRegister(input)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -482,7 +482,7 @@ masm.movq(asRegister(result), src); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -559,7 +559,7 @@ } break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -584,11 +584,11 @@ if (input.isNull()) { imm = 0; } else { - throw GraalInternalError.shouldNotReachHere("Non-null object constants must be in register"); + throw JVMCIError.shouldNotReachHere("Non-null object constants must be in register"); } break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } switch (result.getKind()) { case Byte: @@ -610,7 +610,7 @@ masm.movlong(dest, imm); break; default: - throw GraalInternalError.shouldNotReachHere("Unknown result Kind: " + result.getKind()); + throw JVMCIError.shouldNotReachHere("Unknown result Kind: " + result.getKind()); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ShiftOp.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ShiftOp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ShiftOp.java Mon May 25 23:30:34 2015 +0200 @@ -27,9 +27,9 @@ import com.oracle.graal.amd64.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MOp; import com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize; +import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/LIRTest.java --- a/graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/LIRTest.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/LIRTest.java Mon May 25 23:30:34 2015 +0200 @@ -28,7 +28,6 @@ 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.graph.*; import com.oracle.graal.graphbuilderconf.*; @@ -39,6 +38,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.common.*; /** * Base class for LIR tests. @@ -76,7 +76,7 @@ } private static void defaultHandler(@SuppressWarnings("unused") LIRGeneratorTool gen, Value... args) { - throw new GraalInternalError("LIRTestSpecification cannot handle generate() with %d arguments", args.length); + throw new JVMCIError("LIRTestSpecification cannot handle generate() with %d arguments", args.length); } void generate(LIRGeneratorTool gen, Value[] values) { @@ -93,7 +93,7 @@ } else if (values.length == 5) { generate(gen, values[0], values[1], values[2], values[3], values[4]); } else { - GraalInternalError.unimplemented(); + JVMCIError.unimplemented(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java Mon May 25 23:30:34 2015 +0200 @@ -37,12 +37,13 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.sparc.*; -import com.oracle.graal.asm.sparc.SPARCMacroAssembler.*; -import com.oracle.graal.compiler.common.*; +import com.oracle.graal.asm.sparc.SPARCMacroAssembler.ScratchRegister; +import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Setx; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.sparc.*; +import com.oracle.jvmci.common.*; public enum SPARCArithmetic { // @formatter:off @@ -262,7 +263,7 @@ masm.mulx(asIntReg(src1), constant, asIntReg(dst)); break; case IMULCC: - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); case IDIV: masm.sra(asRegister(src1), 0, asRegister(src1)); masm.sdivx(asIntReg(src1), constant, asIntReg(dst)); @@ -338,7 +339,7 @@ case DMUL: case DDIV: default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } if (info != null) { assert exceptionOffset != -1; @@ -431,7 +432,7 @@ masm.srl(asIntReg(src1), asIntReg(src2), asIntReg(dst)); break; case IREM: - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); case LADD: delaySlotLir.emitControlTransfer(crb, masm); masm.add(asLongReg(src1), asLongReg(src2), asLongReg(dst)); @@ -453,7 +454,7 @@ masm.mulx(asLongReg(src1), asLongReg(src2), asLongReg(dst)); break; case LMULCC: - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); case LDIV: delaySlotLir.emitControlTransfer(crb, masm); exceptionOffset = masm.position(); @@ -510,7 +511,7 @@ masm.fdivs(asFloatReg(src1), asFloatReg(src2), asFloatReg(dst)); break; case FREM: - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); case DADD: delaySlotLir.emitControlTransfer(crb, masm); masm.faddd(asDoubleReg(src1), asDoubleReg(src2), asDoubleReg(dst)); @@ -529,13 +530,13 @@ masm.fdivd(asDoubleReg(src1), asDoubleReg(src2), asDoubleReg(dst)); break; case DREM: - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); case DAND: delaySlotLir.emitControlTransfer(crb, masm); masm.fandd(asDoubleReg(src1), asDoubleReg(src2), asDoubleReg(dst)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } if (info != null) { assert exceptionOffset != -1; @@ -575,10 +576,10 @@ masm.sub(asLongReg(src1), asLongReg(scratch2), asLongReg(dst)); break; case IUREM: - GraalInternalError.unimplemented(); + JVMCIError.unimplemented(); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } else if (isRegister(src1) && isRegister(src2)) { Value srcLeft = src1; @@ -637,10 +638,10 @@ masm.sub(asIntReg(scratch1), asIntReg(dst), asIntReg(dst)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } if (info != null) { assert exceptionOffset != -1; @@ -761,7 +762,7 @@ masm.fnegd(asDoubleReg(src), asDoubleReg(dst)); break; default: - throw GraalInternalError.shouldNotReachHere("missing: " + opcode); + throw JVMCIError.shouldNotReachHere("missing: " + opcode); } if (info != null) { assert exceptionOffset != -1; @@ -850,7 +851,7 @@ assert rk == Kind.Double && xk == Kind.Double && yk == Kind.Double : "opcode=" + opcode + ", result kind=" + rk + ", x kind=" + xk + ", y kind=" + yk; break; default: - throw GraalInternalError.shouldNotReachHere("missing: " + opcode); + throw JVMCIError.shouldNotReachHere("missing: " + opcode); } } @@ -905,7 +906,7 @@ masm.umulxhi(asLongReg(x), asLongReg(y), asLongReg(result)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCBitManipulationOp.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCBitManipulationOp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCBitManipulationOp.java Mon May 25 23:30:34 2015 +0200 @@ -30,10 +30,10 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.gen.*; +import com.oracle.jvmci.common.*; public final class SPARCBitManipulationOp extends SPARCLIRInstruction { public static final LIRInstructionClass TYPE = LIRInstructionClass.create(SPARCBitManipulationOp.class); @@ -85,7 +85,7 @@ masm.andn(dst, src, dst); masm.popc(dst, dst); } else { - throw GraalInternalError.shouldNotReachHere("missing: " + tkind); + throw JVMCIError.shouldNotReachHere("missing: " + tkind); } break; case IBSR: { @@ -130,7 +130,7 @@ break; } default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } else if (isConstant(input) && isSimm13(crb.asIntConst(input))) { @@ -142,10 +142,10 @@ masm.popc(crb.asIntConst(input), dst); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCByteSwapOp.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCByteSwapOp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCByteSwapOp.java Mon May 25 23:30:34 2015 +0200 @@ -29,10 +29,10 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCAssembler.Asi; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.gen.*; +import com.oracle.jvmci.common.*; @Opcode("BSWAP") public final class SPARCByteSwapOp extends SPARCLIRInstruction implements SPARCTailDelayedLIRInstruction { @@ -69,7 +69,7 @@ masm.ldxa(addr.getBase(), addr.getIndex(), asLongReg(result), Asi.ASI_PRIMARY_LITTLE); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCall.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCall.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCall.java Mon May 25 23:30:34 2015 +0200 @@ -30,9 +30,9 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Sethix; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; +import com.oracle.jvmci.common.*; public class SPARCCall { @@ -96,7 +96,7 @@ } else if (after - before == 8) { // everything is fine; } else { - GraalInternalError.shouldNotReachHere("" + (after - before)); + JVMCIError.shouldNotReachHere("" + (after - before)); } after = masm.position(); crb.recordDirectCall(before, after, callTarget, state); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCompare.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCompare.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCompare.java Mon May 25 23:30:34 2015 +0200 @@ -30,10 +30,10 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.sparc.SPARCControlFlow.CompareBranchOp; +import com.oracle.jvmci.common.*; public enum SPARCCompare { ICMP, @@ -98,7 +98,7 @@ masm.fcmp(Fcc0, Fcmpd, asDoubleReg(x), asDoubleReg(y)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } else { assert isConstant(y); @@ -116,7 +116,7 @@ masm.cmp(asObjectReg(x), 0); break; } else { - throw GraalInternalError.shouldNotReachHere("Only null object constants are allowed in comparisons"); + throw JVMCIError.shouldNotReachHere("Only null object constants are allowed in comparisons"); } case FCMP: masm.fcmp(Fcc0, Fcmps, asFloatReg(x), asFloatReg(y)); @@ -125,7 +125,7 @@ masm.fcmp(Fcc0, Fcmpd, asDoubleReg(x), asDoubleReg(y)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCControlFlow.java Mon May 25 23:30:34 2015 +0200 @@ -43,13 +43,13 @@ import com.oracle.graal.asm.sparc.SPARCAssembler.ConditionFlag; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.ScratchRegister; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Setx; -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.sparc.SPARC.CPUFeature; +import com.oracle.jvmci.common.*; public class SPARCControlFlow { @@ -260,7 +260,7 @@ } break; default: - GraalInternalError.shouldNotReachHere(); + JVMCIError.shouldNotReachHere(); } } @@ -439,7 +439,7 @@ break; } default: - throw new GraalInternalError("switch only supported for int, long and object"); + throw new JVMCIError("switch only supported for int, long and object"); } ConditionFlag conditionFlag = ConditionFlag.fromCondtition(conditionCode, condition, false); masm.cmp(keyRegister, scratchRegister); @@ -600,7 +600,7 @@ masm.fmovdcc(cond, cc, asDoubleReg(other), asDoubleReg(result)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCJumpOp.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCJumpOp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCJumpOp.java Mon May 25 23:30:34 2015 +0200 @@ -24,7 +24,7 @@ import static com.oracle.graal.asm.sparc.SPARCAssembler.Annul.*; -import com.oracle.graal.asm.sparc.SPARCAssembler.*; +import com.oracle.graal.asm.sparc.SPARCAssembler.ConditionFlag; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.JumpOp; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMathIntrinsicOp.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMathIntrinsicOp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMathIntrinsicOp.java Mon May 25 23:30:34 2015 +0200 @@ -26,9 +26,9 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; +import com.oracle.jvmci.common.*; public final class SPARCMathIntrinsicOp extends SPARCLIRInstruction implements SPARCTailDelayedLIRInstruction { public static final LIRInstructionClass TYPE = LIRInstructionClass.create(SPARCMathIntrinsicOp.class); @@ -63,7 +63,7 @@ masm.fsqrtd(asDoubleReg(input), asDoubleReg(result)); break; default: - GraalInternalError.shouldNotReachHere(); + JVMCIError.shouldNotReachHere(); } break; case ABS: @@ -75,11 +75,11 @@ masm.fabsd(asDoubleReg(input), asDoubleReg(result)); break; default: - GraalInternalError.shouldNotReachHere(); + JVMCIError.shouldNotReachHere(); } break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java Mon May 25 23:30:34 2015 +0200 @@ -33,7 +33,6 @@ import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.ScratchRegister; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Setx; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.ImplicitNullCheck; import com.oracle.graal.lir.StandardOp.MoveOp; @@ -41,6 +40,7 @@ import com.oracle.graal.lir.asm.*; import com.oracle.graal.sparc.*; import com.oracle.graal.sparc.SPARC.CPUFeature; +import com.oracle.jvmci.common.*; public class SPARCMove { @@ -160,11 +160,11 @@ } else if (resultKindSize == 1) { masm.stb(asIntReg(input), tempAddress); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } break; default: - GraalInternalError.shouldNotReachHere(); + JVMCIError.shouldNotReachHere(); } delayedControlTransfer.emitControlTransfer(crb, masm); switch (resultKind) { @@ -190,7 +190,7 @@ masm.lddf(tempAddress, asDoubleReg(result)); break; default: - GraalInternalError.shouldNotReachHere(); + JVMCIError.shouldNotReachHere(); break; } } @@ -230,7 +230,7 @@ if (inputKind == Int || inputKind == Short || inputKind == Char || inputKind == Byte) { masm.movwtos(asIntReg(input), asFloatReg(result)); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } else if (resultKind == Double) { if (inputKind == Int || inputKind == Short || inputKind == Char || inputKind == Byte) { @@ -248,7 +248,7 @@ if (resultKind == Long) { masm.movdtox(asDoubleReg(input), asLongReg(result)); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } @@ -304,7 +304,7 @@ case Double: return StackSlot.get(LIRKind.value(Kind.Long), slot.getRawOffset(), slot.getRawAddFrameSize()); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } @@ -534,7 +534,7 @@ super(TYPE, kind, address, state); this.input = input; if (!input.isDefaultForKind()) { - throw GraalInternalError.shouldNotReachHere("Can only store null constants to memory"); + throw JVMCIError.shouldNotReachHere("Can only store null constants to memory"); } } @@ -565,9 +565,9 @@ break; case Float: case Double: - throw GraalInternalError.shouldNotReachHere("Cannot store float constants to memory"); + throw JVMCIError.shouldNotReachHere("Cannot store float constants to memory"); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } @@ -581,14 +581,14 @@ SPARCAddress resultAddress = (SPARCAddress) crb.asAddress(result); emitStore(input, resultAddress, input.getPlatformKind(), delaySlotLir, null, crb, masm); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } else if (isStackSlot(input)) { if (isRegister(result)) { SPARCAddress inputAddress = (SPARCAddress) crb.asAddress(input); emitLoad(inputAddress, result, false, input.getPlatformKind(), delaySlotLir, null, crb, masm); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } else if (isConstant(input)) { JavaConstant constant = asConstant(input); @@ -612,10 +612,10 @@ } } } else { - throw GraalInternalError.shouldNotReachHere("Result is a: " + result); + throw JVMCIError.shouldNotReachHere("Result is a: " + result); } } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -640,18 +640,18 @@ if (result.getPlatformKind() == Kind.Float) { masm.fmovs(src, dst); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } break; case Double: if (result.getPlatformKind() == Kind.Double) { masm.fmovd(src, dst); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } break; default: - throw GraalInternalError.shouldNotReachHere("Input is a: " + input.getKind()); + throw JVMCIError.shouldNotReachHere("Input is a: " + input.getKind()); } } @@ -771,11 +771,11 @@ crb.recordInlineDataInCode(input); // relocatable cannot be delayed new Setx(0xDEADDEADDEADDEADL, resultRegister, true).emit(masm); } else { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } break; default: - throw GraalInternalError.shouldNotReachHere("missing: " + input.getKind()); + throw JVMCIError.shouldNotReachHere("missing: " + input.getKind()); } } } @@ -792,7 +792,7 @@ masm.casx(asRegister(address), asRegister(cmpValue), asRegister(newValue)); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCTestOp.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCTestOp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCTestOp.java Mon May 25 23:30:34 2015 +0200 @@ -28,9 +28,9 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; +import com.oracle.jvmci.common.*; public class SPARCTestOp extends SPARCLIRInstruction { public static final LIRInstructionClass TYPE = LIRInstructionClass.create(SPARCTestOp.class); @@ -59,7 +59,7 @@ masm.andcc(asLongReg(x), asLongReg(y), g0); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } else if (isConstant(y)) { switch (x.getKind()) { @@ -74,10 +74,10 @@ masm.andcc(asLongReg(x), crb.asIntConst(y), g0); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/CompositeValueClass.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/CompositeValueClass.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/CompositeValueClass.java Mon May 25 23:30:34 2015 +0200 @@ -31,6 +31,7 @@ import com.oracle.graal.lir.LIRIntrospection.LIRFieldsScanner; import com.oracle.graal.lir.LIRIntrospection.OperandModeAnnotation; import com.oracle.graal.lir.LIRIntrospection.Values; +import com.oracle.jvmci.common.*; /** * Lazily associated metadata for every {@link CompositeValue} type. The metadata includes: @@ -86,7 +87,7 @@ if (field.isAnnotationPresent(CompositeValue.Component.class)) { result.addAll(Arrays.asList(field.getAnnotation(CompositeValue.Component.class).value())); } else { - GraalInternalError.shouldNotReachHere(); + JVMCIError.shouldNotReachHere(); } return result; } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java Mon May 25 23:30:34 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.lir; +import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; +import static com.oracle.graal.lir.LIRInstruction.OperandMode.*; + import java.lang.annotation.*; import java.util.*; -import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import static com.oracle.graal.lir.LIRInstruction.OperandMode.*; - import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.debug.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstructionClass.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstructionClass.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstructionClass.java Mon May 25 23:30:34 2015 +0200 @@ -30,6 +30,7 @@ import com.oracle.graal.compiler.common.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; import com.oracle.graal.lir.LIRInstruction.OperandMode; +import com.oracle.jvmci.common.*; public class LIRInstructionClass extends LIRIntrospection { @@ -121,7 +122,7 @@ } else if (field.isAnnotationPresent(LIRInstruction.Def.class)) { result.addAll(Arrays.asList(field.getAnnotation(LIRInstruction.Def.class).value())); } else { - GraalInternalError.shouldNotReachHere(); + JVMCIError.shouldNotReachHere(); } return result; } @@ -197,7 +198,7 @@ case DEF: return defs; default: - throw GraalInternalError.shouldNotReachHere("unknown OperandMode: " + mode); + throw JVMCIError.shouldNotReachHere("unknown OperandMode: " + mode); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRVerifier.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRVerifier.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRVerifier.java Mon May 25 23:30:34 2015 +0200 @@ -29,13 +29,13 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.debug.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; import com.oracle.graal.lir.LIRInstruction.OperandMode; import com.oracle.graal.lir.framemap.*; import com.oracle.graal.lir.ssa.*; +import com.oracle.jvmci.common.*; public final class LIRVerifier { @@ -169,7 +169,7 @@ TTY.println("definition of %s: %s", value, variableDefinitions[variableIdx]); } TTY.println("ERROR: Use of variable %s that is not defined in dominator", value); - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } else if (isAllocatableRegister(value)) { @@ -182,7 +182,7 @@ TTY.println("block %s instruction %s", curBlock, curInstruction); TTY.println("live registers: %s", Arrays.toString(curRegistersLive)); TTY.println("ERROR: Use of fixed register %s that is not defined in this block", value); - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } @@ -199,7 +199,7 @@ TTY.println("live variables: %s", curVariablesLive); TTY.println("definition of %s: %s", value, variableDefinitions[variableIdx]); TTY.println("ERROR: Variable %s defined multiple times", value); - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } assert curInstruction != null; variableDefinitions[variableIdx] = curInstruction; @@ -213,7 +213,7 @@ if (curRegistersDefined.get(regNum)) { TTY.println("block %s instruction %s", curBlock, curInstruction); TTY.println("ERROR: Same register defined twice in the same instruction: %s", value); - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } curRegistersDefined.set(regNum); @@ -236,7 +236,7 @@ (isIllegal(value) && flags.contains(OperandFlag.ILLEGAL))) { return; } - throw new GraalInternalError("Invalid LIR%n Instruction: %s%n Mode: %s%n Flags: %s%n Unexpected value: %s %s", + throw new JVMCIError("Invalid LIR%n Instruction: %s%n Mode: %s%n Flags: %s%n Unexpected value: %s %s", op, mode, flags, value.getClass().getSimpleName(), value); } // @formatter:on diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/StandardOp.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/StandardOp.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/StandardOp.java Mon May 25 23:30:34 2015 +0200 @@ -30,10 +30,10 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.framemap.*; +import com.oracle.jvmci.common.*; /** * A collection of machine-independent LIR operations, as well as interfaces to be implemented for @@ -258,7 +258,7 @@ @Override public void emitCode(CompilationResultBuilder crb) { if (block != null) { - throw new GraalInternalError(this + " should have been replaced"); + throw new JVMCIError(this + " should have been replaced"); } } } @@ -294,7 +294,7 @@ @Override public void emitCode(CompilationResultBuilder crb) { - throw new GraalInternalError(this + " should have been removed"); + throw new JVMCIError(this + " should have been removed"); } @Override diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/Interval.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/Interval.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/Interval.java Mon May 25 23:30:34 2015 +0200 @@ -30,10 +30,10 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.util.*; import com.oracle.graal.debug.*; import com.oracle.graal.lir.*; +import com.oracle.jvmci.common.*; /** * Represents an interval in the {@linkplain LinearScan linear scan register allocator}. @@ -95,7 +95,7 @@ case Stack: return stack; } - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } /** @@ -873,7 +873,7 @@ Interval lastChild = splitChildren.get(splitChildren.size() - 1); msg.append(" (first = ").append(firstChild).append(", last = ").append(lastChild).append(")"); } - throw new GraalInternalError("Linear Scan Error: %s", msg); + throw new JVMCIError("Linear Scan Error: %s", msg); } if (!splitChildren.isEmpty()) { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/IntervalWalker.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/IntervalWalker.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/IntervalWalker.java Mon May 25 23:30:34 2015 +0200 @@ -23,7 +23,9 @@ package com.oracle.graal.lir.alloc.lsra; import com.oracle.graal.debug.*; -import com.oracle.graal.lir.alloc.lsra.Interval.*; +import com.oracle.graal.lir.alloc.lsra.Interval.RegisterBinding; +import com.oracle.graal.lir.alloc.lsra.Interval.RegisterBindingLists; +import com.oracle.graal.lir.alloc.lsra.Interval.State; /** */ diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java Mon May 25 23:30:34 2015 +0200 @@ -31,7 +31,6 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.alloc.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.debug.*; @@ -45,6 +44,7 @@ import com.oracle.graal.lir.gen.LIRGeneratorTool.SpillMoveFactory; import com.oracle.graal.lir.phases.AllocationPhase.AllocationContext; import com.oracle.graal.options.*; +import com.oracle.jvmci.common.*; /** * An implementation of the linear scan register allocator algorithm described in = r.to) { Debug.log("Interval %d has zero length range", i1.operandNumber); Debug.log(i1.logString(this)); - throw new GraalInternalError(""); + throw new JVMCIError(""); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanAssignLocationsPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanAssignLocationsPhase.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanAssignLocationsPhase.java Mon May 25 23:30:34 2015 +0200 @@ -33,10 +33,11 @@ import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.debug.*; import com.oracle.graal.lir.*; -import com.oracle.graal.lir.LIRInstruction.*; -import com.oracle.graal.lir.StandardOp.*; +import com.oracle.graal.lir.LIRInstruction.OperandFlag; +import com.oracle.graal.lir.LIRInstruction.OperandMode; +import com.oracle.graal.lir.StandardOp.MoveOp; import com.oracle.graal.lir.gen.*; -import com.oracle.graal.lir.gen.LIRGeneratorTool.*; +import com.oracle.graal.lir.gen.LIRGeneratorTool.SpillMoveFactory; import com.oracle.graal.lir.phases.*; /** diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java Mon May 25 23:30:34 2015 +0200 @@ -33,11 +33,11 @@ import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.debug.*; import com.oracle.graal.lir.*; -import com.oracle.graal.lir.StandardOp.*; -import com.oracle.graal.lir.alloc.lsra.Interval.*; -import com.oracle.graal.lir.alloc.lsra.LinearScan.*; +import com.oracle.graal.lir.StandardOp.MoveOp; +import com.oracle.graal.lir.alloc.lsra.Interval.SpillState; +import com.oracle.graal.lir.alloc.lsra.LinearScan.IntervalPredicate; import com.oracle.graal.lir.gen.*; -import com.oracle.graal.lir.gen.LIRGeneratorTool.*; +import com.oracle.graal.lir.gen.LIRGeneratorTool.SpillMoveFactory; import com.oracle.graal.lir.phases.*; class LinearScanEliminateSpillMovePhase extends AllocationPhase { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java Mon May 25 23:30:34 2015 +0200 @@ -31,7 +31,6 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.alloc.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.compiler.common.util.*; @@ -48,6 +47,7 @@ import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.gen.LIRGeneratorTool.SpillMoveFactory; import com.oracle.graal.lir.phases.*; +import com.oracle.jvmci.common.*; class LinearScanLifetimeAnalysisPhase extends AllocationPhase { @@ -345,7 +345,7 @@ reportFailure(numBlocks); } // bailout if this occurs in product mode. - throw new GraalInternalError("liveIn set of first block must be empty: " + allocator.getBlockData(startBlock).liveIn); + throw new JVMCIError("liveIn set of first block must be empty: " + allocator.getBlockData(startBlock).liveIn); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java Mon May 25 23:30:34 2015 +0200 @@ -28,7 +28,7 @@ import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.debug.*; import com.oracle.graal.lir.gen.*; -import com.oracle.graal.lir.gen.LIRGeneratorTool.*; +import com.oracle.graal.lir.gen.LIRGeneratorTool.SpillMoveFactory; import com.oracle.graal.lir.phases.*; final class LinearScanRegisterAllocationPhase extends AllocationPhase { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanWalker.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanWalker.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanWalker.java Mon May 25 23:30:34 2015 +0200 @@ -35,7 +35,10 @@ import com.oracle.graal.debug.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.MoveOp; -import com.oracle.graal.lir.alloc.lsra.Interval.*; +import com.oracle.graal.lir.alloc.lsra.Interval.RegisterBinding; +import com.oracle.graal.lir.alloc.lsra.Interval.RegisterPriority; +import com.oracle.graal.lir.alloc.lsra.Interval.SpillState; +import com.oracle.graal.lir.alloc.lsra.Interval.State; /** */ diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/MoveResolver.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/MoveResolver.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/MoveResolver.java Mon May 25 23:30:34 2015 +0200 @@ -29,9 +29,9 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; import com.oracle.graal.lir.*; +import com.oracle.jvmci.common.*; /** */ @@ -53,7 +53,7 @@ if (isRegister(location)) { registerBlocked[asRegister(location).number] += direction; } else { - throw GraalInternalError.shouldNotReachHere("unhandled value " + location); + throw JVMCIError.shouldNotReachHere("unhandled value " + location); } } @@ -61,7 +61,7 @@ if (isRegister(location)) { return registerBlocked[asRegister(location).number]; } - throw GraalInternalError.shouldNotReachHere("unhandled value " + location); + throw JVMCIError.shouldNotReachHere("unhandled value " + location); } void setMultipleReadsAllowed() { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/OptimizingLinearScanWalker.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/OptimizingLinearScanWalker.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/OptimizingLinearScanWalker.java Mon May 25 23:30:34 2015 +0200 @@ -29,7 +29,9 @@ import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; -import com.oracle.graal.lir.alloc.lsra.Interval.*; +import com.oracle.graal.lir.alloc.lsra.Interval.RegisterBinding; +import com.oracle.graal.lir.alloc.lsra.Interval.RegisterBindingLists; +import com.oracle.graal.lir.alloc.lsra.Interval.State; import com.oracle.graal.options.*; public class OptimizingLinearScanWalker extends LinearScanWalker { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/RegisterVerifier.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/RegisterVerifier.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/RegisterVerifier.java Mon May 25 23:30:34 2015 +0200 @@ -28,13 +28,13 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.compiler.common.util.*; import com.oracle.graal.debug.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; import com.oracle.graal.lir.LIRInstruction.OperandMode; +import com.oracle.jvmci.common.*; /** */ @@ -179,7 +179,7 @@ static boolean checkState(Interval[] inputState, Value reg, Interval interval) { if (reg != null && isRegister(reg)) { if (inputState[asRegister(reg).number] != interval) { - throw new GraalInternalError("!! Error in register allocation: register %s does not contain interval %s but interval %s", reg, interval.operand, inputState[asRegister(reg).number]); + throw new JVMCIError("!! Error in register allocation: register %s does not contain interval %s but interval %s", reg, interval.operand, inputState[asRegister(reg).number]); } } return true; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinearScanLifetimeAnalysisPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinearScanLifetimeAnalysisPhase.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinearScanLifetimeAnalysisPhase.java Mon May 25 23:30:34 2015 +0200 @@ -27,8 +27,9 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.debug.*; import com.oracle.graal.lir.*; -import com.oracle.graal.lir.LIRInstruction.*; -import com.oracle.graal.lir.StandardOp.*; +import com.oracle.graal.lir.LIRInstruction.OperandFlag; +import com.oracle.graal.lir.LIRInstruction.OperandMode; +import com.oracle.graal.lir.StandardOp.LabelOp; import com.oracle.graal.lir.ssa.*; public class SSALinearScanLifetimeAnalysisPhase extends LinearScanLifetimeAnalysisPhase { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/CompilationResultBuilder.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/CompilationResultBuilder.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/CompilationResultBuilder.java Mon May 25 23:30:34 2015 +0200 @@ -33,12 +33,12 @@ import com.oracle.graal.api.code.DataSection.DataBuilder; import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.debug.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.framemap.*; import com.oracle.graal.options.*; +import com.oracle.jvmci.common.*; /** * Fills in a {@link CompilationResult} as its code is being assembled. @@ -214,7 +214,7 @@ assert !codeCache.needsDataPatch(constant) : constant + " should be in a DataPatch"; long c = constant.asLong(); if (!NumUtil.isInt(c)) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } return (int) c; } @@ -370,7 +370,7 @@ try { emitOp(this, op); - } catch (GraalInternalError e) { + } catch (JVMCIError e) { throw e.addContext("lir instruction", block + "@" + op.id() + " " + op + "\n" + lir.codeEmittingOrder()); } } @@ -380,9 +380,9 @@ try { op.emitCode(crb); } catch (AssertionError t) { - throw new GraalInternalError(t); + throw new JVMCIError(t); } catch (RuntimeException t) { - throw new GraalInternalError(t); + throw new JVMCIError(t); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMapBuilderImpl.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMapBuilderImpl.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMapBuilderImpl.java Mon May 25 23:30:34 2015 +0200 @@ -28,7 +28,6 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; @@ -37,6 +36,7 @@ import com.oracle.graal.lir.LIRInstruction.OperandMode; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.stackslotalloc.*; +import com.oracle.jvmci.common.*; /** * A FrameMapBuilder that records allocation. @@ -71,7 +71,7 @@ return null; } if (outObjectStackSlots != null) { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } VirtualStackSlotRange slot = new VirtualStackSlotRange(numStackSlots++, slots, objects); stackSlots.add(slot); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/DefaultLIRKindTool.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/DefaultLIRKindTool.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/DefaultLIRKindTool.java Mon May 25 23:30:34 2015 +0200 @@ -23,8 +23,8 @@ package com.oracle.graal.lir.gen; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.spi.*; +import com.oracle.jvmci.common.*; /** * Default implementation of {@link LIRKindTool}. Returns the normal Java kind for primitive types. @@ -58,7 +58,7 @@ case 64: return LIRKind.value(Kind.Double); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java Mon May 25 23:30:34 2015 +0200 @@ -30,7 +30,6 @@ import com.oracle.graal.api.code.*; 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.*; @@ -40,6 +39,7 @@ import com.oracle.graal.lir.StandardOp.BlockEndOp; import com.oracle.graal.lir.StandardOp.LabelOp; import com.oracle.graal.options.*; +import com.oracle.jvmci.common.*; /** * This class traverses the HIR instructions and generates LIR instructions from them. @@ -279,7 +279,7 @@ } else if (isStackSlot(value)) { return StackSlot.get(stackKind, asStackSlot(value).getRawOffset(), asStackSlot(value).getRawAddFrameSize()); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } return value; @@ -413,10 +413,10 @@ } public LIRInstruction createBenchmarkCounter(String name, String group, Value increment) { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } public LIRInstruction createMultiBenchmarkCounter(String[] names, String[] groups, Value[] increments) { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGeneratorTool.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGeneratorTool.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGeneratorTool.java Mon May 25 23:30:34 2015 +0200 @@ -24,12 +24,12 @@ 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.common.spi.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.StackMove; +import com.oracle.jvmci.common.*; public interface LIRGeneratorTool extends ArithmeticLIRGenerator, BenchmarkCounterFactory { @@ -87,7 +87,7 @@ * @param delta the value to be added */ default Value emitAtomicReadAndAdd(Value address, Value delta) { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } /** @@ -97,7 +97,7 @@ * @param newValue the new value to be written */ default Value emitAtomicReadAndWrite(Value address, Value newValue) { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } void emitDeoptimize(Value actionAndReason, Value failedSpeculation, LIRFrameState state); @@ -205,12 +205,12 @@ @SuppressWarnings("unused") default Value emitCountLeadingZeros(Value value) { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } @SuppressWarnings("unused") default Value emitCountTrailingZeros(Value value) { - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/PhiResolver.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/PhiResolver.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/PhiResolver.java Mon May 25 23:30:34 2015 +0200 @@ -32,7 +32,7 @@ import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; -import com.oracle.graal.lir.gen.LIRGeneratorTool.*; +import com.oracle.graal.lir.gen.LIRGeneratorTool.SpillMoveFactory; /** * Converts phi instructions into moves. diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/AllocationPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/AllocationPhase.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/AllocationPhase.java Mon May 25 23:30:34 2015 +0200 @@ -27,7 +27,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.gen.*; -import com.oracle.graal.lir.gen.LIRGeneratorTool.*; +import com.oracle.graal.lir.gen.LIRGeneratorTool.SpillMoveFactory; public abstract class AllocationPhase extends LIRPhase { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/AllocationStage.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/AllocationStage.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/AllocationStage.java Mon May 25 23:30:34 2015 +0200 @@ -23,7 +23,7 @@ package com.oracle.graal.lir.phases; import com.oracle.graal.lir.alloc.lsra.*; -import com.oracle.graal.lir.phases.AllocationPhase.*; +import com.oracle.graal.lir.phases.AllocationPhase.AllocationContext; import com.oracle.graal.lir.stackslotalloc.*; public class AllocationStage extends LIRPhaseSuite { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/EconomyAllocationStage.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/EconomyAllocationStage.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/EconomyAllocationStage.java Mon May 25 23:30:34 2015 +0200 @@ -23,7 +23,7 @@ package com.oracle.graal.lir.phases; import com.oracle.graal.lir.alloc.lsra.*; -import com.oracle.graal.lir.phases.AllocationPhase.*; +import com.oracle.graal.lir.phases.AllocationPhase.AllocationContext; import com.oracle.graal.lir.stackslotalloc.*; public class EconomyAllocationStage extends LIRPhaseSuite { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/EconomyPostAllocationOptimizationStage.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/EconomyPostAllocationOptimizationStage.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/EconomyPostAllocationOptimizationStage.java Mon May 25 23:30:34 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.lir.phases; -import com.oracle.graal.lir.phases.PostAllocationOptimizationPhase.*; +import com.oracle.graal.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext; public class EconomyPostAllocationOptimizationStage extends LIRPhaseSuite { public EconomyPostAllocationOptimizationStage() { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/EconomyPreAllocationOptimizationStage.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/EconomyPreAllocationOptimizationStage.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/EconomyPreAllocationOptimizationStage.java Mon May 25 23:30:34 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.lir.phases; -import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.*; +import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; public class EconomyPreAllocationOptimizationStage extends LIRPhaseSuite { public EconomyPreAllocationOptimizationStage() { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRSuites.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRSuites.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRSuites.java Mon May 25 23:30:34 2015 +0200 @@ -25,9 +25,9 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.gen.*; -import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; +import com.oracle.graal.lir.phases.AllocationPhase.AllocationContext; import com.oracle.graal.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext; -import com.oracle.graal.lir.phases.AllocationPhase.AllocationContext; +import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; public class LIRSuites { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/profiling/MoveProfiling.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/profiling/MoveProfiling.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/profiling/MoveProfiling.java Mon May 25 23:30:34 2015 +0200 @@ -28,7 +28,6 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.BlockEndOp; @@ -36,6 +35,7 @@ import com.oracle.graal.lir.StandardOp.MoveOp; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.phases.*; +import com.oracle.jvmci.common.*; public class MoveProfiling extends PostAllocationOptimizationPhase { @@ -84,7 +84,7 @@ return CONST2STACK; } } - throw GraalInternalError.shouldNotReachHere(String.format("Unrecognized Move: %s dst=%s, src=%s", move, dst, src)); + throw JVMCIError.shouldNotReachHere(String.format("Unrecognized Move: %s dst=%s, src=%s", move, dst, src)); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/SimpleStackSlotAllocator.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/SimpleStackSlotAllocator.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/SimpleStackSlotAllocator.java Mon May 25 23:30:34 2015 +0200 @@ -27,7 +27,6 @@ import java.util.*; import com.oracle.graal.api.code.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; @@ -36,6 +35,7 @@ import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.gen.LIRGeneratorTool.SpillMoveFactory; import com.oracle.graal.lir.phases.*; +import com.oracle.jvmci.common.*; public class SimpleStackSlotAllocator extends AllocationPhase implements StackSlotAllocator { @@ -57,7 +57,7 @@ slot = mapVirtualStackSlotRange(builder, slotRange); virtualFramesize.add(builder.getFrameMap().spillSlotRangeSize(slotRange.getSlots())); } else { - throw GraalInternalError.shouldNotReachHere("Unknown VirtualStackSlot: " + virtualSlot); + throw JVMCIError.shouldNotReachHere("Unknown VirtualStackSlot: " + virtualSlot); } allocatedSlots.increment(); mapping[virtualSlot.getId()] = slot; diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/BasicInductionVariable.java Mon May 25 23:30:34 2015 +0200 @@ -24,10 +24,10 @@ import static com.oracle.graal.loop.MathUtil.*; -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.jvmci.common.*; public class BasicInductionVariable extends InductionVariable { @@ -94,7 +94,7 @@ if (op instanceof SubNode) { return graph().unique(new NegateNode(rawStride)); } - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } @Override @@ -120,7 +120,7 @@ if (op instanceof SubNode) { return -rawStride.asJavaConstant().asLong(); } - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } @Override diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/DerivedOffsetInductionVariable.java Mon May 25 23:30:34 2015 +0200 @@ -24,10 +24,10 @@ import static com.oracle.graal.loop.MathUtil.*; -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.jvmci.common.*; public class DerivedOffsetInductionVariable extends DerivedInductionVariable { @@ -122,7 +122,7 @@ return o - b; } } - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } private ValueNode op(ValueNode b, ValueNode o) { @@ -137,7 +137,7 @@ return sub(graph(), o, b); } } - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } @Override diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/InductionVariable.java Mon May 25 23:30:34 2015 +0200 @@ -22,9 +22,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.jvmci.common.*; /** * This class describes a value node that is an induction variable in a counted loop. @@ -42,7 +42,7 @@ case Down: return Up; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopEx.java Mon May 25 23:30:34 2015 +0200 @@ -26,7 +26,6 @@ import java.util.*; -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.type.*; @@ -39,6 +38,7 @@ import com.oracle.graal.nodes.cfg.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.common.*; public class LoopEx { @@ -243,7 +243,7 @@ } break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } counted = new CountedLoopInfo(this, iv, limit, oneOff, negated ? ifNode.falseSuccessor() : ifNode.trueSuccessor()); return true; diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragment.java Mon May 25 23:30:34 2015 +0200 @@ -24,7 +24,6 @@ import java.util.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.Graph.DuplicationReplacement; import com.oracle.graal.graph.iterators.*; @@ -33,6 +32,7 @@ import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.virtual.*; +import com.oracle.jvmci.common.*; public abstract class LoopFragment { @@ -363,7 +363,7 @@ } else if (vpn instanceof GuardProxyNode) { phi = graph.addWithoutUnique(new GuardPhiNode(merge)); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } phi.addInput(vpn); phi.addInput(newVpn); diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragmentInside.java Mon May 25 23:30:34 2015 +0200 @@ -25,13 +25,14 @@ import java.util.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.graph.Graph.DuplicationReplacement; import com.oracle.graal.graph.*; -import com.oracle.graal.graph.Graph.*; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.VirtualState.*; +import com.oracle.graal.nodes.VirtualState.NodeClosure; import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.common.*; public class LoopFragmentInside extends LoopFragment { @@ -194,7 +195,7 @@ } else if (phi instanceof MemoryPhiNode) { ret = new MemoryPhiNode(merge, ((MemoryPhiNode) phi).getLocationIdentity()); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } return graph.addWithoutUnique(ret); } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BreakpointNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BreakpointNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BreakpointNode.java Mon May 25 23:30:34 2015 +0200 @@ -38,7 +38,7 @@ *
  *     {@literal @}NodeIntrinsic(BreakpointNode.class)
  *     static void breakpoint(Object object, Word mark, Word value) {
- *          throw new GraalInternalError("");
+ *          throw new JVMCIError("");
  *     }
  * 
* diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java Mon May 25 23:30:34 2015 +0200 @@ -26,13 +26,13 @@ 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.graph.*; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.common.*; /** * The {@code ConstantNode} represents a {@link Constant constant}. @@ -391,7 +391,7 @@ case Long: return ConstantNode.forLong(value, graph); default: - throw GraalInternalError.shouldNotReachHere("unknown kind " + kind); + throw JVMCIError.shouldNotReachHere("unknown kind " + kind); } } @@ -404,7 +404,7 @@ case Long: return createPrimitive(JavaConstant.forLong(value)); default: - throw GraalInternalError.shouldNotReachHere("unknown kind " + kind); + throw JVMCIError.shouldNotReachHere("unknown kind " + kind); } } @@ -415,7 +415,7 @@ case Double: return ConstantNode.forDouble(value, graph); default: - throw GraalInternalError.shouldNotReachHere("unknown kind " + kind); + throw JVMCIError.shouldNotReachHere("unknown kind " + kind); } } @@ -426,7 +426,7 @@ case Double: return ConstantNode.forDouble(value); default: - throw GraalInternalError.shouldNotReachHere("unknown kind " + kind); + throw JVMCIError.shouldNotReachHere("unknown kind " + kind); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/EntryMarkerNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/EntryMarkerNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/EntryMarkerNode.java Mon May 25 23:30:34 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.common.*; /** * This node will be inserted at point specified by {@link StructuredGraph#getEntryBCI()}, usually @@ -47,6 +47,6 @@ @Override public void generate(NodeLIRBuilderTool gen) { - throw new GraalInternalError("OnStackReplacementNode should not survive"); + throw new JVMCIError("OnStackReplacementNode should not survive"); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GraphDecoder.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GraphDecoder.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GraphDecoder.java Mon May 25 23:30:34 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.nodes; -import static com.oracle.graal.compiler.common.GraalInternalError.*; +import static com.oracle.jvmci.common.JVMCIError.*; import java.util.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java Mon May 25 23:30:34 2015 +0200 @@ -38,6 +38,7 @@ import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.common.*; /** * The {@code IfNode} represents a branch that can go one of two directions depending on the outcome @@ -1020,7 +1021,7 @@ return; } } else { - throw new GraalInternalError("Illegal state"); + throw new JVMCIError("Illegal state"); } } else if (node instanceof AbstractMergeNode && !(node instanceof LoopBeginNode)) { for (AbstractEndNode endNode : ((AbstractMergeNode) node).cfgPredecessors()) { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java Mon May 25 23:30:34 2015 +0200 @@ -26,8 +26,8 @@ import java.util.concurrent.atomic.*; import java.util.function.*; +import com.oracle.graal.api.meta.*; import com.oracle.graal.api.meta.Assumptions.Assumption; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/TypeProfileProxyNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/TypeProfileProxyNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/TypeProfileProxyNode.java Mon May 25 23:30:34 2015 +0200 @@ -24,8 +24,8 @@ import java.util.*; +import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryArithmeticNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryArithmeticNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryArithmeticNode.java Mon May 25 23:30:34 2015 +0200 @@ -26,15 +26,15 @@ import java.util.function.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.type.*; -import com.oracle.graal.compiler.common.type.ArithmeticOpTable.*; +import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp; import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.common.*; @NodeInfo public abstract class BinaryArithmeticNode extends BinaryNode implements ArithmeticLIRLowerable, Canonicalizable.Binary { @@ -118,7 +118,7 @@ case y: return binary.getY(); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -129,7 +129,7 @@ case y: return binary.getX(); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } } @@ -240,7 +240,7 @@ } else if (node instanceof XorNode) { return new XorNode(a, new XorNode(m1, m2)); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java Mon May 25 23:30:34 2015 +0200 @@ -23,13 +23,13 @@ package com.oracle.graal.nodes.calc; 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.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.common.*; /* TODO (thomaswue/gdub) For high-level optimization purpose the compare node should be a boolean *value* (it is currently only a helper node) * But in the back-end the comparison should not always be materialized (for example in x86 the comparison result will not be in a register but in a flag) @@ -99,7 +99,7 @@ } protected ValueNode optimizeNormalizeCmp(Constant constant, NormalizeCompareNode normalizeNode, boolean mirrored) { - throw new GraalInternalError("NormalizeCompareNode connected to %s (%s %s %s)", this, constant, normalizeNode, mirrored); + throw new JVMCIError("NormalizeCompareNode connected to %s (%s %s %s)", this, constant, normalizeNode, mirrored); } @Override diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/DivNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/DivNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/DivNode.java Mon May 25 23:30:34 2015 +0200 @@ -25,8 +25,8 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; -import com.oracle.graal.compiler.common.type.ArithmeticOpTable.*; -import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp.*; +import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp; +import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp.Div; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.lir.gen.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatEqualsNode.java Mon May 25 23:30:34 2015 +0200 @@ -23,7 +23,6 @@ package com.oracle.graal.nodes.calc; 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.type.*; import com.oracle.graal.graph.*; @@ -32,6 +31,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.common.*; @NodeInfo(shortName = "==") public final class FloatEqualsNode extends CompareNode implements BinaryCommutative { @@ -79,7 +79,7 @@ } else if (newX.stamp() instanceof IntegerStamp && newY.stamp() instanceof IntegerStamp) { return new IntegerEqualsNode(newX, newY); } - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } @Override diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatLessThanNode.java Mon May 25 23:30:34 2015 +0200 @@ -23,7 +23,6 @@ package com.oracle.graal.nodes.calc; 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.type.*; import com.oracle.graal.graph.*; @@ -31,6 +30,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.common.*; @NodeInfo(shortName = "<") public final class FloatLessThanNode extends CompareNode { @@ -70,7 +70,7 @@ } else if (newX.stamp() instanceof IntegerStamp && newY.stamp() instanceof IntegerStamp) { return new IntegerLessThanNode(newX, newY); } - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } @Override diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerConvertNode.java Mon May 25 23:30:34 2015 +0200 @@ -27,7 +27,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; -import com.oracle.graal.compiler.common.type.ArithmeticOpTable.*; +import com.oracle.graal.compiler.common.type.ArithmeticOpTable.IntegerConvertOp; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java Mon May 25 23:30:34 2015 +0200 @@ -23,7 +23,6 @@ package com.oracle.graal.nodes.calc; 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.type.*; import com.oracle.graal.graph.*; @@ -32,6 +31,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.common.*; @NodeInfo(shortName = "==") public final class IntegerEqualsNode extends CompareNode implements BinaryCommutative { @@ -95,7 +95,7 @@ } else if (newX.stamp() instanceof AbstractPointerStamp && newY.stamp() instanceof AbstractPointerStamp) { return new IntegerEqualsNode(newX, newY); } - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } @Override diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java Mon May 25 23:30:34 2015 +0200 @@ -24,7 +24,6 @@ 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.type.*; import com.oracle.graal.graph.*; @@ -32,6 +31,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.common.*; @NodeInfo(shortName = "<") public final class IntegerLessThanNode extends CompareNode { @@ -113,7 +113,7 @@ } else if (newX.stamp() instanceof IntegerStamp && newY.stamp() instanceof IntegerStamp) { return new IntegerLessThanNode(newX, newY); } - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } @Override diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NarrowNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NarrowNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NarrowNode.java Mon May 25 23:30:34 2015 +0200 @@ -23,7 +23,7 @@ package com.oracle.graal.nodes.calc; import com.oracle.graal.compiler.common.type.*; -import com.oracle.graal.compiler.common.type.ArithmeticOpTable.*; +import com.oracle.graal.compiler.common.type.ArithmeticOpTable.IntegerConvertOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.IntegerConvertOp.Narrow; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.IntegerConvertOp.SignExtend; import com.oracle.graal.graph.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java Mon May 25 23:30:34 2015 +0200 @@ -23,7 +23,6 @@ package com.oracle.graal.nodes.calc; 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.type.*; import com.oracle.graal.graph.*; @@ -33,6 +32,7 @@ import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.common.*; @NodeInfo(shortName = "==") public final class ObjectEqualsNode extends PointerEqualsNode implements Virtualizable { @@ -139,6 +139,6 @@ } else if (newX.stamp() instanceof AbstractPointerStamp && newY.stamp() instanceof AbstractPointerStamp) { return new PointerEqualsNode(newX, newY); } - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/SubNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/SubNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/SubNode.java Mon May 25 23:30:34 2015 +0200 @@ -25,7 +25,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp; -import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp.*; +import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp.Sub; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.lir.gen.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ZeroExtendNode.java Mon May 25 23:30:34 2015 +0200 @@ -25,8 +25,9 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; -import com.oracle.graal.compiler.common.type.ArithmeticOpTable.*; -import com.oracle.graal.compiler.common.type.ArithmeticOpTable.IntegerConvertOp.*; +import com.oracle.graal.compiler.common.type.ArithmeticOpTable.IntegerConvertOp; +import com.oracle.graal.compiler.common.type.ArithmeticOpTable.IntegerConvertOp.Narrow; +import com.oracle.graal.compiler.common.type.ArithmeticOpTable.IntegerConvertOp.ZeroExtend; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.lir.gen.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/ControlFlowGraph.java Mon May 25 23:30:34 2015 +0200 @@ -24,11 +24,11 @@ import java.util.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.common.*; public class ControlFlowGraph implements AbstractControlFlowGraph { /** @@ -193,7 +193,7 @@ stack.remove(stack.size() - 1); postOrder.add(block); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } while (!stack.isEmpty()); @@ -348,7 +348,7 @@ c = c.parent; } } else { - GraalInternalError.shouldNotReachHere(); + JVMCIError.shouldNotReachHere(); } state = nextState; } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/debug/DynamicCounterNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/debug/DynamicCounterNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/debug/DynamicCounterNode.java Mon May 25 23:30:34 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.debug; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.lir.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.common.*; /** * This node can be used to add a counter to the code that will estimate the dynamic number of calls @@ -109,7 +109,7 @@ if (counterOp != null) { lirGen.append(counterOp); } else { - throw GraalInternalError.unimplemented("Benchmark counters not enabled or not implemented by the back end."); + throw JVMCIError.unimplemented("Benchmark counters not enabled or not implemented by the back end."); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BranchProbabilityNode.java Mon May 25 23:30:34 2015 +0200 @@ -22,7 +22,6 @@ */ 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.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.common.*; /** * Instances of this node class will look for a preceding if node and put the given probability into @@ -74,9 +74,9 @@ if (probability.isConstant()) { double probabilityValue = probability.asJavaConstant().asDouble(); if (probabilityValue < 0.0) { - throw new GraalInternalError("A negative probability of " + probabilityValue + " is not allowed!"); + throw new JVMCIError("A negative probability of " + probabilityValue + " is not allowed!"); } else if (probabilityValue > 1.0) { - throw new GraalInternalError("A probability of more than 1.0 (" + probabilityValue + ") is not allowed!"); + throw new JVMCIError("A probability of more than 1.0 (" + probabilityValue + ") is not allowed!"); } else if (Double.isNaN(probabilityValue)) { /* * We allow NaN if the node is in unreachable code that will eventually fall away, @@ -115,7 +115,7 @@ } } else { if (!isSubstitutionGraph()) { - throw new GraalInternalError("Wrong usage of branch probability injection!"); + throw new JVMCIError("Wrong usage of branch probability injection!"); } } } @@ -141,6 +141,6 @@ @Override public void lower(LoweringTool tool) { - throw new GraalInternalError("Branch probability could not be injected, because the probability value did not reduce to a constant value."); + throw new JVMCIError("Branch probability could not be injected, because the probability value did not reduce to a constant value."); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadHubNode.java Mon May 25 23:30:34 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.nodes.extended; +import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LocationNode.java Mon May 25 23:30:34 2015 +0200 @@ -24,8 +24,8 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; +import com.oracle.graal.graph.Node.ValueNumberable; import com.oracle.graal.graph.*; -import com.oracle.graal.graph.Node.ValueNumberable; import com.oracle.graal.lir.gen.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.calc.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java Mon May 25 23:30:34 2015 +0200 @@ -25,11 +25,11 @@ import java.util.*; 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.nodeinfo.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.common.*; /** * The {@code SwitchNode} class is the base of both lookup and table switches. @@ -155,7 +155,7 @@ */ public AbstractBeginNode defaultSuccessor() { if (defaultSuccessorIndex() == -1) { - throw new GraalInternalError("unexpected"); + throw new JVMCIError("unexpected"); } return successors.get(defaultSuccessorIndex()); } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/ReadNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/ReadNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/ReadNode.java Mon May 25 23:30:34 2015 +0200 @@ -23,7 +23,6 @@ package com.oracle.graal.nodes.memory; 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.*; @@ -33,6 +32,7 @@ import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.common.*; /** * Reads an {@linkplain FixedAccessNode accessed} value. @@ -163,7 +163,7 @@ @Override public void virtualize(VirtualizerTool tool) { - throw GraalInternalError.shouldNotReachHere("unexpected ReadNode before PEA"); + throw JVMCIError.shouldNotReachHere("unexpected ReadNode before PEA"); } public boolean canNullCheck() { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/WriteNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/WriteNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/WriteNode.java Mon May 25 23:30:34 2015 +0200 @@ -23,7 +23,6 @@ package com.oracle.graal.nodes.memory; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; @@ -31,6 +30,7 @@ import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.extended.LocationNode.Location; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.common.*; /** * Writes a given {@linkplain #value() value} a {@linkplain FixedAccessNode memory location}. @@ -71,7 +71,7 @@ @Override public void virtualize(VirtualizerTool tool) { - throw GraalInternalError.shouldNotReachHere("unexpected WriteNode before PEA"); + throw JVMCIError.shouldNotReachHere("unexpected WriteNode before PEA"); } public boolean canNullCheck() { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/EscapeObjectState.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/EscapeObjectState.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/EscapeObjectState.java Mon May 25 23:30:34 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.nodes.virtual; +import com.oracle.graal.graph.Node.ValueNumberable; import com.oracle.graal.graph.*; -import com.oracle.graal.graph.Node.ValueNumberable; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ExpandLogicPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ExpandLogicPhase.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ExpandLogicPhase.java Mon May 25 23:30:34 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.phases.common; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.phases.*; +import com.oracle.jvmci.common.*; public class ExpandLogicPhase extends Phase { @@ -48,7 +48,7 @@ } else if (usage instanceof ConditionalNode) { processConditional(binary.getX(), binary.isXNegated(), binary.getY(), binary.isYNegated(), (ConditionalNode) usage); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } binary.safeDelete(); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FrameStateAssignmentPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FrameStateAssignmentPhase.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FrameStateAssignmentPhase.java Mon May 25 23:30:34 2015 +0200 @@ -24,7 +24,6 @@ import java.util.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.nodes.*; @@ -33,6 +32,7 @@ import com.oracle.graal.phases.*; import com.oracle.graal.phases.graph.*; import com.oracle.graal.phases.graph.ReentrantNodeIterator.NodeIteratorClosure; +import com.oracle.jvmci.common.*; /** * This phase transfers {@link FrameState} nodes from {@link StateSplit} nodes to @@ -54,7 +54,7 @@ if (node instanceof DeoptimizingNode.DeoptBefore) { DeoptimizingNode.DeoptBefore deopt = (DeoptimizingNode.DeoptBefore) node; if (deopt.canDeoptimize() && deopt.stateBefore() == null) { - GraalInternalError.guarantee(currentState != null, "no FrameState at DeoptimizingNode %s", deopt); + JVMCIError.guarantee(currentState != null, "no FrameState at DeoptimizingNode %s", deopt); deopt.setStateBefore(currentState); } } @@ -71,7 +71,7 @@ if (node instanceof DeoptimizingNode.DeoptDuring) { DeoptimizingNode.DeoptDuring deopt = (DeoptimizingNode.DeoptDuring) node; if (deopt.canDeoptimize()) { - GraalInternalError.guarantee(currentState != null, "no FrameState at DeoptimizingNode %s", deopt); + JVMCIError.guarantee(currentState != null, "no FrameState at DeoptimizingNode %s", deopt); deopt.computeStateDuring(currentState); } } @@ -79,7 +79,7 @@ if (node instanceof DeoptimizingNode.DeoptAfter) { DeoptimizingNode.DeoptAfter deopt = (DeoptimizingNode.DeoptAfter) node; if (deopt.canDeoptimize() && deopt.stateAfter() == null) { - GraalInternalError.guarantee(currentState != null, "no FrameState at DeoptimizingNode %s", deopt); + JVMCIError.guarantee(currentState != null, "no FrameState at DeoptimizingNode %s", deopt); deopt.setStateAfter(currentState); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/IncrementalCanonicalizerPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/IncrementalCanonicalizerPhase.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/IncrementalCanonicalizerPhase.java Mon May 25 23:30:34 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.phases.common; -import com.oracle.graal.graph.Graph.*; +import com.oracle.graal.graph.Graph.NodeEventScope; import com.oracle.graal.nodes.*; import com.oracle.graal.phases.*; import com.oracle.graal.phases.common.util.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/IterativeConditionalEliminationPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/IterativeConditionalEliminationPhase.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/IterativeConditionalEliminationPhase.java Mon May 25 23:30:34 2015 +0200 @@ -25,8 +25,8 @@ import static com.oracle.graal.graph.Graph.NodeEvent.*; import com.oracle.graal.api.code.*; +import com.oracle.graal.graph.Graph.NodeEventScope; import com.oracle.graal.graph.*; -import com.oracle.graal.graph.Graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; import com.oracle.graal.phases.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Mon May 25 23:30:34 2015 +0200 @@ -28,7 +28,6 @@ import java.util.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.Graph.Mark; import com.oracle.graal.graph.*; @@ -42,6 +41,7 @@ import com.oracle.graal.phases.*; import com.oracle.graal.phases.schedule.*; import com.oracle.graal.phases.tiers.*; +import com.oracle.jvmci.common.*; /** * Processes all {@link Lowerable} nodes to do their lowering. @@ -452,7 +452,7 @@ f = f.parent; nextState = ST_ENTER; } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } state = nextState; } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java Mon May 25 23:30:34 2015 +0200 @@ -33,7 +33,6 @@ import com.oracle.graal.api.code.*; 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; @@ -49,6 +48,7 @@ import com.oracle.graal.nodes.type.*; import com.oracle.graal.nodes.util.*; import com.oracle.graal.phases.common.inlining.info.*; +import com.oracle.jvmci.common.*; public class InliningUtil { @@ -664,7 +664,7 @@ return replacements.getSubstitution(target, invokeBci); } - public static FixedWithNextNode inlineMacroNode(Invoke invoke, ResolvedJavaMethod concrete, Class macroNodeClass) throws GraalInternalError { + public static FixedWithNextNode inlineMacroNode(Invoke invoke, ResolvedJavaMethod concrete, Class macroNodeClass) throws JVMCIError { StructuredGraph graph = invoke.asNode().graph(); if (!concrete.equals(((MethodCallTargetNode) invoke.callTarget()).targetMethod())) { assert ((MethodCallTargetNode) invoke.callTarget()).invokeKind().hasReceiver(); @@ -685,12 +685,12 @@ return macroNode; } - private static FixedWithNextNode createMacroNodeInstance(Class macroNodeClass, Invoke invoke) throws GraalInternalError { + private static FixedWithNextNode createMacroNodeInstance(Class macroNodeClass, Invoke invoke) throws JVMCIError { try { Constructor cons = macroNodeClass.getDeclaredConstructor(Invoke.class); return (FixedWithNextNode) cons.newInstance(invoke); } catch (ReflectiveOperationException | IllegalArgumentException | SecurityException e) { - throw new GraalGraphInternalError(e).addContext(invoke.asNode()).addContext("macroSubstitution", macroNodeClass); + throw new GraalGraphJVMCIError(e).addContext(invoke.asNode()).addContext("macroSubstitution", macroNodeClass); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/AbstractInliningPolicy.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/AbstractInliningPolicy.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/AbstractInliningPolicy.java Mon May 25 23:30:34 2015 +0200 @@ -22,18 +22,16 @@ */ package com.oracle.graal.phases.common.inlining.policy; -import com.oracle.graal.api.meta.ProfilingInfo; -import com.oracle.graal.api.meta.ResolvedJavaMethod; -import com.oracle.graal.nodes.Invoke; -import com.oracle.graal.nodes.StructuredGraph; -import com.oracle.graal.nodes.spi.Replacements; -import com.oracle.graal.phases.common.inlining.InliningUtil; -import com.oracle.graal.phases.common.inlining.info.InlineInfo; -import com.oracle.graal.phases.common.inlining.info.elem.Inlineable; +import static com.oracle.graal.phases.common.inlining.InliningPhase.Options.*; + +import java.util.*; -import java.util.Map; - -import static com.oracle.graal.phases.common.inlining.InliningPhase.Options.AlwaysInlineIntrinsics; +import com.oracle.graal.api.meta.*; +import com.oracle.graal.nodes.*; +import com.oracle.graal.nodes.spi.*; +import com.oracle.graal.phases.common.inlining.*; +import com.oracle.graal.phases.common.inlining.info.*; +import com.oracle.graal.phases.common.inlining.info.elem.*; public abstract class AbstractInliningPolicy implements InliningPolicy { public static final float RelevanceCapForInlining = 1.0f; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/GreedyInliningPolicy.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/GreedyInliningPolicy.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/GreedyInliningPolicy.java Mon May 25 23:30:34 2015 +0200 @@ -22,18 +22,16 @@ */ package com.oracle.graal.phases.common.inlining.policy; -import com.oracle.graal.debug.Debug; -import com.oracle.graal.debug.DebugMetric; -import com.oracle.graal.nodes.Invoke; -import com.oracle.graal.nodes.StructuredGraph; -import com.oracle.graal.nodes.spi.Replacements; -import com.oracle.graal.phases.common.inlining.InliningUtil; -import com.oracle.graal.phases.common.inlining.info.InlineInfo; -import com.oracle.graal.phases.common.inlining.walker.MethodInvocation; +import static com.oracle.graal.compiler.common.GraalOptions.*; + +import java.util.*; -import java.util.Map; - -import static com.oracle.graal.compiler.common.GraalOptions.*; +import com.oracle.graal.debug.*; +import com.oracle.graal.nodes.*; +import com.oracle.graal.nodes.spi.*; +import com.oracle.graal.phases.common.inlining.*; +import com.oracle.graal.phases.common.inlining.info.*; +import com.oracle.graal.phases.common.inlining.walker.*; public class GreedyInliningPolicy extends AbstractInliningPolicy { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/InlineEverythingPolicy.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/InlineEverythingPolicy.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/InlineEverythingPolicy.java Mon May 25 23:30:34 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.phases.common.inlining.policy; -import com.oracle.graal.api.code.BailoutException; -import com.oracle.graal.nodes.StructuredGraph; -import com.oracle.graal.nodes.spi.Replacements; -import com.oracle.graal.phases.common.inlining.walker.MethodInvocation; +import static com.oracle.graal.compiler.common.GraalOptions.*; -import static com.oracle.graal.compiler.common.GraalOptions.MaximumDesiredSize; +import com.oracle.graal.api.code.*; +import com.oracle.graal.nodes.*; +import com.oracle.graal.nodes.spi.*; +import com.oracle.graal.phases.common.inlining.walker.*; public class InlineEverythingPolicy implements InliningPolicy { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/InliningPolicy.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/InliningPolicy.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/InliningPolicy.java Mon May 25 23:30:34 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.phases.common.inlining.policy; -import com.oracle.graal.nodes.StructuredGraph; -import com.oracle.graal.nodes.spi.Replacements; -import com.oracle.graal.phases.common.inlining.walker.MethodInvocation; +import com.oracle.graal.nodes.*; +import com.oracle.graal.nodes.spi.*; +import com.oracle.graal.phases.common.inlining.walker.*; public interface InliningPolicy { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/CallsiteHolder.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/CallsiteHolder.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/CallsiteHolder.java Mon May 25 23:30:34 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.phases.common.inlining.walker; -import com.oracle.graal.api.meta.ResolvedJavaMethod; -import com.oracle.graal.nodes.StructuredGraph; +import com.oracle.graal.api.meta.*; +import com.oracle.graal.nodes.*; /** * Information about a graph that will potentially be inlined. This includes tracking the diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/CallsiteHolderExplorable.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/CallsiteHolderExplorable.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/CallsiteHolderExplorable.java Mon May 25 23:30:34 2015 +0200 @@ -22,14 +22,14 @@ */ package com.oracle.graal.phases.common.inlining.walker; -import com.oracle.graal.api.meta.ResolvedJavaMethod; +import java.util.*; +import java.util.function.*; + +import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.phases.common.inlining.policy.*; -import com.oracle.graal.phases.graph.FixedNodeProbabilityCache; - -import java.util.*; -import java.util.function.ToDoubleFunction; +import com.oracle.graal.phases.graph.*; /** *

diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java Mon May 25 23:30:34 2015 +0200 @@ -27,9 +27,8 @@ import java.util.*; import com.oracle.graal.api.code.*; +import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; @@ -44,6 +43,7 @@ import com.oracle.graal.phases.common.inlining.policy.*; import com.oracle.graal.phases.tiers.*; import com.oracle.graal.phases.util.*; +import com.oracle.jvmci.common.*; /** *

@@ -385,8 +385,8 @@ } catch (BailoutException bailout) { throw bailout; } catch (AssertionError | RuntimeException e) { - throw new GraalInternalError(e).addContext(calleeInfo.toString()); - } catch (GraalInternalError e) { + throw new JVMCIError(e).addContext(calleeInfo.toString()); + } catch (JVMCIError e) { throw e.addContext(calleeInfo.toString()); } catch (Throwable e) { throw Debug.handle(e); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningIterator.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningIterator.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningIterator.java Mon May 25 23:30:34 2015 +0200 @@ -22,15 +22,11 @@ */ package com.oracle.graal.phases.common.inlining.walker; -import com.oracle.graal.graph.Node; -import com.oracle.graal.graph.NodeBitMap; -import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.java.MethodCallTargetNode; +import java.util.*; -import java.util.ArrayDeque; -import java.util.Deque; -import java.util.Iterator; -import java.util.LinkedList; +import com.oracle.graal.graph.*; +import com.oracle.graal.nodes.*; +import com.oracle.graal.nodes.java.*; /** * Given a graph, visit all fixed nodes in dominator-based order, collecting in the process the diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/util/HashSetNodeEventListener.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/util/HashSetNodeEventListener.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/util/HashSetNodeEventListener.java Mon May 25 23:30:34 2015 +0200 @@ -24,7 +24,8 @@ import java.util.*; -import com.oracle.graal.graph.Graph.*; +import com.oracle.graal.graph.Graph.NodeEvent; +import com.oracle.graal.graph.Graph.NodeEventListener; import com.oracle.graal.graph.*; /** diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/MemoryScheduleVerification.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/MemoryScheduleVerification.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/MemoryScheduleVerification.java Mon May 25 23:30:34 2015 +0200 @@ -27,7 +27,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; -import com.oracle.graal.graph.Node; +import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.cfg.*; import com.oracle.graal.nodes.memory.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/CompilerConfiguration.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/CompilerConfiguration.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/CompilerConfiguration.java Mon May 25 23:30:34 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.phases.tiers; +import com.oracle.graal.lir.phases.AllocationPhase.AllocationContext; import com.oracle.graal.lir.phases.*; -import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.*; -import com.oracle.graal.lir.phases.PostAllocationOptimizationPhase.*; -import com.oracle.graal.lir.phases.AllocationPhase.*; +import com.oracle.graal.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext; +import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; import com.oracle.graal.phases.*; import com.oracle.jvmci.runtime.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/Suites.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/Suites.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/Suites.java Mon May 25 23:30:34 2015 +0200 @@ -26,10 +26,10 @@ import java.util.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.lir.phases.*; import com.oracle.graal.options.*; import com.oracle.graal.phases.*; +import com.oracle.jvmci.common.*; import com.oracle.jvmci.runtime.*; public final class Suites { @@ -98,7 +98,7 @@ */ defaultConfiguration = basic; if (defaultConfiguration == null) { - throw new GraalInternalError("unable to find basic compiler configuration"); + throw new JVMCIError("unable to find basic compiler configuration"); } } } @@ -127,7 +127,7 @@ public static Suites createSuites(String name) { CompilerConfiguration config = configurations.get(name); if (config == null) { - throw new GraalInternalError("unknown compiler configuration: " + name); + throw new JVMCIError("unknown compiler configuration: " + name); } return new Suites(config); } @@ -145,7 +145,7 @@ public static LIRSuites createLIRSuites(String name) { CompilerConfiguration config = configurations.get(name); if (config == null) { - throw new GraalInternalError("unknown compiler configuration: " + name); + throw new JVMCIError("unknown compiler configuration: " + name); } return new LIRSuites(config.createPreAllocationOptimizationStage(), config.createAllocationStage(), config.createPostAllocationOptimizationStage()); } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/GraphOrder.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/GraphOrder.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/GraphOrder.java Mon May 25 23:30:34 2015 +0200 @@ -24,7 +24,6 @@ import java.util.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; @@ -35,6 +34,7 @@ import com.oracle.graal.phases.graph.ReentrantBlockIterator.BlockIteratorClosure; import com.oracle.graal.phases.schedule.*; import com.oracle.graal.phases.schedule.SchedulePhase.SchedulingStrategy; +import com.oracle.jvmci.common.*; public final class GraphOrder { @@ -91,7 +91,7 @@ assert node == null || node.isAlive() : node + " not alive"; if (node != null && !visited.isMarked(node)) { if (floatingOnly && node instanceof FixedNode) { - throw new GraalInternalError("unexpected reference to fixed node: %s (this indicates an unexpected cycle)", node); + throw new JVMCIError("unexpected reference to fixed node: %s (this indicates an unexpected cycle)", node); } visited.mark(node); FrameState stateAfter = null; @@ -120,8 +120,8 @@ visitForward(nodes, visited, stateAfter, true); } } - } catch (GraalInternalError e) { - throw GraalGraphInternalError.transformAndAddContext(e, node); + } catch (JVMCIError e) { + throw GraalGraphJVMCIError.transformAndAddContext(e, node); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BinaryGraphPrinter.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BinaryGraphPrinter.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BinaryGraphPrinter.java Mon May 25 23:30:34 2015 +0200 @@ -30,6 +30,7 @@ import java.nio.channels.*; import java.util.*; import java.util.Map.Entry; + import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.debug.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Mon May 25 23:30:34 2015 +0200 @@ -35,7 +35,7 @@ import com.oracle.graal.java.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.alloc.lsra.*; -import com.oracle.graal.lir.alloc.lsra.Interval.*; +import com.oracle.graal.lir.alloc.lsra.Interval.UsePosList; import com.oracle.graal.lir.stackslotalloc.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java Mon May 25 23:30:34 2015 +0200 @@ -28,7 +28,6 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; @@ -39,6 +38,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.cfg.*; import com.oracle.graal.phases.schedule.*; +import com.oracle.jvmci.common.*; /** * Observes compilation events and uses {@link CFGPrinter} to produce a control flow graph for the @@ -124,7 +124,7 @@ OutputStream out = new BufferedOutputStream(new FileOutputStream(cfgFile)); cfgPrinter = new CFGPrinter(out); } catch (FileNotFoundException e) { - throw new GraalInternalError("Could not open " + cfgFile.getAbsolutePath()); + throw new JVMCIError("Could not open " + cfgFile.getAbsolutePath()); } TTY.println("CFGPrinter: Output to file %s", cfgFile); } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/NoDeadCodeVerifyHandler.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/NoDeadCodeVerifyHandler.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/NoDeadCodeVerifyHandler.java Mon May 25 23:30:34 2015 +0200 @@ -27,12 +27,12 @@ import java.util.*; import java.util.concurrent.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.options.*; import com.oracle.graal.phases.common.*; +import com.oracle.jvmci.common.*; /** * Verifies that graphs have no dead code. @@ -70,7 +70,7 @@ if (discovered.put(message, Boolean.TRUE) == null) { before.removeAll(after); String prefix = message == null ? "" : message + ": "; - GraalInternalError error = new GraalInternalError("%sfound dead nodes in %s: %s", prefix, graph, before); + JVMCIError error = new JVMCIError("%sfound dead nodes in %s: %s", prefix, graph, before); if (NDCV.getValue() == INFO) { System.out.println(error.getMessage()); } else if (NDCV.getValue() == VERBOSE) { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64MathIntrinsicNode.java --- a/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64MathIntrinsicNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64MathIntrinsicNode.java Mon May 25 23:30:34 2015 +0200 @@ -23,7 +23,6 @@ package com.oracle.graal.replacements.amd64; 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.*; @@ -33,6 +32,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.common.*; @NodeInfo public final class AMD64MathIntrinsicNode extends UnaryNode implements ArithmeticLIRLowerable { @@ -96,7 +96,7 @@ result = gen.emitMathTan(input); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } builder.setResult(this, result); } @@ -126,7 +126,7 @@ case TAN: return Math.tan(value); default: - throw new GraalInternalError("unknown op %s", op); + throw new JVMCIError("unknown op %s", op); } } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultGenericInvocationPlugin.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultGenericInvocationPlugin.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultGenericInvocationPlugin.java Mon May 25 23:30:34 2015 +0200 @@ -30,7 +30,6 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.Node.NodeIntrinsic; import com.oracle.graal.graphbuilderconf.*; @@ -39,6 +38,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.common.*; /** * An {@link GenericInvocationPlugin} that handles methods annotated by {@link Fold}, @@ -112,7 +112,7 @@ } else if (MethodsElidedInSnippets != null) { if (MethodFilter.matches(MethodsElidedInSnippets, method)) { if (method.getSignature().getReturnKind() != Kind.Void) { - throw new GraalInternalError("Cannot elide non-void method " + method.format("%H.%n(%p)")); + throw new JVMCIError("Cannot elide non-void method " + method.format("%H.%n(%p)")); } return true; } @@ -127,7 +127,7 @@ if (markerType != null) { return markerType.value(); } else { - throw GraalInternalError.shouldNotReachHere(String.format("%s extends StructuralInput, but is not annotated with @MarkerType", type)); + throw JVMCIError.shouldNotReachHere(String.format("%s extends StructuralInput, but is not annotated with @MarkerType", type)); } } else { return InputType.Value; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java Mon May 25 23:30:34 2015 +0200 @@ -34,7 +34,6 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; 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.nodes.*; @@ -42,13 +41,14 @@ import com.oracle.graal.nodes.debug.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.java.*; +import com.oracle.graal.nodes.memory.HeapAccess.BarrierType; import com.oracle.graal.nodes.memory.*; -import com.oracle.graal.nodes.memory.HeapAccess.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; import com.oracle.graal.nodes.util.*; import com.oracle.graal.nodes.virtual.*; import com.oracle.graal.phases.util.*; +import com.oracle.jvmci.common.*; /** * VM-independent lowerings for standard Java nodes. VM-specific methods are abstract and must be @@ -106,7 +106,7 @@ } else if (n instanceof VerifyHeapNode) { lowerVerifyHeap((VerifyHeapNode) n); } else { - throw GraalInternalError.shouldNotReachHere("Node implementing Lowerable not handled: " + n); + throw JVMCIError.shouldNotReachHere("Node implementing Lowerable not handled: " + n); } } @@ -745,7 +745,7 @@ base = indexedLocation.getDisplacement(); index = indexedLocation.getIndex(); } else { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } base -= arrayBaseOffset(elementKind); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/IntrinsicGraphBuilder.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/IntrinsicGraphBuilder.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/IntrinsicGraphBuilder.java Mon May 25 23:30:34 2015 +0200 @@ -24,7 +24,6 @@ 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.graphbuilderconf.*; import com.oracle.graal.graphbuilderconf.MethodIdMap.Receiver; @@ -33,6 +32,7 @@ import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.common.*; /** * Implementation of {@link GraphBuilderContext} used to produce a graph for a method based on an @@ -133,7 +133,7 @@ } public void handleReplacedInvoke(InvokeKind invokeKind, ResolvedJavaMethod targetMethod, ValueNode[] args) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public StampProvider getStampProvider() { @@ -187,11 +187,11 @@ } public IntrinsicContext getIntrinsic() { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public BailoutException bailout(String string) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public ValueNode get() { @@ -209,7 +209,7 @@ } public void intrinsify(ResolvedJavaMethod targetMethod, ResolvedJavaMethod substitute, ValueNode[] args) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } @Override diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java Mon May 25 23:30:34 2015 +0200 @@ -30,7 +30,6 @@ import com.oracle.graal.api.code.*; 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.*; @@ -45,6 +44,7 @@ import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; import com.oracle.graal.phases.*; +import com.oracle.jvmci.common.*; /** * Replaces calls to {@link NodeIntrinsic}s with nodes and calls to methods annotated with @@ -294,12 +294,12 @@ break; } } else { - throw new GraalInternalError("Found multiple constructors in %s compatible with signature %s: %s, %s", nodeClass.toJavaName(), sigString(parameterTypes), constructor, c); + throw new JVMCIError("Found multiple constructors in %s compatible with signature %s: %s, %s", nodeClass.toJavaName(), sigString(parameterTypes), constructor, c); } } } if (constructor == null) { - throw new GraalInternalError("Could not find constructor in %s compatible with signature %s", nodeClass.toJavaName(), sigString(parameterTypes)); + throw new JVMCIError("Could not find constructor in %s compatible with signature %s", nodeClass.toJavaName(), sigString(parameterTypes)); } try { @@ -333,7 +333,7 @@ int count = c.getSignature().getParameterCount(false); for (int i = start; i < count; i++) { if (c.getParameterAnnotation(InjectedNodeParameter.class, i) != null) { - throw new GraalInternalError("Injected parameter %d of type %s must precede all non-injected parameters of %s", i, + throw new JVMCIError("Injected parameter %d of type %s must precede all non-injected parameters of %s", i, c.getSignature().getParameterType(i, c.getDeclaringClass()).toJavaName(false), c.format("%H.%n(%p)")); } } @@ -364,7 +364,7 @@ } else if (signature[i].isAssignableFrom(metaAccess.lookupJavaType(StampProvider.class))) { injected[injected.length - 1] = stampProvider; } else { - throw new GraalInternalError("Cannot handle injected argument of type %s in %s", signature[i].toJavaName(), c.format("%H.%n(%p)")); + throw new JVMCIError("Cannot handle injected argument of type %s in %s", signature[i].toJavaName(), c.format("%H.%n(%p)")); } } else { assert checkNoMoreInjected(c, i); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/PEGraphDecoder.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/PEGraphDecoder.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/PEGraphDecoder.java Mon May 25 23:30:34 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.replacements; -import static com.oracle.graal.compiler.common.GraalInternalError.*; import static com.oracle.graal.java.GraphBuilderPhase.Options.*; +import static com.oracle.jvmci.common.JVMCIError.*; import java.util.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java Mon May 25 23:30:34 2015 +0200 @@ -59,6 +59,7 @@ import com.oracle.graal.phases.tiers.*; import com.oracle.graal.phases.util.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.common.*; public class ReplacementsImpl implements Replacements, InlineInvokePlugin { @@ -109,7 +110,7 @@ assert b.getDepth() < MAX_GRAPH_INLINING_DEPTH : "inlining limit exceeded"; if (method.getName().startsWith("$jacoco")) { - throw new GraalInternalError("Found call to JaCoCo instrumentation method " + method.format("%H.%n(%p)") + ". Placing \"//JaCoCo Exclude\" anywhere in " + + throw new JVMCIError("Found call to JaCoCo instrumentation method " + method.format("%H.%n(%p)") + ". Placing \"//JaCoCo Exclude\" anywhere in " + b.getMethod().getDeclaringClass().getSourceFileName() + " should fix this."); } @@ -153,7 +154,7 @@ int modifiers = substituteMethod.getModifiers(); if (!Modifier.isStatic(modifiers)) { - throw new GraalInternalError("Substitution methods must be static: " + substituteMethod); + throw new JVMCIError("Substitution methods must be static: " + substituteMethod); } if (methodSubstitution != null) { @@ -163,7 +164,7 @@ } if (Modifier.isAbstract(modifiers) || Modifier.isNative(modifiers)) { - throw new GraalInternalError("Substitution method must not be abstract or native: " + substituteMethod); + throw new JVMCIError("Substitution method must not be abstract or native: " + substituteMethod); } String originalName = originalName(substituteMethod, methodSubstitution.value()); JavaSignature originalSignature = originalSignature(substituteMethod, methodSubstitution.signature(), methodSubstitution.isStatic()); @@ -224,7 +225,7 @@ return null; } - private Executable lookupOriginalMethod(Class originalClass, String name, JavaSignature signature, boolean optional) throws GraalInternalError { + private Executable lookupOriginalMethod(Class originalClass, String name, JavaSignature signature, boolean optional) throws JVMCIError { try { if (name.equals("")) { assert signature.returnType.equals(void.class) : signature; @@ -241,7 +242,7 @@ if (optional) { return null; } - throw new GraalInternalError(e); + throw new JVMCIError(e); } } } @@ -358,7 +359,7 @@ if (guardClass != SubstitutionGuard.class) { Constructor[] constructors = guardClass.getConstructors(); if (constructors.length != 1) { - throw new GraalInternalError("Substitution guard " + guardClass.getSimpleName() + " must have a single public constructor"); + throw new JVMCIError("Substitution guard " + guardClass.getSimpleName() + " must have a single public constructor"); } Constructor constructor = constructors[0]; Class[] paramTypes = constructor.getParameterTypes(); @@ -372,13 +373,13 @@ } else if (paramTypes[i].isInstance(target.arch)) { args[i] = target.arch; } else { - throw new GraalInternalError("Unsupported type %s in substitution guard constructor: %s", paramTypes[i].getName(), constructor); + throw new JVMCIError("Unsupported type %s in substitution guard constructor: %s", paramTypes[i].getName(), constructor); } } return (SubstitutionGuard) constructor.newInstance(args); } catch (Exception e) { - throw new GraalInternalError(e); + throw new JVMCIError(e); } } return null; @@ -611,7 +612,7 @@ if (optional) { return null; } - throw new GraalInternalError("Could not resolve type " + className); + throw new JVMCIError("Could not resolve type " + className); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetCounterNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetCounterNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetCounterNode.java Mon May 25 23:30:34 2015 +0200 @@ -31,7 +31,6 @@ import com.oracle.graal.api.code.*; 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.graph.*; import com.oracle.graal.nodeinfo.*; @@ -43,6 +42,7 @@ import com.oracle.graal.replacements.SnippetTemplate.Arguments; import com.oracle.graal.replacements.SnippetTemplate.SnippetInfo; import com.oracle.graal.word.*; +import com.oracle.jvmci.common.*; /** * This node can be used to add a counter to the code that will estimate the dynamic number of calls @@ -124,7 +124,7 @@ try { return (int) unsafe.objectFieldOffset(SnippetCounter.class.getDeclaredField("value")); } catch (Exception e) { - throw new GraalInternalError(e); + throw new JVMCIError(e); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Mon May 25 23:30:34 2015 +0200 @@ -39,7 +39,6 @@ import com.oracle.graal.api.code.*; 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; @@ -65,6 +64,7 @@ import com.oracle.graal.replacements.Snippet.VarargsParameter; import com.oracle.graal.replacements.nodes.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.common.*; /** * A snippet template is a graph created by parsing a snippet method and then specialized by binding @@ -657,7 +657,7 @@ // The template lowering doesn't really treat this as an array so you can't // store back into the varargs. Allocate your own array if you really need // this and EA should eliminate it. - throw new GraalInternalError("Can't store into VarargsParameter array"); + throw new JVMCIError("Can't store into VarargsParameter array"); } } } else { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/StandardGraphBuilderPlugins.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/StandardGraphBuilderPlugins.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/StandardGraphBuilderPlugins.java Mon May 25 23:30:34 2015 +0200 @@ -32,7 +32,6 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.directives.*; 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.type.*; import com.oracle.graal.graph.*; @@ -48,6 +47,7 @@ import com.oracle.graal.options.*; import com.oracle.graal.replacements.nodes.*; import com.oracle.graal.replacements.nodes.arithmetic.*; +import com.oracle.jvmci.common.*; /** * Provides non-runtime specific {@link InvocationPlugin}s. @@ -92,7 +92,7 @@ try { STRING_VALUE_FIELD = String.class.getDeclaredField("value"); } catch (NoSuchFieldException e) { - throw new GraalInternalError(e); + throw new JVMCIError(e); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/WordOperationPlugin.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/WordOperationPlugin.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/WordOperationPlugin.java Mon May 25 23:30:34 2015 +0200 @@ -29,7 +29,6 @@ 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.graphbuilderconf.*; @@ -41,6 +40,7 @@ import com.oracle.graal.word.Word.Opcode; import com.oracle.graal.word.Word.Operation; import com.oracle.graal.word.nodes.*; +import com.oracle.jvmci.common.*; /** * A {@link GenericInvocationPlugin} for calls to {@linkplain Operation word operations}, and a @@ -98,7 +98,7 @@ return false; } - protected void processWordOperation(GraphBuilderContext b, ValueNode[] args, ResolvedJavaMethod wordMethod) throws GraalInternalError { + protected void processWordOperation(GraphBuilderContext b, ValueNode[] args, ResolvedJavaMethod wordMethod) throws JVMCIError { Operation operation = wordMethod.getAnnotation(Word.Operation.class); Kind returnKind = wordMethod.getSignature().getReturnKind(); Kind returnStackKind = returnKind.getStackKind(); @@ -201,7 +201,7 @@ break; default: - throw new GraalInternalError("Unknown opcode: %s", operation.opcode()); + throw new JVMCIError("Unknown opcode: %s", operation.opcode()); } } @@ -215,7 +215,7 @@ Constructor cons = nodeClass.getDeclaredConstructor(ValueNode.class, ValueNode.class); return (ValueNode) cons.newInstance(left, right); } catch (Throwable ex) { - throw new GraalInternalError(ex).addContext(nodeClass.getName()); + throw new JVMCIError(ex).addContext(nodeClass.getName()); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/AssertionNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/AssertionNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/AssertionNode.java Mon May 25 23:30:34 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.replacements.nodes; -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.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.common.*; /** * Assertion nodes will go away as soon as the value evaluates to true. Compile-time assertions will @@ -81,10 +81,10 @@ assert compileTimeAssertion; if (value.isConstant()) { if (value.asJavaConstant().asInt() == 0) { - throw new GraalInternalError("%s: failed compile-time assertion: %s", this, message); + throw new JVMCIError("%s: failed compile-time assertion: %s", this, message); } } else { - throw new GraalInternalError("%s: failed compile-time assertion (value %s): %s", this, value, message); + throw new JVMCIError("%s: failed compile-time assertion (value %s): %s", this, value, message); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BasicObjectCloneNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BasicObjectCloneNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BasicObjectCloneNode.java Mon May 25 23:30:34 2015 +0200 @@ -29,8 +29,8 @@ import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; +import com.oracle.graal.nodes.CallTargetNode.InvokeKind; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.CallTargetNode.InvokeKind; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroNode.java Mon May 25 23:30:34 2015 +0200 @@ -26,7 +26,6 @@ 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; @@ -41,6 +40,7 @@ import com.oracle.graal.phases.common.inlining.*; import com.oracle.graal.phases.tiers.*; import com.oracle.graal.replacements.*; +import com.oracle.jvmci.common.*; /** * Macro nodes can be used to temporarily replace an invoke. They can, for example, be used to @@ -166,7 +166,7 @@ Debug.dump(graph(), "After inlining replacement %s", replacementGraph); } else { if (isPlaceholderBci(invoke.bci())) { - throw new GraalInternalError("%s: cannot lower to invoke with placeholder BCI: %s", graph(), this); + throw new JVMCIError("%s: cannot lower to invoke with placeholder BCI: %s", graph(), this); } if (invoke.stateAfter() == null) { @@ -176,10 +176,10 @@ // no longer needs a MacroNode. For example, Class.getComponentType() // only needs a MacroNode prior to JDK9 as it was given a non-native // implementation in JDK9. - throw new GraalInternalError("%s macro created for call to %s in %s must be lowerable to a snippet or intrinsic graph. " + throw new JVMCIError("%s macro created for call to %s in %s must be lowerable to a snippet or intrinsic graph. " + "Maybe a macro node is not needed for this method in the current JDK?", getClass().getSimpleName(), targetMethod.format("%h.%n(%p)"), graph()); } - throw new GraalInternalError("%s: cannot lower to invoke without state: %s", graph(), this); + throw new JVMCIError("%s: cannot lower to invoke without state: %s", graph(), this); } invoke.lower(tool); } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroStateSplitNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroStateSplitNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroStateSplitNode.java Mon May 25 23:30:34 2015 +0200 @@ -24,13 +24,13 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; +import com.oracle.graal.nodes.CallTargetNode.InvokeKind; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.CallTargetNode.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.memory.*; +import com.oracle.jvmci.common.*; /** * This is an extension of {@link MacroNode} that is a {@link StateSplit} and a @@ -69,7 +69,7 @@ for (MethodCallTargetNode call : snippetGraph.getNodes(MethodCallTargetNode.TYPE)) { Invoke invoke = call.invoke(); if (!call.targetMethod().equals(getTargetMethod())) { - throw new GraalInternalError("unexpected invoke %s in snippet", getClass().getSimpleName()); + throw new JVMCIError("unexpected invoke %s in snippet", getClass().getSimpleName()); } assert invoke.stateAfter().bci == BytecodeFrame.AFTER_BCI; // Here we need to fix the bci of the invoke diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MethodHandleNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MethodHandleNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MethodHandleNode.java Mon May 25 23:30:34 2015 +0200 @@ -28,7 +28,6 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.api.meta.MethodHandleAccessProvider.IntrinsicMethod; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -38,6 +37,7 @@ import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.type.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.common.*; /** * Node for invocation methods defined on the class {@link MethodHandle}. @@ -77,7 +77,7 @@ case LINK_TO_INTERFACE: return getLinkToTarget(assumptions, intrinsicMethod, methodHandleAccess, original, bci, returnType, arguments); default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } @@ -251,7 +251,7 @@ targetArguments = Arrays.copyOfRange(arguments, 0, arguments.length - 1); break; default: - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } MethodCallTargetNode callTarget = ResolvedMethodHandleCallTargetNode.create(targetInvokeKind, target, targetArguments, targetReturnType, original, arguments, returnType); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/PureFunctionMacroNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/PureFunctionMacroNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/PureFunctionMacroNode.java Mon May 25 23:30:34 2015 +0200 @@ -26,8 +26,8 @@ import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; +import com.oracle.graal.nodes.CallTargetNode.InvokeKind; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.CallTargetNode.InvokeKind; /** * This node class can be used to create {@link MacroNode}s for simple pure functions like diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ResolvedMethodHandleCallTargetNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ResolvedMethodHandleCallTargetNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ResolvedMethodHandleCallTargetNode.java Mon May 25 23:30:34 2015 +0200 @@ -27,12 +27,12 @@ import java.lang.invoke.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.common.*; /** * A call target that replaces itself in the graph when being lowered by restoring the original @@ -88,6 +88,6 @@ @Override public void generate(NodeLIRBuilderTool gen) { - throw GraalInternalError.shouldNotReachHere("should have replaced itself"); + throw JVMCIError.shouldNotReachHere("should have replaced itself"); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java Mon May 25 23:30:34 2015 +0200 @@ -37,7 +37,6 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.target.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; @@ -335,7 +334,7 @@ try { return UnsafeAccess.unsafe.objectFieldOffset(Thread.class.getDeclaredField("eetop")); } catch (Exception e) { - throw new GraalInternalError(e); + throw new JVMCIError(e); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/OptimizedCallTargetInstrumentation.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/OptimizedCallTargetInstrumentation.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/OptimizedCallTargetInstrumentation.java Mon May 25 23:30:34 2015 +0200 @@ -27,7 +27,6 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.code.CompilationResult.Mark; import com.oracle.graal.asm.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.jvmci.*; import com.oracle.graal.hotspot.meta.*; @@ -63,7 +62,7 @@ Field field = declaringClass.getDeclaredField(name); return (int) UnsafeAccess.unsafe.objectFieldOffset(field); } catch (NoSuchFieldException | SecurityException e) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/HotSpotNativeFunctionHandle.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/HotSpotNativeFunctionHandle.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/HotSpotNativeFunctionHandle.java Mon May 25 23:30:34 2015 +0200 @@ -26,9 +26,9 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; +import com.oracle.jvmci.common.*; import com.oracle.nfi.api.*; public class HotSpotNativeFunctionHandle implements NativeFunctionHandle { @@ -68,7 +68,7 @@ traceResult(res); return res; } catch (InvalidInstalledCodeException e) { - throw GraalInternalError.shouldNotReachHere("Execution of GNFI Callstub failed: " + name); + throw JVMCIError.shouldNotReachHere("Execution of GNFI Callstub failed: " + name); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/NativeCallStubGraphBuilder.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/NativeCallStubGraphBuilder.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/NativeCallStubGraphBuilder.java Mon May 25 23:30:34 2015 +0200 @@ -27,7 +27,6 @@ import java.util.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.jvmci.*; import com.oracle.graal.hotspot.meta.*; @@ -36,6 +35,7 @@ import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.virtual.*; +import com.oracle.jvmci.common.*; /** * Utility creating a graph for a stub used to call a native function. @@ -93,7 +93,7 @@ callNode.setNext(returnNode); return g; } catch (NoSuchMethodException e) { - throw GraalInternalError.shouldNotReachHere("Call Stub method not found"); + throw JVMCIError.shouldNotReachHere("Call Stub method not found"); } } @@ -133,7 +133,7 @@ last = loadFieldNode; args.add(loadFieldNode); } catch (NoSuchFieldException e) { - throw new GraalInternalError(e); + throw new JVMCIError(e); } } } @@ -175,6 +175,6 @@ @SuppressWarnings("unused") public static Object libCall(Object argLoc, Object unused1, Object unused2) { - throw GraalInternalError.shouldNotReachHere("GNFI libCall method must not be called"); + throw JVMCIError.shouldNotReachHere("GNFI libCall method must not be called"); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalFrameInstance.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalFrameInstance.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalFrameInstance.java Mon May 25 23:30:34 2015 +0200 @@ -25,7 +25,7 @@ import java.lang.reflect.*; import com.oracle.graal.api.code.stack.*; -import com.oracle.graal.compiler.common.*; +import com.oracle.jvmci.common.*; import com.oracle.truffle.api.*; import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.api.frame.*; @@ -73,7 +73,7 @@ } return (Frame) stackFrame.getLocal(getFrameIndex()); default: - throw GraalInternalError.unimplemented(); + throw JVMCIError.unimplemented(); } } @@ -96,7 +96,7 @@ try { METHOD = OptimizedDirectCallNode.class.getDeclaredMethod("callProxy", MaterializedFrameNotify.class, CallTarget.class, VirtualFrame.class, Object[].class, boolean.class); } catch (NoSuchMethodException | SecurityException e) { - throw new GraalInternalError(e); + throw new JVMCIError(e); } } private static final int NOTIFY_INDEX = 0; @@ -141,7 +141,7 @@ try { METHOD = OptimizedCallTarget.class.getDeclaredMethod("callProxy", VirtualFrame.class); } catch (NoSuchMethodException | SecurityException e) { - throw new GraalInternalError(e); + throw new JVMCIError(e); } } private static final int NOTIFY_INDEX = -1; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalTruffleRuntime.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalTruffleRuntime.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalTruffleRuntime.java Mon May 25 23:30:34 2015 +0200 @@ -32,7 +32,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.debug.*; -import com.oracle.graal.debug.Debug.*; +import com.oracle.graal.debug.Debug.Scope; import com.oracle.graal.nodes.*; import com.oracle.graal.truffle.debug.*; import com.oracle.graal.truffle.unsafe.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedAssumption.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedAssumption.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedAssumption.java Mon May 25 23:30:34 2015 +0200 @@ -31,7 +31,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.debug.*; import com.oracle.truffle.api.*; -import com.oracle.truffle.api.CompilerDirectives.*; +import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.api.impl.*; import com.oracle.truffle.api.nodes.*; diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Mon May 25 23:30:34 2015 +0200 @@ -31,9 +31,9 @@ import java.util.stream.*; import com.oracle.graal.api.code.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; import com.oracle.graal.truffle.debug.*; +import com.oracle.jvmci.common.*; import com.oracle.truffle.api.*; import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; import com.oracle.truffle.api.frame.*; @@ -517,7 +517,7 @@ try { return OptimizedCallTarget.class.getDeclaredMethod("callDirect", Object[].class); } catch (NoSuchMethodException | SecurityException e) { - throw new GraalInternalError(e); + throw new JVMCIError(e); } } @@ -525,7 +525,7 @@ try { return OptimizedCallTarget.class.getDeclaredMethod("callInlined", Object[].class); } catch (NoSuchMethodException | SecurityException e) { - throw new GraalInternalError(e); + throw new JVMCIError(e); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Mon May 25 23:30:34 2015 +0200 @@ -32,7 +32,6 @@ import com.oracle.graal.api.code.*; 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; @@ -59,6 +58,7 @@ import com.oracle.graal.truffle.phases.*; import com.oracle.graal.truffle.substitutions.*; import com.oracle.graal.virtual.phases.ea.*; +import com.oracle.jvmci.common.*; import com.oracle.truffle.api.*; import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.api.nodes.*; @@ -191,7 +191,7 @@ if (original.equals(callSiteProxyMethod)) { ValueNode arg1 = arguments[0]; if (!arg1.isConstant()) { - GraalInternalError.shouldNotReachHere("The direct call node does not resolve to a constant!"); + JVMCIError.shouldNotReachHere("The direct call node does not resolve to a constant!"); } Object callNode = snippetReflection.asObject(Object.class, (JavaConstant) arg1.asConstant()); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/ReadOnlyFrame.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/ReadOnlyFrame.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/ReadOnlyFrame.java Mon May 25 23:30:34 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.truffle; -import com.oracle.graal.compiler.common.*; +import com.oracle.jvmci.common.*; import com.oracle.truffle.api.frame.*; class ReadOnlyFrame implements Frame { @@ -45,7 +45,7 @@ } public void setObject(FrameSlot slot, Object value) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public byte getByte(FrameSlot slot) throws FrameSlotTypeException { @@ -53,7 +53,7 @@ } public void setByte(FrameSlot slot, byte value) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public boolean getBoolean(FrameSlot slot) throws FrameSlotTypeException { @@ -61,7 +61,7 @@ } public void setBoolean(FrameSlot slot, boolean value) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public int getInt(FrameSlot slot) throws FrameSlotTypeException { @@ -69,7 +69,7 @@ } public void setInt(FrameSlot slot, int value) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public long getLong(FrameSlot slot) throws FrameSlotTypeException { @@ -77,7 +77,7 @@ } public void setLong(FrameSlot slot, long value) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public float getFloat(FrameSlot slot) throws FrameSlotTypeException { @@ -85,7 +85,7 @@ } public void setFloat(FrameSlot slot, float value) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public double getDouble(FrameSlot slot) throws FrameSlotTypeException { @@ -93,7 +93,7 @@ } public void setDouble(FrameSlot slot, double value) { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public Object getValue(FrameSlot slot) { @@ -101,7 +101,7 @@ } public MaterializedFrame materialize() { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } public boolean isObject(FrameSlot slot) { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationCallTreeListener.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationCallTreeListener.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationCallTreeListener.java Mon May 25 23:30:34 2015 +0200 @@ -29,7 +29,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.nodes.*; import com.oracle.graal.truffle.*; -import com.oracle.graal.truffle.TruffleInlining.*; +import com.oracle.graal.truffle.TruffleInlining.CallTreeNodeVisitor; import com.oracle.truffle.api.nodes.*; public final class TraceCompilationCallTreeListener extends AbstractDebugCompilationListener { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceSplittingListener.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceSplittingListener.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceSplittingListener.java Mon May 25 23:30:34 2015 +0200 @@ -28,7 +28,7 @@ import com.oracle.graal.truffle.*; import com.oracle.truffle.api.nodes.*; -import com.oracle.truffle.api.nodes.NodeUtil.*; +import com.oracle.truffle.api.nodes.NodeUtil.NodeCountFilter; public final class TraceSplittingListener extends AbstractDebugCompilationListener { diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/NewFrameNode.java Mon May 25 23:30:34 2015 +0200 @@ -27,7 +27,6 @@ import com.oracle.graal.api.meta.*; 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.*; @@ -39,6 +38,7 @@ import com.oracle.graal.nodes.virtual.*; import com.oracle.graal.truffle.*; import com.oracle.graal.truffle.nodes.*; +import com.oracle.jvmci.common.*; import com.oracle.truffle.api.frame.*; /** @@ -134,7 +134,7 @@ escapeReason = "Must not let virtual frame object escape at node " + fixed + "."; } - Throwable exception = new GraalInternalError(escapeReason + + Throwable exception = new JVMCIError(escapeReason + " Insert a call to VirtualFrame.materialize() to convert the instance to a materialized frame object (source position of following stack trace is approximate)"); throw GraphUtil.approxSourceException(fixed, exception); } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/unsafe/UnsafeAccessImpl.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/unsafe/UnsafeAccessImpl.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/unsafe/UnsafeAccessImpl.java Mon May 25 23:30:34 2015 +0200 @@ -26,7 +26,6 @@ import sun.misc.*; -import com.oracle.truffle.api.*; import com.oracle.truffle.api.unsafe.*; @SuppressWarnings("unused") diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/EffectList.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/EffectList.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/EffectList.java Mon May 25 23:30:34 2015 +0200 @@ -25,10 +25,10 @@ import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.common.*; /** * An {@link EffectList} can be used to maintain a list of {@link Effect}s and backtrack to a @@ -171,7 +171,7 @@ } catch (Throwable t) { StringBuilder str = new StringBuilder(); toString(str, i); - throw new GraalInternalError(t).addContext("effect", str); + throw new JVMCIError(t).addContext("effect", str); } if (effect.isVisible() && Debug.isLogEnabled()) { StringBuilder str = new StringBuilder(); diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/EffectsClosure.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/EffectsClosure.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/EffectsClosure.java Mon May 25 23:30:34 2015 +0200 @@ -39,6 +39,7 @@ import com.oracle.graal.phases.graph.ReentrantBlockIterator.BlockIteratorClosure; import com.oracle.graal.phases.graph.ReentrantBlockIterator.LoopInfo; import com.oracle.graal.phases.schedule.*; +import com.oracle.jvmci.common.*; public abstract class EffectsClosure> extends EffectsPhase.Closure { @@ -243,7 +244,7 @@ } } } - throw new GraalInternalError("too many iterations at %s", loop); + throw new JVMCIError("too many iterations at %s", loop); } @SuppressWarnings("unused") diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/VirtualUtil.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/VirtualUtil.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/VirtualUtil.java Mon May 25 23:30:34 2015 +0200 @@ -27,15 +27,15 @@ import java.util.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.common.*; public final class VirtualUtil { private VirtualUtil() { - GraalInternalError.shouldNotReachHere(); + JVMCIError.shouldNotReachHere(); } public static boolean assertNonReachable(StructuredGraph graph, List obsoleteNodes) { diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.word/src/com/oracle/graal/word/Pointer.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/Pointer.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/Pointer.java Mon May 25 23:30:34 2015 +0200 @@ -24,7 +24,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.extended.*; -import com.oracle.graal.nodes.memory.HeapAccess.*; +import com.oracle.graal.nodes.memory.HeapAccess.BarrierType; /** * Lowest-level memory access of native C memory. These methods access the raw memory without any diff -r 543957c1c6a6 -r 93c50cefb9e8 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 Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/Word.java Mon May 25 23:30:34 2015 +0200 @@ -28,11 +28,11 @@ 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.*; import com.oracle.graal.nodes.calc.*; -import com.oracle.graal.nodes.memory.HeapAccess.*; +import com.oracle.graal.nodes.memory.HeapAccess.BarrierType; +import com.oracle.jvmci.common.*; public abstract class Word implements Signed, Unsigned, Pointer { @@ -1087,17 +1087,17 @@ @Override public final boolean equals(Object obj) { - throw GraalInternalError.shouldNotReachHere("equals must not be called on words"); + throw JVMCIError.shouldNotReachHere("equals must not be called on words"); } @Override public final int hashCode() { - throw GraalInternalError.shouldNotReachHere("hashCode must not be called on words"); + throw JVMCIError.shouldNotReachHere("hashCode must not be called on words"); } @Override public String toString() { - throw GraalInternalError.shouldNotReachHere("toString must not be called on words"); + throw JVMCIError.shouldNotReachHere("toString must not be called on words"); } } diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/SnippetLocationNode.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/SnippetLocationNode.java Mon May 25 22:30:44 2015 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/SnippetLocationNode.java Mon May 25 23:30:34 2015 +0200 @@ -26,7 +26,6 @@ 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.graph.*; import com.oracle.graal.graph.spi.*; @@ -35,6 +34,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.common.*; /** * Location node that can be used inside a snippet without having the elements (including the @@ -97,12 +97,12 @@ @Override public Value generateAddress(NodeMappableLIRBuilder builder, LIRGeneratorTool gen, Value base) { - throw new GraalInternalError("locationIdentity must be a constant so that this node can be canonicalized: " + locationIdentity); + throw new JVMCIError("locationIdentity must be a constant so that this node can be canonicalized: " + locationIdentity); } @Override public IntegerStamp getDisplacementStamp() { - throw GraalInternalError.shouldNotReachHere(); + throw JVMCIError.shouldNotReachHere(); } @NodeIntrinsic diff -r 543957c1c6a6 -r 93c50cefb9e8 graal/com.oracle.jvmci.common/src/com/oracle/jvmci/common/JVMCIError.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.common/src/com/oracle/jvmci/common/JVMCIError.java Mon May 25 23:30:34 2015 +0200 @@ -0,0 +1,139 @@ +/* + * 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.jvmci.common; + +import java.util.*; + +/** + * Indicates a condition in JVMCI related code that should never occur during normal operation. + */ +public class JVMCIError extends Error { + + private static final long serialVersionUID = 531632331813456233L; + private final ArrayList context = new ArrayList<>(); + + public static RuntimeException unimplemented() { + throw new JVMCIError("unimplemented"); + } + + public static RuntimeException unimplemented(String msg) { + throw new JVMCIError("unimplemented: %s", msg); + } + + public static RuntimeException shouldNotReachHere() { + throw new JVMCIError("should not reach here"); + } + + public static RuntimeException shouldNotReachHere(String msg) { + throw new JVMCIError("should not reach here: %s", msg); + } + + public static RuntimeException shouldNotReachHere(Throwable cause) { + throw new JVMCIError(cause); + } + + /** + * Checks a given condition and throws a {@link JVMCIError} if it is false. Guarantees + * are stronger than assertions in that they are always checked. Error messages for guarantee + * violations should clearly indicate the nature of the problem as well as a suggested solution + * if possible. + * + * @param condition the condition to check + * @param msg the message that will be associated with the error, in + * {@link String#format(String, Object...)} syntax + * @param args arguments to the format string + */ + public static void guarantee(boolean condition, String msg, Object... args) { + if (!condition) { + throw new JVMCIError("failed guarantee: " + msg, args); + } + } + + /** + * This constructor creates a {@link JVMCIError} with a message assembled via + * {@link String#format(String, Object...)}. It always uses the ENGLISH locale in order to + * always generate the same output. + * + * @param msg the message that will be associated with the error, in String.format syntax + * @param args parameters to String.format - parameters that implement {@link Iterable} will be + * expanded into a [x, x, ...] representation. + */ + public JVMCIError(String msg, Object... args) { + super(format(msg, args)); + } + + /** + * This constructor creates a {@link JVMCIError} for a given causing Throwable instance. + * + * @param cause the original exception that contains additional information on this error + */ + public JVMCIError(Throwable cause) { + super(cause); + } + + /** + * This constructor creates a {@link JVMCIError} and adds all the + * {@linkplain #addContext(String) context} of another {@link JVMCIError}. + * + * @param e the original {@link JVMCIError} + */ + public JVMCIError(JVMCIError e) { + super(e); + context.addAll(e.context); + } + + @Override + public String toString() { + StringBuilder str = new StringBuilder(); + str.append(super.toString()); + for (String s : context) { + str.append("\n\tat ").append(s); + } + return str.toString(); + } + + private static String format(String msg, Object... args) { + if (args != null) { + // expand Iterable parameters into a list representation + for (int i = 0; i < args.length; i++) { + if (args[i] instanceof Iterable) { + ArrayList list = new ArrayList<>(); + for (Object o : (Iterable) args[i]) { + list.add(o); + } + args[i] = list.toString(); + } + } + } + return String.format(Locale.ENGLISH, msg, args); + } + + public JVMCIError addContext(String newContext) { + this.context.add(newContext); + return this; + } + + public JVMCIError addContext(String name, Object obj) { + return addContext(format("%s: %s", name, obj)); + } +}