# HG changeset patch # User Roland Schatz # Date 1433758177 -7200 # Node ID 76c162c69c2ff5e225f0a103b319089663090521 # Parent 0c60e14e779613bf706a9160749b85be9083a299 Drop stamp information of OSR proxies in graph builder. diff -r 0c60e14e7796 -r 76c162c69c2f graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeParser.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeParser.java Mon Jun 08 11:47:32 2015 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeParser.java Mon Jun 08 12:09:37 2015 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2015, 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 @@ -2294,7 +2294,7 @@ throw new BailoutException("OSR into a JSR scope is not supported"); } EntryMarkerNode x = append(new EntryMarkerNode()); - frameState.insertProxies(value -> ProxyNode.forValue(value, x, graph)); + frameState.insertProxies(value -> graph.unique(new EntryProxyNode(value, x))); x.setStateAfter(createFrameState(bci, x)); } diff -r 0c60e14e7796 -r 76c162c69c2f 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 Jun 08 11:47:32 2015 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java Mon Jun 08 12:09:37 2015 +0200 @@ -425,16 +425,16 @@ public void insertLoopPhis(LocalLiveness liveness, int loopId, LoopBeginNode loopBegin, boolean forcePhis) { for (int i = 0; i < localsSize(); i++) { - boolean changedInLoop = liveness.localIsChangedInLoop(loopId, i); - if (changedInLoop || forcePhis) { - locals[i] = createLoopPhi(loopBegin, locals[i], !changedInLoop); + boolean needPhi = forcePhis || liveness.localIsChangedInLoop(loopId, i); + if (needPhi) { + locals[i] = createLoopPhi(loopBegin, locals[i]); } } for (int i = 0; i < stackSize(); i++) { - stack[i] = createLoopPhi(loopBegin, stack[i], false); + stack[i] = createLoopPhi(loopBegin, stack[i]); } for (int i = 0; i < lockedObjects.length; i++) { - lockedObjects[i] = createLoopPhi(loopBegin, lockedObjects[i], false); + lockedObjects[i] = createLoopPhi(loopBegin, lockedObjects[i]); } } @@ -486,13 +486,13 @@ } } - private ValueNode createLoopPhi(AbstractMergeNode block, ValueNode value, boolean stampFromValue) { + private ValueNode createLoopPhi(AbstractMergeNode block, ValueNode value) { if (value == null || value == TWO_SLOT_MARKER) { return value; } assert !block.isPhiAtMerge(value) : "phi function for this block already created"; - ValuePhiNode phi = graph.addWithoutUnique(new ValuePhiNode(stampFromValue ? value.stamp() : value.stamp().unrestricted(), block)); + ValuePhiNode phi = graph.addWithoutUnique(new ValuePhiNode(value.stamp().unrestricted(), block)); phi.addInput(value); return phi; } diff -r 0c60e14e7796 -r 76c162c69c2f graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/EntryProxyNode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/EntryProxyNode.java Mon Jun 08 12:09:37 2015 +0200 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2015, 2015, 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; + +import com.oracle.graal.graph.*; +import com.oracle.graal.nodeinfo.*; +import com.oracle.graal.nodes.spi.*; + +/** + * Proxy node that is used in OSR. This node drops the stamp information from the value, since the + * types we see during OSR may be too precise (if a branch was not parsed for example). + */ +@NodeInfo(nameTemplate = "EntryProxy({i#value})") +public final class EntryProxyNode extends ProxyNode implements ValueProxy { + + public static final NodeClass TYPE = NodeClass.create(EntryProxyNode.class); + @Input ValueNode value; + + public EntryProxyNode(ValueNode value, AbstractBeginNode proxyPoint) { + super(TYPE, value.stamp().unrestricted(), proxyPoint); + this.value = value; + } + + @Override + public ValueNode value() { + return value; + } + + @Override + public ValueNode getOriginalNode() { + return value(); + } +}