# HG changeset patch # User Christian Haeubl # Date 1328305319 28800 # Node ID ed73455e9c037c26f396b1b64aff029bacc4ab9f # Parent c84c325ec9eda0a63f2b524f56ec346bc701c8b6 fixed endless recompiles diff -r c84c325ec9ed -r ed73455e9c03 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java Fri Feb 03 13:40:32 2012 -0800 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java Fri Feb 03 13:41:59 2012 -0800 @@ -156,7 +156,7 @@ public void inline(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback) { // receiver null check must be before the type check InliningUtil.receiverNullCheck(invoke); - ReadClassNode objectClass = graph.add(new ReadClassNode(invoke.callTarget().receiver())); + ReadHubNode objectClass = graph.add(new ReadHubNode(invoke.callTarget().receiver())); IsTypeNode isTypeNode = graph.unique(new IsTypeNode(objectClass, type)); FixedGuardNode guard = graph.add(new FixedGuardNode(isTypeNode)); assert invoke.predecessor() != null; @@ -279,7 +279,7 @@ } // replace the invoke with a cascade of if nodes - ReadClassNode objectClassNode = graph.add(new ReadClassNode(invoke.callTarget().receiver())); + ReadHubNode objectClassNode = graph.add(new ReadHubNode(invoke.callTarget().receiver())); graph.addBeforeFixed(invoke.node(), objectClassNode); FixedNode deoptNode = graph.add(new DeoptimizeNode(DeoptAction.InvalidateReprofile)); @@ -305,7 +305,7 @@ MergeNode calleeEntryNode = graph.add(new MergeNode()); calleeEntryNode.setProbability(invoke.probability()); - ReadClassNode objectClassNode = graph.add(new ReadClassNode(invoke.callTarget().receiver())); + ReadHubNode objectClassNode = graph.add(new ReadHubNode(invoke.callTarget().receiver())); graph.addBeforeFixed(invoke.node(), objectClassNode); FixedNode deoptNode = graph.add(new DeoptimizeNode(DeoptAction.InvalidateReprofile)); @@ -319,7 +319,7 @@ InliningUtil.inline(invoke, calleeGraph, false); } - private FixedNode createDispatchOnType(StructuredGraph graph, ReadClassNode objectClassNode, BeginNode[] calleeEntryNodes, FixedNode unknownTypeSux) { + private FixedNode createDispatchOnType(StructuredGraph graph, ReadHubNode objectClassNode, BeginNode[] calleeEntryNodes, FixedNode unknownTypeSux) { assert types.length > 1; // TODO (ch) set probabilities for all fixed nodes... @@ -332,7 +332,7 @@ return nextNode; } - private static FixedNode createTypeCheck(StructuredGraph graph, ReadClassNode objectClassNode, RiResolvedType type, BeginNode tsux, FixedNode nextNode, double tsuxProbability) { + private static FixedNode createTypeCheck(StructuredGraph graph, ReadHubNode objectClassNode, RiResolvedType type, BeginNode tsux, FixedNode nextNode, double tsuxProbability) { IfNode result; IsTypeNode isTypeNode = graph.unique(new IsTypeNode(objectClassNode, type)); if (tsux instanceof MergeNode) { diff -r c84c325ec9ed -r ed73455e9c03 graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodData.java --- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodData.java Fri Feb 03 13:40:32 2012 -0800 +++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodData.java Fri Feb 03 13:41:59 2012 -0800 @@ -161,7 +161,7 @@ } private abstract static class AbstractMethodData implements HotSpotMethodDataAccessor { - private static final int EXCEPTIONS_MASK = 0x08; + private static final int EXCEPTIONS_MASK = 0x80; private final int tag; private final int staticSize; diff -r c84c325ec9ed -r ed73455e9c03 graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodResolvedImpl.java --- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodResolvedImpl.java Fri Feb 03 13:40:32 2012 -0800 +++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodResolvedImpl.java Fri Feb 03 13:41:59 2012 -0800 @@ -243,7 +243,7 @@ } if (profilingInfo.getExceptionSeen(i)) { - TTY.println(" implicitExceptionSeen@%d: true", i); + TTY.println(" exceptionSeen@%d: true", i); } RiTypeProfile typeProfile = profilingInfo.getTypeProfile(i); diff -r c84c325ec9ed -r ed73455e9c03 graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotRuntime.java --- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotRuntime.java Fri Feb 03 13:40:32 2012 -0800 +++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotRuntime.java Fri Feb 03 13:41:59 2012 -0800 @@ -314,8 +314,8 @@ } else if (n instanceof ArrayHeaderSizeNode) { ArrayHeaderSizeNode arrayHeaderSize = (ArrayHeaderSizeNode) n; graph.replaceFloating(arrayHeaderSize, ConstantNode.forLong(config.getArrayOffset(arrayHeaderSize.elementKind()), n.graph())); - } else if (n instanceof ReadClassNode) { - ReadClassNode objectClassNode = (ReadClassNode) n; + } else if (n instanceof ReadHubNode) { + ReadHubNode objectClassNode = (ReadHubNode) n; LocationNode location = LocationNode.create(LocationNode.FINAL_LOCATION, CiKind.Object, config.hubOffset, graph); ReadNode memoryRead = graph.add(new ReadNode(CiKind.Object, objectClassNode.object(), location)); memoryRead.setGuard((GuardNode) tool.createGuard(graph.unique(new NullCheckNode(objectClassNode.object(), false)))); diff -r c84c325ec9ed -r ed73455e9c03 graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/ReadClassNode.java --- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/ReadClassNode.java Fri Feb 03 13:40:32 2012 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.max.graal.nodes.extended; - -import com.oracle.max.cri.ci.*; -import com.oracle.max.graal.cri.*; -import com.oracle.max.graal.nodes.*; -import com.oracle.max.graal.nodes.spi.*; -import com.oracle.max.graal.nodes.type.*; - -// TODO (ch) this should be a FloatingNode but Lowering crashes in that case -public final class ReadClassNode extends FixedWithNextNode implements Lowerable { - @Input private ValueNode object; - - public ValueNode object() { - return object; - } - - public ReadClassNode(ValueNode object) { - super(StampFactory.forKind(CiKind.Object)); - this.object = object; - } - - @Override - public void lower(CiLoweringTool tool) { - tool.getRuntime().lower(this, tool); - } -} diff -r c84c325ec9ed -r ed73455e9c03 graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/ReadHubNode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/ReadHubNode.java Fri Feb 03 13:41:59 2012 -0800 @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.max.graal.nodes.extended; + +import com.oracle.max.cri.ci.*; +import com.oracle.max.graal.cri.*; +import com.oracle.max.graal.nodes.*; +import com.oracle.max.graal.nodes.spi.*; +import com.oracle.max.graal.nodes.type.*; + +// TODO (ch) this should be a FloatingNode but Lowering crashes in that case +public final class ReadHubNode extends FixedWithNextNode implements Lowerable { + @Input private ValueNode object; + + public ValueNode object() { + return object; + } + + public ReadHubNode(ValueNode object) { + super(StampFactory.forKind(CiKind.Object)); + this.object = object; + } + + @Override + public void lower(CiLoweringTool tool) { + tool.getRuntime().lower(this, tool); + } +} diff -r c84c325ec9ed -r ed73455e9c03 graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/IsTypeNode.java --- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/IsTypeNode.java Fri Feb 03 13:40:32 2012 -0800 +++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/IsTypeNode.java Fri Feb 03 13:41:59 2012 -0800 @@ -71,7 +71,7 @@ @Override public ValueNode canonical(CanonicalizerTool tool) { - RiResolvedType exactType = objectClass() instanceof ReadClassNode ? ((ReadClassNode) objectClass()).object().exactType() : null; + RiResolvedType exactType = objectClass() instanceof ReadHubNode ? ((ReadHubNode) objectClass()).object().exactType() : null; if (exactType != null) { return ConstantNode.forBoolean(exactType == type(), graph()); }