From 1655310a0f6a1d834d3dccc2d4231ec609d909c2 Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Sat, 24 Nov 2018 21:09:56 +0100 Subject: [PATCH] Add getFunctionName() for available check. --- .../jwebassembly/module/WasmCallInstruction.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/de/inetsoftware/jwebassembly/module/WasmCallInstruction.java b/src/de/inetsoftware/jwebassembly/module/WasmCallInstruction.java index 876a75b..832431e 100644 --- a/src/de/inetsoftware/jwebassembly/module/WasmCallInstruction.java +++ b/src/de/inetsoftware/jwebassembly/module/WasmCallInstruction.java @@ -34,6 +34,8 @@ class WasmCallInstruction extends WasmInstruction { private final ValueType valueType; + private final FunctionName name; + /** * Create an instance of a function call instruction * @@ -45,15 +47,25 @@ class WasmCallInstruction extends WasmInstruction { WasmCallInstruction( Member method, int javaCodePos ) { super( javaCodePos ); this.method = method; + this.name = new FunctionName( method ); String signature = method.getType(); this.valueType = ValueType.getValueType( signature, signature.indexOf( ')' ) + 1 ); } + /** + * Get the function name that should be called + * @return the name + */ + @Nonnull + FunctionName getFunctionName() { + return name; + } + /** * {@inheritDoc} */ public void writeTo( @Nonnull ModuleWriter writer ) throws IOException { - writer.writeFunctionCall( new FunctionName( method ) ); + writer.writeFunctionCall( name ); } /**