comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/SLExpressionNode.java @ 16880:7661cc464239

Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map SL: Updated implementation to use new Instrumentable interface
author David Piorkowski <david.piorkowski@oracle.com>
date Thu, 21 Aug 2014 13:28:22 -0700
parents abe7128ca473
children 997899955e72
comparison
equal deleted inserted replaced
16867:7af9301efe6b 16880:7661cc464239
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.*;
27 import com.oracle.truffle.api.dsl.*; 28 import com.oracle.truffle.api.dsl.*;
28 import com.oracle.truffle.api.frame.*; 29 import com.oracle.truffle.api.frame.*;
30 import com.oracle.truffle.api.instrument.*;
29 import com.oracle.truffle.api.nodes.*; 31 import com.oracle.truffle.api.nodes.*;
30 import com.oracle.truffle.api.source.*; 32 import com.oracle.truffle.api.source.*;
33 import com.oracle.truffle.sl.nodes.instrument.*;
31 import com.oracle.truffle.sl.runtime.*; 34 import com.oracle.truffle.sl.runtime.*;
32 35
33 /** 36 /**
34 * Base class for all SL nodes that produce a value and therefore benefit from type specialization. 37 * Base class for all SL nodes that produce a value and therefore benefit from type specialization.
35 * The annotation {@link TypeSystemReference} specifies the SL types. Specifying it here defines the 38 * The annotation {@link TypeSystemReference} specifies the SL types. Specifying it here defines the
85 } 88 }
86 89
87 public SLNull executeNull(VirtualFrame frame) throws UnexpectedResultException { 90 public SLNull executeNull(VirtualFrame frame) throws UnexpectedResultException {
88 return SLTypesGen.SLTYPES.expectSLNull(executeGeneric(frame)); 91 return SLTypesGen.SLTYPES.expectSLNull(executeGeneric(frame));
89 } 92 }
93
94 @Override
95 public Probe probe(ExecutionContext context) {
96 Node parent = getParent();
97
98 if (parent == null)
99 throw new IllegalStateException("Cannot probe a node without a parent");
100
101 if (parent instanceof SLExpressionWrapper)
102 return ((SLExpressionWrapper) parent).getProbe();
103
104 SLExpressionWrapper wrapper = new SLExpressionWrapper((SLContext) context, this);
105 this.replace(wrapper);
106 wrapper.insertChild();
107 return wrapper.getProbe();
108 }
90 } 109 }