Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/SLExpressionNode.java @ 16962:f0c3de09f12a
Merge with e01b0b9a5f886f8810ba09668632acd675cccf76
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Tue, 26 Aug 2014 19:57:25 -0700 |
parents | 997899955e72 |
children | e3c95cbbb50c |
comparison
equal
deleted
inserted
replaced
16961:a1427e40deaf | 16962:f0c3de09f12a |
---|---|
22 */ | 22 */ |
23 package com.oracle.truffle.sl.nodes; | 23 package com.oracle.truffle.sl.nodes; |
24 | 24 |
25 import java.math.*; | 25 import java.math.*; |
26 | 26 |
27 import com.oracle.truffle.api.*; | |
28 import com.oracle.truffle.api.dsl.*; | 27 import com.oracle.truffle.api.dsl.*; |
29 import com.oracle.truffle.api.frame.*; | 28 import com.oracle.truffle.api.frame.*; |
30 import com.oracle.truffle.api.instrument.*; | 29 import com.oracle.truffle.api.instrument.*; |
31 import com.oracle.truffle.api.nodes.*; | 30 import com.oracle.truffle.api.nodes.*; |
32 import com.oracle.truffle.api.source.*; | 31 import com.oracle.truffle.api.source.*; |
90 public SLNull executeNull(VirtualFrame frame) throws UnexpectedResultException { | 89 public SLNull executeNull(VirtualFrame frame) throws UnexpectedResultException { |
91 return SLTypesGen.SLTYPES.expectSLNull(executeGeneric(frame)); | 90 return SLTypesGen.SLTYPES.expectSLNull(executeGeneric(frame)); |
92 } | 91 } |
93 | 92 |
94 @Override | 93 @Override |
95 public Probe probe(ExecutionContext context) { | 94 public Probe probe() { |
96 Node parent = getParent(); | 95 Node parent = getParent(); |
97 | 96 |
98 if (parent == null) | 97 if (parent == null) { |
99 throw new IllegalStateException("Cannot probe a node without a parent"); | 98 throw new IllegalStateException("Cannot probe a node without a parent"); |
99 } | |
100 | 100 |
101 if (parent instanceof SLExpressionWrapper) | 101 if (parent instanceof SLExpressionWrapper) { |
102 return ((SLExpressionWrapper) parent).getProbe(); | 102 return ((SLExpressionWrapper) parent).getProbe(); |
103 } | |
103 | 104 |
104 SLExpressionWrapper wrapper = new SLExpressionWrapper((SLContext) context, this); | 105 // Create a new wrapper/probe with this node as its child. |
106 final SLExpressionWrapper wrapper = new SLExpressionWrapper(getRootNodeSLContext(this), this); | |
107 | |
108 // Replace this node in the AST with the wrapper | |
105 this.replace(wrapper); | 109 this.replace(wrapper); |
106 wrapper.insertChild(); | 110 |
107 return wrapper.getProbe(); | 111 return wrapper.getProbe(); |
108 } | 112 } |
109 } | 113 } |