# HG changeset patch # User Lukas Stadler # Date 1363784503 -3600 # Node ID 701290361dadf58c663d1810ac064a578dac0b40 # Parent afb190b1eeb348baf563c806308220b4ab1ae3e2# Parent 0e2c530885d101ecf6d33f077060c3950b93638c Merge diff -r afb190b1eeb3 -r 701290361dad 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 Mar 11 18:41:33 2013 +0100 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Wed Mar 20 14:01:43 2013 +0100 @@ -369,6 +369,14 @@ } @Override + public void emitNullCheck(ValueNode v) { + assert v.kind() == Kind.Object; + Variable obj = newVariable(Kind.Object); + emitMove(obj, operand(v)); + append(new AMD64Move.NullCheckOp(obj, state())); + } + + @Override public Variable emitNegate(Value inputVal) { AllocatableValue input = asAllocatable(inputVal); Variable result = newVariable(input.getKind()); diff -r afb190b1eeb3 -r 701290361dad graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java --- a/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java Mon Mar 11 18:41:33 2013 +0100 +++ b/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java Wed Mar 20 14:01:43 2013 +0100 @@ -472,4 +472,9 @@ // TODO Auto-generated method stub } + + @Override + public void emitNullCheck(ValueNode v) { + throw new InternalError("NYI"); + } } diff -r afb190b1eeb3 -r 701290361dad 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 Mar 11 18:41:33 2013 +0100 +++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Wed Mar 20 14:01:43 2013 +0100 @@ -365,7 +365,13 @@ @Override public void emitUnwind(Value operand) { - // TODO Auto-generated method stub + // SPARC: Auto-generated method stub + + } + + @Override + public void emitNullCheck(ValueNode v) { + // SPARC: Auto-generated method stub } } diff -r afb190b1eeb3 -r 701290361dad 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 Mar 11 18:41:33 2013 +0100 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java Wed Mar 20 14:01:43 2013 +0100 @@ -297,7 +297,7 @@ public static class NullCheckOp extends AMD64LIRInstruction { - @Use protected AllocatableValue input; + @Use({REG}) protected AllocatableValue input; @State protected LIRFrameState state; public NullCheckOp(Variable input, LIRFrameState state) { diff -r afb190b1eeb3 -r 701290361dad graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/NullCheckNode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/NullCheckNode.java Wed Mar 20 14:01:43 2013 +0100 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.nodes.extended; + +import com.oracle.graal.nodes.*; +import com.oracle.graal.nodes.spi.*; +import com.oracle.graal.nodes.type.*; + +public class NullCheckNode extends FixedWithNextNode implements LIRLowerable { + + @Input public ValueNode object; + + public NullCheckNode(ValueNode object) { + super(StampFactory.dependency()); + this.object = object; + } + + public ValueNode getObject() { + return object; + } + + @Override + public void generate(LIRGeneratorTool generator) { + generator.emitNullCheck(object); + } +} diff -r afb190b1eeb3 -r 701290361dad graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java Mon Mar 11 18:41:33 2013 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java Wed Mar 20 14:01:43 2013 +0100 @@ -99,6 +99,8 @@ public abstract void emitDeoptimize(DeoptimizationAction action, DeoptimizationReason reason); + public abstract void emitNullCheck(ValueNode v); + public abstract Value emitCall(RuntimeCallTarget callTarget, CallingConvention cc, boolean canTrap, Value... args); public abstract void emitIf(IfNode i); diff -r afb190b1eeb3 -r 701290361dad graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java Mon Mar 11 18:41:33 2013 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java Wed Mar 20 14:01:43 2013 +0100 @@ -59,7 +59,7 @@ useImplicitNullChecks(block.getBeginNode(), nodes, graph, target); } FixedWithNextNode lastFixed = block.getBeginNode(); - BeginNode lastFastPath = null; + FixedWithNextNode lastFastPath = null; for (Node node : nodes) { if (!node.isAlive()) { continue; @@ -72,29 +72,38 @@ lastFixed = (FixedWithNextNode) node; } else if (node instanceof GuardNode) { GuardNode guard = (GuardNode) node; - BeginNode fastPath = graph.add(new BeginNode()); - BeginNode trueSuccessor; - BeginNode falseSuccessor; - DeoptimizeNode deopt = graph.add(new DeoptimizeNode(guard.action(), guard.reason())); - BeginNode deoptBranch = BeginNode.begin(deopt); - Loop loop = block.getLoop(); - while (loop != null) { - LoopExitNode exit = graph.add(new LoopExitNode(loop.loopBegin())); - graph.addBeforeFixed(deopt, exit); - loop = loop.parent; + if (guard.negated() && guard.condition() instanceof IsNullNode) { + IsNullNode isNull = (IsNullNode) guard.condition(); + NullCheckNode nullCheck = graph.add(new NullCheckNode(isNull.object())); + guard.replaceAndDelete(nullCheck); + lastFixed.setNext(nullCheck); + lastFixed = nullCheck; + lastFastPath = nullCheck; + } else { + BeginNode fastPath = graph.add(new BeginNode()); + BeginNode trueSuccessor; + BeginNode falseSuccessor; + DeoptimizeNode deopt = graph.add(new DeoptimizeNode(guard.action(), guard.reason())); + BeginNode deoptBranch = BeginNode.begin(deopt); + Loop loop = block.getLoop(); + while (loop != null) { + LoopExitNode exit = graph.add(new LoopExitNode(loop.loopBegin())); + graph.addBeforeFixed(deopt, exit); + loop = loop.parent; + } + if (guard.negated()) { + trueSuccessor = deoptBranch; + falseSuccessor = fastPath; + } else { + trueSuccessor = fastPath; + falseSuccessor = deoptBranch; + } + IfNode ifNode = graph.add(new IfNode(guard.condition(), trueSuccessor, falseSuccessor, trueSuccessor == fastPath ? 1 : 0)); + guard.replaceAndDelete(fastPath); + lastFixed.setNext(ifNode); + lastFixed = fastPath; + lastFastPath = fastPath; } - if (guard.negated()) { - trueSuccessor = deoptBranch; - falseSuccessor = fastPath; - } else { - trueSuccessor = fastPath; - falseSuccessor = deoptBranch; - } - IfNode ifNode = graph.add(new IfNode(guard.condition(), trueSuccessor, falseSuccessor, trueSuccessor == fastPath ? 1 : 0)); - guard.replaceAndDelete(fastPath); - lastFixed.setNext(ifNode); - lastFixed = fastPath; - lastFastPath = fastPath; } } } diff -r afb190b1eeb3 -r 701290361dad mx/sanitycheck.py --- a/mx/sanitycheck.py Mon Mar 11 18:41:33 2013 +0100 +++ b/mx/sanitycheck.py Wed Mar 20 14:01:43 2013 +0100 @@ -47,7 +47,7 @@ dacapoScalaSanityWarmup = { 'actors': [0, 0, 2, 8, 10], # (lstadler) apparat was disabled due to a deadlock which I think is the benchmarks fault. -# 'apparat': [0, 0, 1, 2, 3], + 'apparat': [0, 0, 0, 0, 0], 'factorie': [0, 0, 2, 5, 5], 'kiama': [0, 0, 3, 13, 15], 'scalac': [0, 0, 5, 15, 20], @@ -56,7 +56,8 @@ 'scalariform':[0, 0, 6, 15, 20], 'scalatest': [0, 0, 2, 10, 12], 'scalaxb': [0, 0, 5, 15, 25], - 'specs': [0, 0, 3, 13, 18], +#(gdub) specs sometimes returns a non-zero value event though there is no apparent failure + 'specs': [0, 0, 0, 0, 0], 'tmt': [0, 0, 3, 10, 12] } diff -r afb190b1eeb3 -r 701290361dad mxtool/mx.py --- a/mxtool/mx.py Mon Mar 11 18:41:33 2013 +0100 +++ b/mxtool/mx.py Wed Mar 20 14:01:43 2013 +0100 @@ -1061,11 +1061,11 @@ class JavaVersion: def __init__(self, versionString): validChar = '[\x21-\x25\x27-\x29\x2c\x2f-\x5e\x60-\x7f]' - separator = '[.-_]' + separator = '[.\-_]' m = re.match(validChar + '+(' + separator + validChar + '+)*', versionString) assert m is not None, 'not a recognized version string: ' + versionString self.versionString = versionString; - self.parts = versionString.split(separator) + self.parts = [int(f) if f.isdigit() else f for f in re.split(separator, versionString)] def __str__(self): return self.versionString diff -r afb190b1eeb3 -r 701290361dad src/share/vm/runtime/arguments.cpp --- a/src/share/vm/runtime/arguments.cpp Mon Mar 11 18:41:33 2013 +0100 +++ b/src/share/vm/runtime/arguments.cpp Wed Mar 20 14:01:43 2013 +0100 @@ -2070,26 +2070,41 @@ } #ifdef GRAAL if (UseCompressedOops) { - jio_fprintf(defaultStream::error_stream(), + if (IgnoreUnrecognizedVMOptions) { + warning("UseCompressedOops is disabled, because it is not supported by Graal"); + FLAG_SET_CMDLINE(bool, UseCompressedOops, false); + } else { + jio_fprintf(defaultStream::error_stream(), "CompressedOops are not supported in Graal at the moment\n"); - status = false; + status = false; + } } else { // This prevents the flag being set to true by set_ergonomics_flags() FLAG_SET_CMDLINE(bool, UseCompressedOops, false); } if (UseCompressedKlassPointers) { - jio_fprintf(defaultStream::error_stream(), + if (IgnoreUnrecognizedVMOptions) { + warning("UseCompressedKlassPointers is disabled, because it is not supported by Graal"); + FLAG_SET_CMDLINE(bool, UseCompressedKlassPointers, false); + } else { + jio_fprintf(defaultStream::error_stream(), "UseCompressedKlassPointers are not supported in Graal at the moment\n"); - status = false; + status = false; + } } else { // This prevents the flag being set to true by set_ergonomics_flags() FLAG_SET_CMDLINE(bool, UseCompressedKlassPointers, false); } if (UseG1GC) { - jio_fprintf(defaultStream::error_stream(), + if (IgnoreUnrecognizedVMOptions) { + warning("UseG1GC is disabled, because it is not supported by Graal"); + FLAG_SET_CMDLINE(bool, UseG1GC, false); + } else { + jio_fprintf(defaultStream::error_stream(), "G1 is not supported in Graal at the moment\n"); - status = false; + status = false; + } } else { // This prevents the flag being set to true by set_ergonomics_flags() FLAG_SET_CMDLINE(bool, UseG1GC, false);