From 8b20e21725c9f8add5ffe4f8b4b530b1cf240ada Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Thu, 29 Sep 2022 13:25:56 +0200 Subject: [PATCH] Add a getValue() to dup instruction --- .../inetsoftware/jwebassembly/module/DupThis.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/de/inetsoftware/jwebassembly/module/DupThis.java b/src/de/inetsoftware/jwebassembly/module/DupThis.java index 63df7b8..3f348a5 100644 --- a/src/de/inetsoftware/jwebassembly/module/DupThis.java +++ b/src/de/inetsoftware/jwebassembly/module/DupThis.java @@ -18,6 +18,8 @@ package de.inetsoftware.jwebassembly.module; import java.io.IOException; +import javax.annotation.Nonnull; + import de.inetsoftware.jwebassembly.wasm.AnyType; import de.inetsoftware.jwebassembly.wasm.VariableOperator; @@ -28,6 +30,7 @@ import de.inetsoftware.jwebassembly.wasm.VariableOperator; */ class DupThis extends WasmInstruction { + @Nonnull private WasmCallIndirectInstruction virtualCall; private int tempVarSlot; @@ -46,13 +49,22 @@ class DupThis extends WasmInstruction { * @param javaCodePos * the code position */ - DupThis( WasmCallIndirectInstruction virtualCall, int tempVarSlot, LocaleVariableManager localVariables, int javaCodePos ) { + DupThis( @Nonnull WasmCallIndirectInstruction virtualCall, int tempVarSlot, LocaleVariableManager localVariables, int javaCodePos ) { super( javaCodePos, virtualCall.getLineNumber() ); this.virtualCall = virtualCall; this.tempVarSlot = tempVarSlot; this.localVariables = localVariables; } + /** + * Get the related virtual function call. + * @return the call + */ + @Nonnull + WasmCallIndirectInstruction getValue() { + return virtualCall; + } + /** * {@inheritDoc} */