Mercurial > hg > graal-compiler
annotate graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/instrument/SLExpressionWrapper.java @ 16913:b879421229db
SL: better toString for SL nodes.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Sat, 23 Aug 2014 19:31:33 +0200 |
parents | 7661cc464239 |
children | a1427e40deaf |
rev | line source |
---|---|
16595
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
1 /* |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
4 * |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
8 * |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
14 * |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
18 * |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
21 * questions. |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
22 */ |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
23 package com.oracle.truffle.sl.nodes.instrument; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
24 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
25 import java.math.*; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
26 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
27 import com.oracle.truffle.api.CompilerDirectives.*; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
28 import com.oracle.truffle.api.frame.*; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
29 import com.oracle.truffle.api.instrument.*; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
30 import com.oracle.truffle.api.nodes.*; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
31 import com.oracle.truffle.sl.nodes.*; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
32 import com.oracle.truffle.sl.runtime.*; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
33 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
34 /** |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
35 * SLExpressionWrapper is a Truffle AST node that gets inserted as the parent to the node that it is |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
36 * wrapping. Any debugging instruments are attached to this wrapper through {@link Probe}s (which |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
37 * themselves contain the instruments. It is through this mechanism that tools can interact directly |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
38 * with the AST. <br/> |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
39 * {@link SLExpressionWrapper} specifically wraps {@link SLExpressionNode}s and overrides the |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
40 * various execute functions in {@link SLExpressionNode} to operate on the child of the wrapper |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
41 * instead of the wrapper itself. |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
42 * |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
43 */ |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
44 public final class SLExpressionWrapper extends SLExpressionNode implements Wrapper { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
45 @Child private SLExpressionNode child; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
46 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
47 private final Probe probe; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
48 |
16880
7661cc464239
Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map
David Piorkowski <david.piorkowski@oracle.com>
parents:
16856
diff
changeset
|
49 /** |
7661cc464239
Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map
David Piorkowski <david.piorkowski@oracle.com>
parents:
16856
diff
changeset
|
50 * Constructor. |
7661cc464239
Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map
David Piorkowski <david.piorkowski@oracle.com>
parents:
16856
diff
changeset
|
51 * |
7661cc464239
Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map
David Piorkowski <david.piorkowski@oracle.com>
parents:
16856
diff
changeset
|
52 * @param context The current Simple execution context |
7661cc464239
Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map
David Piorkowski <david.piorkowski@oracle.com>
parents:
16856
diff
changeset
|
53 * @param child The {@link SLExpressionNode} that this wrapper is wrapping |
7661cc464239
Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map
David Piorkowski <david.piorkowski@oracle.com>
parents:
16856
diff
changeset
|
54 */ |
16595
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
55 public SLExpressionWrapper(SLContext context, SLExpressionNode child) { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
56 super(child.getSourceSection()); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
57 assert !(child instanceof SLExpressionWrapper); |
16856
7833417c8172
Changes to Instrumentation
David Piorkowski <david.piorkowski@oracle.com>
parents:
16595
diff
changeset
|
58 this.probe = context.createProbe(child.getSourceSection()); |
16880
7661cc464239
Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map
David Piorkowski <david.piorkowski@oracle.com>
parents:
16856
diff
changeset
|
59 this.child = child; |
7661cc464239
Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map
David Piorkowski <david.piorkowski@oracle.com>
parents:
16856
diff
changeset
|
60 // The child should only be inserted after a replace, so we defer inserting the child to the |
7661cc464239
Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map
David Piorkowski <david.piorkowski@oracle.com>
parents:
16856
diff
changeset
|
61 // creator of the wrapper. |
16595
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
62 } |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
63 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
64 @Override |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
65 public SLExpressionNode getNonWrapperNode() { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
66 return child; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
67 } |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
68 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
69 @Override |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
70 public Node getChild() { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
71 return child; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
72 } |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
73 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
74 @Override |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
75 public Probe getProbe() { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
76 return probe; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
77 } |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
78 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
79 @Override |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
80 @SlowPath |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
81 public boolean isTaggedAs(SyntaxTag tag) { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
82 return probe.isTaggedAs(tag); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
83 } |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
84 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
85 @Override |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
86 @SlowPath |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
87 public Iterable<SyntaxTag> getSyntaxTags() { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
88 return probe.getSyntaxTags(); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
89 } |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
90 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
91 @SlowPath |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
92 public void tagAs(SyntaxTag tag) { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
93 probe.tagAs(tag); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
94 } |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
95 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
96 @Override |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
97 public Object executeGeneric(VirtualFrame frame) { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
98 this.tagAs(StandardSyntaxTag.STATEMENT); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
99 probe.enter(child, frame); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
100 Object result; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
101 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
102 try { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
103 result = child.executeGeneric(frame); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
104 probe.leave(child, frame, result); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
105 } catch (Exception e) { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
106 probe.leaveExceptional(child, frame, e); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
107 throw (e); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
108 } |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
109 return result; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
110 } |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
111 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
112 @Override |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
113 public long executeLong(VirtualFrame frame) throws UnexpectedResultException { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
114 this.tagAs(StandardSyntaxTag.STATEMENT); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
115 return SLTypesGen.SLTYPES.expectLong(executeGeneric(frame)); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
116 } |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
117 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
118 @Override |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
119 public BigInteger executeBigInteger(VirtualFrame frame) throws UnexpectedResultException { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
120 this.tagAs(StandardSyntaxTag.STATEMENT); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
121 return SLTypesGen.SLTYPES.expectBigInteger(executeGeneric(frame)); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
122 } |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
123 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
124 @Override |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
125 public boolean executeBoolean(VirtualFrame frame) throws UnexpectedResultException { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
126 this.tagAs(StandardSyntaxTag.STATEMENT); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
127 return SLTypesGen.SLTYPES.expectBoolean(executeGeneric(frame)); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
128 } |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
129 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
130 @Override |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
131 public String executeString(VirtualFrame frame) throws UnexpectedResultException { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
132 this.tagAs(StandardSyntaxTag.STATEMENT); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
133 return SLTypesGen.SLTYPES.expectString(executeGeneric(frame)); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
134 } |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
135 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
136 @Override |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
137 public SLFunction executeFunction(VirtualFrame frame) throws UnexpectedResultException { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
138 this.tagAs(StandardSyntaxTag.STATEMENT); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
139 probe.enter(child, frame); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
140 SLFunction result; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
141 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
142 try { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
143 result = child.executeFunction(frame); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
144 probe.leave(child, frame, result); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
145 } catch (Exception e) { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
146 probe.leaveExceptional(child, frame, e); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
147 throw (e); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
148 } |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
149 return result; |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
150 } |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
151 |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
152 @Override |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
153 public SLNull executeNull(VirtualFrame frame) throws UnexpectedResultException { |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
154 return SLTypesGen.SLTYPES.expectSLNull(executeGeneric(frame)); |
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
155 } |
16880
7661cc464239
Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map
David Piorkowski <david.piorkowski@oracle.com>
parents:
16856
diff
changeset
|
156 |
7661cc464239
Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map
David Piorkowski <david.piorkowski@oracle.com>
parents:
16856
diff
changeset
|
157 /** |
7661cc464239
Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map
David Piorkowski <david.piorkowski@oracle.com>
parents:
16856
diff
changeset
|
158 * Sets the parent pointer of this wrapper's child. |
7661cc464239
Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map
David Piorkowski <david.piorkowski@oracle.com>
parents:
16856
diff
changeset
|
159 */ |
7661cc464239
Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map
David Piorkowski <david.piorkowski@oracle.com>
parents:
16856
diff
changeset
|
160 public void insertChild() { |
7661cc464239
Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map
David Piorkowski <david.piorkowski@oracle.com>
parents:
16856
diff
changeset
|
161 insert(this.child); |
7661cc464239
Truffle/Instrumentation: Added Instrumentable interface and LineLocationToSourceSections map
David Piorkowski <david.piorkowski@oracle.com>
parents:
16856
diff
changeset
|
162 } |
16595
618d92152d3c
SL: Added support for instrumentation.
David Piorkowski <david.piorkowski@oracle.com>
parents:
diff
changeset
|
163 } |