File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
wasm/src/org.graalvm.wasm/src/org/graalvm/wasm Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 46
46
import com .oracle .truffle .api .CallTarget ;
47
47
import com .oracle .truffle .api .CompilerDirectives ;
48
48
import com .oracle .truffle .api .CompilerDirectives .CompilationFinal ;
49
+ import com .oracle .truffle .api .CompilerDirectives .TruffleBoundary ;
49
50
50
51
/**
51
52
* Represents the state of a WebAssembly module.
@@ -256,12 +257,18 @@ public WasmFunctionInstance functionInstance(WasmFunction function) {
256
257
int functionIndex = function .index ();
257
258
WasmFunctionInstance functionInstance = functionInstances [functionIndex ];
258
259
if (functionInstance == null ) {
259
- functionInstance = new WasmFunctionInstance (instance (), function , target (functionIndex ));
260
- functionInstances [functionIndex ] = functionInstance ;
260
+ functionInstance = allocateFunctionInstance (function , functionIndex );
261
261
}
262
262
return functionInstance ;
263
263
}
264
264
265
+ @ TruffleBoundary
266
+ private WasmFunctionInstance allocateFunctionInstance (WasmFunction function , int functionIndex ) {
267
+ WasmFunctionInstance functionInstance = new WasmFunctionInstance (instance (), function , target (functionIndex ));
268
+ functionInstances [functionIndex ] = functionInstance ;
269
+ return functionInstance ;
270
+ }
271
+
265
272
public WasmFunctionInstance functionInstance (int index ) {
266
273
return functionInstances [index ];
267
274
}
You can’t perform that action at this time.
0 commit comments