# HG changeset patch # User Christian Humer # Date 1366818297 -7200 # Node ID c62bf8be5caf3bc40f389f004e603222227a1a94 # Parent 2a4b57f02fb41aa5cd44c0ec604090b19de62501# Parent 8cf939b349ddd45ab90444b652a98f82ef0fe875 Merge. diff -r 2a4b57f02fb4 -r c62bf8be5caf graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CallSiteTargetNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CallSiteTargetNode.java Wed Apr 24 17:44:15 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CallSiteTargetNode.java Wed Apr 24 17:44:57 2013 +0200 @@ -43,13 +43,14 @@ private ConstantNode getConstantCallTarget(MetaAccessProvider metaAccessProvider, Assumptions assumptions) { if (getCallSite().isConstant() && !getCallSite().isNullConstant()) { CallSite callSite = (CallSite) getCallSite().asConstant().asObject(); - if (callSite instanceof ConstantCallSite) { - return ConstantNode.forObject(callSite.getTarget(), metaAccessProvider, graph()); - } else if (callSite instanceof MutableCallSite || callSite instanceof VolatileCallSite && assumptions != null && assumptions.useOptimisticAssumptions()) { - MethodHandle target = callSite.getTarget(); + MethodHandle target = callSite.getTarget(); + if (!(callSite instanceof ConstantCallSite)) { + if (assumptions == null || !assumptions.useOptimisticAssumptions()) { + return null; + } assumptions.record(new Assumptions.CallSiteTargetValue(callSite, target)); - return ConstantNode.forObject(target, metaAccessProvider, graph()); } + return ConstantNode.forObject(target, metaAccessProvider, graph()); } return null; } diff -r 2a4b57f02fb4 -r c62bf8be5caf graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultVirtualFrame.java --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultVirtualFrame.java Wed Apr 24 17:44:15 2013 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultVirtualFrame.java Wed Apr 24 17:44:57 2013 +0200 @@ -156,8 +156,13 @@ } private void verifySet(FrameSlot slot, Class accessType) throws FrameSlotTypeException { - if (slot.getType() != accessType) { - throw new FrameSlotTypeException(); + Class slotType = slot.getType(); + if (slotType != accessType) { + if (slotType == null) { + slot.setType(accessType); + } else { + throw new FrameSlotTypeException(); + } } int slotIndex = slot.getIndex(); if (slotIndex >= tags.length) { @@ -168,25 +173,21 @@ private void verifyGet(FrameSlot slot, Class accessType) throws FrameSlotTypeException { Class slotType = slot.getType(); - int slotIndex = slot.getIndex(); if (slotType != accessType) { - if (slotType == null) { + if (slotType == null && accessType == Object.class) { slot.setType(Object.class); this.setObject(slot, descriptor.getTypeConversion().getDefaultValue()); - if (accessType != Object.class) { - throw new FrameSlotTypeException(); - } } else { throw new FrameSlotTypeException(); } } + int slotIndex = slot.getIndex(); if (slotIndex >= tags.length) { resize(); } - Class tag = tags[slotIndex]; - if (tag != slotType) { + if (tags[slotIndex] != accessType) { descriptor.getTypeConversion().updateFrameSlot(this, slot, getValue(slot)); - if (tags[slotIndex] != slotType) { + if (tags[slotIndex] != accessType) { throw new FrameSlotTypeException(); } } diff -r 2a4b57f02fb4 -r c62bf8be5caf graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java Wed Apr 24 17:44:15 2013 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java Wed Apr 24 17:44:57 2013 +0200 @@ -100,9 +100,6 @@ this.parentOffset = parentOffsetTemp; } - /** - * (db) getters added to support AST cloning for parallel execution. - */ public long getParentOffset() { return parentOffset; } diff -r 2a4b57f02fb4 -r c62bf8be5caf graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/NodeFactory.java --- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/NodeFactory.java Wed Apr 24 17:44:15 2013 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/NodeFactory.java Wed Apr 24 17:44:57 2013 +0200 @@ -59,7 +59,7 @@ } public TypedNode createLocal(String name) { - return ReadLocalNodeFactory.create(frameDescriptor.findOrAddFrameSlot(name, Integer.class)); + return ReadLocalNodeFactory.create(frameDescriptor.findOrAddFrameSlot(name, int.class)); } public TypedNode createStringLiteral(String value) { @@ -67,7 +67,7 @@ } public StatementNode createAssignment(String name, TypedNode right) { - return WriteLocalNodeFactory.create(frameDescriptor.findOrAddFrameSlot(name, Integer.class), right); + return WriteLocalNodeFactory.create(frameDescriptor.findOrAddFrameSlot(name, int.class), right); } public StatementNode createPrint(List expressions) { @@ -123,7 +123,7 @@ } public StatementNode createReturn(TypedNode value) { - FrameSlot slot = frameDescriptor.findOrAddFrameSlot("", Integer.class); + FrameSlot slot = frameDescriptor.findOrAddFrameSlot("", int.class); if (returnValue == null) { returnValue = ReadLocalNodeFactory.create(slot); } diff -r 2a4b57f02fb4 -r c62bf8be5caf graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/WriteLocalNode.java --- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/WriteLocalNode.java Wed Apr 24 17:44:15 2013 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/WriteLocalNode.java Wed Apr 24 17:44:57 2013 +0200 @@ -38,29 +38,13 @@ @Specialization(rewriteOn = FrameSlotTypeException.class) public int write(VirtualFrame frame, int right) throws FrameSlotTypeException { - try { - frame.setInt(slot, right); - } catch (FrameSlotTypeException e) { - if (slot.getType() == null) { - FrameUtil.setIntSafe(frame, slot, right); - } else { - throw e; - } - } + frame.setInt(slot, right); return right; } @Specialization(rewriteOn = FrameSlotTypeException.class) public boolean write(VirtualFrame frame, boolean right) throws FrameSlotTypeException { - try { - frame.setBoolean(slot, right); - } catch (FrameSlotTypeException e) { - if (slot.getType() == null) { - FrameUtil.setBooleanSafe(frame, slot, right); - } else { - throw e; - } - } + frame.setBoolean(slot, right); return right; }