mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
Move method name creation into WasmCallInstruction
This commit is contained in:
parent
d16b2b63c2
commit
d3e80bf709
@ -242,7 +242,7 @@ public class ModuleGenerator {
|
||||
* the index in the signature
|
||||
* @return the value type or null if void
|
||||
*/
|
||||
private ValueType getValueType( String signature, int idx ) {
|
||||
static ValueType getValueType( String signature, int idx ) {
|
||||
String javaType;
|
||||
switch( signature.charAt( idx ) ) {
|
||||
case '[': // array
|
||||
@ -267,7 +267,7 @@ public class ModuleGenerator {
|
||||
default:
|
||||
javaType = signature.substring( idx, idx + 1 );
|
||||
}
|
||||
throw new WasmException( "Not supported Java data type in method signature: " + javaType, sourceFile, -1 );
|
||||
throw new WasmException( "Not supported Java data type in method signature: " + javaType, null, -1 );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -692,7 +692,7 @@ public class ModuleGenerator {
|
||||
if( type != null ) {
|
||||
stackManager.add( type, codePos );
|
||||
}
|
||||
instr = new WasmCallInstruction( method.getConstantClass().getName() + '.' + method.getName() + method.getType(), codePos );
|
||||
instr = new WasmCallInstruction( method, codePos );
|
||||
break;
|
||||
//TODO case 185: // invokeinterface
|
||||
//TODO case 187: // new
|
||||
|
@ -20,6 +20,8 @@ import java.io.IOException;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import de.inetsoftware.classparser.ConstantRef;
|
||||
|
||||
/**
|
||||
* WasmInstruction for a function call.
|
||||
*
|
||||
@ -33,14 +35,14 @@ class WasmCallInstruction extends WasmInstruction {
|
||||
/**
|
||||
* Create an instance of a function call instruction
|
||||
*
|
||||
* @param name
|
||||
* the Java function name
|
||||
* @param method
|
||||
* the reference to the Java method
|
||||
* @param javaCodePos
|
||||
* the code position/offset in the Java method
|
||||
*/
|
||||
WasmCallInstruction( String name, int javaCodePos ) {
|
||||
WasmCallInstruction( ConstantRef method, int javaCodePos ) {
|
||||
super( javaCodePos );
|
||||
this.name = name;
|
||||
this.name = new FunctionName( method ).signatureName;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user