diff --git a/aeneas/src/core/Eval.v3 b/aeneas/src/core/Eval.v3 index a803cf15b..192f6c777 100644 --- a/aeneas/src/core/Eval.v3 +++ b/aeneas/src/core/Eval.v3 @@ -399,30 +399,17 @@ def evalOp(op: Operator, args: Arguments) -> Result { FloatFloor(isDouble) => return if(isDouble, args.do_d_d(double.floor), args.do_f_f(float.floor)); FloatSqrt(isDouble) => return if(isDouble, args.do_d_d(double.sqrt), args.do_f_f(float.sqrt)); //---------------------------------------------------------------------------- - IntCastI => { - var val = args.getArg(0), ift = args.it(0), itt = args.it(1); - if (!Eval.doIntQuery(ift, itt, val)) return args.throw(V3Exception.TypeCheck, null); - return Eval.doIntView(ift, itt, val); - } IntCastF(isDouble) => { var d: double = if(isDouble, args.d(0), args.f(0)); var t = convert_d(args.it(1), d); if (t.1 || t.2) return args.throw(V3Exception.TypeCheck, null); return t.0; } - IntQueryI => { - var val = args.getArg(0), ift = args.it(0), itt = args.it(1); - return if(Eval.doIntQuery(ift, itt, val), Bool.TRUE, Bool.FALSE); - } IntQueryF(isDouble) => { var d: double = if(isDouble, args.d(0), args.f(0)); var t = convert_d(args.it(1), d); return Bool.box(!(t.1 | t.2)); } - IntPromoteI => { - var val = args.getArg(0), ift = args.it(0), itt = args.it(1); - return Eval.doIntPromote(ift, itt, val); - } IntViewI => { var val = args.getArg(0), ift = args.it(0), itt = args.it(1); return Eval.doIntView(ift, itt, val); diff --git a/aeneas/src/core/Opcode.v3 b/aeneas/src/core/Opcode.v3 index 5b6460452..07b64044e 100644 --- a/aeneas/src/core/Opcode.v3 +++ b/aeneas/src/core/Opcode.v3 @@ -39,11 +39,8 @@ type Opcode { case FloatFloor(isDouble: bool); case FloatSqrt(isDouble: bool); // Integer casts and conversions - case IntCastI; case IntCastF(isDouble: bool); - case IntQueryI; case IntQueryF(isDouble: bool); - case IntPromoteI; case IntViewI; case IntViewF(isDouble: bool); case IntTruncF(isDouble: bool); @@ -212,12 +209,9 @@ component Opcodes { t[Opcode.FloatFloor.tag] = P; t[Opcode.FloatSqrt.tag] = P; - t[Opcode.IntCastI.tag] = F; t[Opcode.IntCastF.tag] = F; - t[Opcode.IntQueryI.tag] = P; t[Opcode.IntQueryF.tag] = P; t[Opcode.IntViewI.tag] = P; - t[Opcode.IntPromoteI.tag] = P; t[Opcode.IntViewI.tag] = P; t[Opcode.IntViewF.tag] = P; t[Opcode.IntTruncF.tag] = P; diff --git a/aeneas/src/core/Operator.v3 b/aeneas/src/core/Operator.v3 index 62ac4490f..16eb23fbb 100644 --- a/aeneas/src/core/Operator.v3 +++ b/aeneas/src/core/Operator.v3 @@ -105,24 +105,15 @@ component V3Op { def opFloatBitEq32 = newOp0(Opcode.FloatBitEq(false), arr_f, arr_ff, type_z); def opFloatBitEq64 = newOp0(Opcode.FloatBitEq(true), arr_d, arr_dd, type_z); //---------------------------------------------------------------------------- - def newIntCastI(f: Type, t: Type) -> Operator { - return newOp0(Opcode.IntCastI, [f, t], [f], t); - } def newIntCastF(ft: Type, tt: Type) -> Operator { return newOp0(Opcode.IntCastF(V3.isDouble(ft)), [ft, tt], [ft], tt); } - def newIntQueryI(ft: Type, tt: Type) -> Operator { - return newOp0(Opcode.IntQueryI, [ft, tt], [ft], type_z); - } def newIntQueryF(ft: Type, tt: Type) -> Operator { return newOp0(Opcode.IntQueryF(V3.isDouble(ft)), [ft, tt], [ft], type_z); } def newIntViewI(ft: Type, tt: Type) -> Operator { return newOp0(Opcode.IntViewI, [ft, tt], [ft], tt); } - def newIntPromoteI(ft: Type, tt: Type) -> Operator { - return newOp0(Opcode.IntPromoteI, [ft, tt], [ft], tt); - } def opIntViewF32 = newOp0(Opcode.IntViewF(false), arr_f, arr_f, type_u); def opIntViewF64 = newOp0(Opcode.IntViewF(true), arr_d, arr_d, Int.getType(false, 64)); def newIntTruncF(ft: Type, tt: Type) -> Operator { diff --git a/aeneas/src/ic/Ic.v3 b/aeneas/src/ic/Ic.v3 index 979bbc3a3..4750d5cdc 100644 --- a/aeneas/src/ic/Ic.v3 +++ b/aeneas/src/ic/Ic.v3 @@ -100,13 +100,6 @@ class IcAssembler(code: Vector) { } IntLt => intCompare(op, IntCompare.IntLtS, IntCompare.IntLtU, dst, args); IntLteq => intCompare(op, IntCompare.IntLteqS, IntCompare.IntLteqU, dst, args); - IntPromoteI => { - var arg0 = args[0]; - var ft = IntType.!(op.sig.paramTypes[0]), tt = IntType.!(op.sig.returnType()); - if (!TypeSystem.isIntToLong(ft, tt)) return arg0; - code.put(IcInstr.Int32Unop(dst, arg0, 0, if(ft.signed, IntUnop.IntToLongS, IntUnop.IntToLongU), null)); - return dst; - } IntViewI => { var arg0 = args[0]; var ft = IntType.!(op.sig.paramTypes[0]), tt = IntType.!(op.sig.returnType()); diff --git a/aeneas/src/ir/Reachability.v3 b/aeneas/src/ir/Reachability.v3 index d0cc9d614..dfe8e10e5 100644 --- a/aeneas/src/ir/Reachability.v3 +++ b/aeneas/src/ir/Reachability.v3 @@ -31,7 +31,6 @@ def live(facts: RaFact.set) -> bool { return (facts & (RaFact.RC_LIVE | RaFact.RC_ALLOC)) != NONE; } -def NO_RECORDS = Array.new(0); def MONO_TYPEARGS: Array = [AnyRef.TYPE]; def EQUALS_VST_METHOD = VstMethod.new(false, Token.new(null, "==", 0, 0), null, null, ReturnType.Void, null); diff --git a/aeneas/src/ir/SsaNormalizer.v3 b/aeneas/src/ir/SsaNormalizer.v3 index 5417d32c9..2281daf3c 100644 --- a/aeneas/src/ir/SsaNormalizer.v3 +++ b/aeneas/src/ir/SsaNormalizer.v3 @@ -158,27 +158,6 @@ class SsaRaNormalizer extends SsaRebuilder { var orig = app.op, op = app.op, args = app.inputs; if (context.spec != null) op = app.op.subst(context.spec.instantiateType); match (op.opcode) { - IntQueryI => { - var ft = op.typeArgs[0], tt = op.typeArgs[1], x = genRef1(args[0]); - var ni: SsaInstr; - if (!IntType.?(ft)) { - ni = newGraph.falseConst(); - } else { - ni = curBlock.opIntQueryI(IntType.!(ft), IntType.!(tt), x); - } - map1(app, ni); - } - IntCastI => { - var ft = op.typeArgs[0], tt = op.typeArgs[1], x = genRef1(args[0]); - var ni: SsaInstr; - if (!IntType.?(ft)) { - curBlock.addThrow(app.source, V3Exception.TypeCheck); - ni = newGraph.nullConst(tt); - } else { - ni = curBlock.opIntCastI(IntType.!(ft), IntType.!(tt), x); - } - map1(app, ni); - } BoolEq, RefEq, IntEq => normSimpleEqualOp(app, op); diff --git a/aeneas/src/jvm/JvmType.v3 b/aeneas/src/jvm/JvmType.v3 index 5ac7d6108..7fef744e7 100644 --- a/aeneas/src/jvm/JvmType.v3 +++ b/aeneas/src/jvm/JvmType.v3 @@ -148,8 +148,6 @@ component JvmTypes { def DOUBLE = JvmPrimitive.new("double", "D", "D", KIND_DOUBLE); def VOID = JvmPrimitive.new("void", "V", "V", KIND_VOID); - def hash(jvmType: JvmType) -> int { return Strings.hash(jvmType.name); } - def jlo = "java/lang/Object"; def jln = "java/lang/Number"; def systemClassName = "V3S_System"; diff --git a/aeneas/src/mach/CiRuntime.v3 b/aeneas/src/mach/CiRuntime.v3 index 00b759d7a..79d0cc452 100644 --- a/aeneas/src/mach/CiRuntime.v3 +++ b/aeneas/src/mach/CiRuntime.v3 @@ -3,7 +3,6 @@ // Defines operations and constants exposed by the compiler (Ci) to the runtime (Runtime). component CiRuntimeModule { - def NAME = "CiRuntime"; var max = 0; def map = Strings.newMap(); // region begin and end constants diff --git a/aeneas/src/mach/MachBackend.v3 b/aeneas/src/mach/MachBackend.v3 index f496ce0f7..a930b2711 100644 --- a/aeneas/src/mach/MachBackend.v3 +++ b/aeneas/src/mach/MachBackend.v3 @@ -447,10 +447,6 @@ class SsaMachGen(context: SsaContext, mach: MachProgram, regSet: MachRegSet, w: } emitN(ArchInstrs.ARCH_PARMOVE); } - // Mark {i} as live in {block} - def setLive(i: SsaInstr, block: SsaBlock) { - liveness[block.mark, getVReg(i).varNum] = true; - } // Check if {i} is live in {block} def isLive(i: SsaLink, block: SsaBlock) -> bool { if (i.mark >= context.graph.markGen) { diff --git a/aeneas/src/main/Version.v3 b/aeneas/src/main/Version.v3 index f038b4e6a..578902908 100644 --- a/aeneas/src/main/Version.v3 +++ b/aeneas/src/main/Version.v3 @@ -3,6 +3,6 @@ // Updated by VCS scripts. DO NOT EDIT. component Version { - def version: string = "III-7.1651"; + def version: string = "III-7.1652"; var buildData: string; } diff --git a/aeneas/src/ssa/Ssa.v3 b/aeneas/src/ssa/Ssa.v3 index e2327f80b..f915f0163 100644 --- a/aeneas/src/ssa/Ssa.v3 +++ b/aeneas/src/ssa/Ssa.v3 @@ -297,13 +297,6 @@ component Ssa { for (i < r.length) r[i] = x.inputs[i].dest; return r; } - // find the edge number of an input edge in the list of edges - def findIncomingPhiEdge(edge: SsaCfEdge, context: SsaContext) -> int { - if (Debug.PARANOID) { - if (edge.dest.preds[edge.desti] != edge) context.fail("Edge malformed"); - } - return edge.desti; - } // Inserts an intermediate block between any control-flow edges from a // predecessor with more than one successor to a successor with more than // one predecessor. diff --git a/aeneas/src/types/Int.v3 b/aeneas/src/types/Int.v3 index 52fe46b46..12459b8b4 100644 --- a/aeneas/src/types/Int.v3 +++ b/aeneas/src/types/Int.v3 @@ -1,11 +1,6 @@ // Copyright 2011 Google Inc. All rights reserved. // See LICENSE for details of Apache 2.0 license. -def MAX_VALUE_DIV_10 = 214748364; -def MAX_VALUE_MOD_10 = 7; -def MIN_VALUE_DIV_10 = -214748364; -def MIN_VALUE_MOD_10 = 8; -def ZERO_CHAR: u32 = '0'; // Utility methods for working with ints, including parsing and rendering, // as well as the representation of the "int" type in the compiler component Int { @@ -26,10 +21,6 @@ component Int { true, checkIntViewTypeArg(32, _, _)), null); def VIEW_TYPE_PARAM_LIST_64 = List.new(TypeUtil.newTypeParamWithConstraint(TypeUtil.BUILTIN_TOKEN, TypeUtil.globalCache, true, checkIntViewTypeArg(64, _, _)), null); - def QUERY_TYPE_PARAM_LIST = List.new(TypeUtil.newTypeParamWithConstraint(TypeUtil.BUILTIN_TOKEN, TypeUtil.globalCache, - false, checkIntOpTypeArg("query", _, _)), null); - def CAST_TYPE_PARAM_LIST = List.new(TypeUtil.newTypeParamWithConstraint(TypeUtil.BUILTIN_TOKEN, TypeUtil.globalCache, - false, checkIntOpTypeArg("cast", _, _)), null); def getType(signed: bool, width: int) -> IntType { if (width <= 0 || width > MAX_WIDTH) return null; diff --git a/aeneas/src/types/Void.v3 b/aeneas/src/types/Void.v3 index 903542d0f..a084641f1 100644 --- a/aeneas/src/types/Void.v3 +++ b/aeneas/src/types/Void.v3 @@ -4,7 +4,6 @@ // Representation of the void type. component Void { def TYPE = TypeUtil.singleType("void", V3Kind.VOID, VoidType.new); - def TYPE_ARRAY: Array = [TYPE]; def ERROR_TYPE = TypeUtil.singleType("?", V3Kind.VOID, ErrorType.new); } // Representation of the null type, used internally. diff --git a/aeneas/src/util/Char.v3 b/aeneas/src/util/Char.v3 index b3c9a332c..666e5b9de 100644 --- a/aeneas/src/util/Char.v3 +++ b/aeneas/src/util/Char.v3 @@ -37,9 +37,6 @@ component Char { def isHex(ch: byte) -> bool { return (properties[ch] & IS_HEX) != 0; } - def isHexOrUnderscore(ch: byte) -> bool { - return ((properties[ch] & IS_HEX) != 0) || ch == '_'; - } def isBinary(ch: byte) -> bool { return (u32.!(ch) - '0') <= u32.!(1); } diff --git a/aeneas/src/util/Terminal.v3 b/aeneas/src/util/Terminal.v3 index 879133dc9..e2f89cfcc 100644 --- a/aeneas/src/util/Terminal.v3 +++ b/aeneas/src/util/Terminal.v3 @@ -37,7 +37,6 @@ component Terminal { } def ln() { putc('\n'); } def sp() { putc(' '); } - def tab() { putc('\t'); } def putd(val: int) { System.puti(val); } def put1(fmt: string, a: A) { buf.put1(fmt, a).outt(); } def put2(fmt: string, a: A, b: B) { buf.put2(fmt, a, b).outt(); } diff --git a/aeneas/src/v3/V3.v3 b/aeneas/src/v3/V3.v3 index 9601d7a12..ce647cfe6 100644 --- a/aeneas/src/v3/V3.v3 +++ b/aeneas/src/v3/V3.v3 @@ -76,6 +76,7 @@ component V3 { } return null; } + // TODO: inline all V3.isXXX() type query methods def isClass(t: Type) -> bool { return ClassType.?(t); } def isComponent(t: Type) -> bool { return t != null && V3Component_TypeCon.?(t.typeCon); } // TODO def isFunction(t: Type) -> bool { return FuncType.?(t); } diff --git a/aeneas/src/v3/V3Enum.v3 b/aeneas/src/v3/V3Enum.v3 index 60eab7a0f..39d9b83cf 100644 --- a/aeneas/src/v3/V3Enum.v3 +++ b/aeneas/src/v3/V3Enum.v3 @@ -38,12 +38,6 @@ class EnumType extends Type { return IntType.!(enumDecl.tagType).packedByteSize(); } } -def enumSetName(enumDecl: VstEnum) -> string { - return Strings.builderOf(enumDecl.fullName).puts(".set").toString(); -} -def intTypeOrU1(length: int) -> IntType { - return Int.getType(false, if(length == 0, 1, length)); -} // The type for user-declared enums' sets. class EnumSetType extends Type { def enumDecl: VstEnum; diff --git a/aeneas/src/vst/Parser.v3 b/aeneas/src/vst/Parser.v3 index 9e6bcb13b..e76591dd0 100644 --- a/aeneas/src/vst/Parser.v3 +++ b/aeneas/src/vst/Parser.v3 @@ -1020,13 +1020,6 @@ component Parser { def kwError(p: ParserState, id: Token) { p.errorAt(id.range(), Strings.format1("keyword \"%s\" cannot be used as identifier", id.image)); } - def parseDecimalTokenInString(p: ParserState) -> Token { - var diff = 0; - while (Char.isDecimal(p.peek(diff))) { diff++; } - if (diff > 0) { return p.token(diff); } - p.error("missing UnitDecimal unit"); - return null; - } def parseIdentVoid(p: ParserState) -> VstIdent { var id = parseIdentCommon(p, null); if (id.kwClass != 0) kwError(p, id.name);