70
70
import com .oracle .truffle .api .library .ExportLibrary ;
71
71
import com .oracle .truffle .api .library .ExportMessage ;
72
72
import com .oracle .truffle .api .nodes .Node ;
73
- import com .oracle .truffle .api .source .Source ;
74
73
import com .oracle .truffle .api .source .SourceSection ;
75
74
76
75
/**
@@ -163,7 +162,7 @@ public SourceSection getSourceSection() {
163
162
} else {
164
163
final WasmContext context = WasmContext .get (this );
165
164
if (context != null ) {
166
- return debugFunction .computeSourceSection (context .debugSourceLoader (), context . environment () );
165
+ return debugFunction .computeSourceSection (context .debugSourceLoader ());
167
166
}
168
167
}
169
168
}
@@ -185,8 +184,8 @@ public InstrumentableNode materializeInstrumentableNodes(Set<Class<? extends Tag
185
184
if (debugFunction == null ) {
186
185
return this ;
187
186
}
188
- final Source source = debugFunction .computeSourceSection (context .debugSourceLoader (), context . environment ()). getSource ( );
189
- if (source == null ) {
187
+ final SourceSection sourceSection = debugFunction .computeSourceSection (context .debugSourceLoader ());
188
+ if (sourceSection == null ) {
190
189
return this ;
191
190
}
192
191
final int functionStartOffset = module .functionSourceCodeStartOffset (functionIndex );
@@ -195,7 +194,7 @@ public InstrumentableNode materializeInstrumentableNodes(Set<Class<? extends Tag
195
194
}
196
195
final int functionEndOffset = module .functionSourceCodeEndOffset (functionIndex );
197
196
final DebugLineSection debugLineSection = debugFunction .lineMap ().getLineIndexMap (functionStartOffset , functionEndOffset );
198
- final WasmInstrumentationSupportNode support = new WasmInstrumentationSupportNode (debugLineSection , source );
197
+ final WasmInstrumentationSupportNode support = new WasmInstrumentationSupportNode (debugLineSection , sourceSection . getSource () );
199
198
final BinaryParser binaryParser = new BinaryParser (module , context , module .codeSection ());
200
199
final byte [] bytecode = binaryParser .createFunctionDebugBytecode (functionIndex , debugLineSection .offsetToLineIndexMap ());
201
200
final WasmFunctionNode functionNodeDuplicate = new WasmFunctionNode (functionNode , bytecode , support ::notifyLine );
@@ -233,7 +232,7 @@ public final Object getScope(Frame frame, @SuppressWarnings("unused") boolean no
233
232
} else {
234
233
final WasmContext wasmContext = WasmContext .get (this );
235
234
if (wasmContext != null ) {
236
- sourceSection = debugFunction .computeSourceSection (wasmContext .debugSourceLoader (), wasmContext . environment () );
235
+ sourceSection = debugFunction .computeSourceSection (wasmContext .debugSourceLoader ());
237
236
}
238
237
}
239
238
0 commit comments