mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
add struct.new_default
for libraries
This commit is contained in:
parent
bb20f0dbc2
commit
3de41deb3e
@ -246,7 +246,8 @@ public class WatParser extends WasmCodeBuilder {
|
|||||||
} while ( !")".equals( str ) );
|
} while ( !")".equals( str ) );
|
||||||
builder.append( get( tokens, ++i ) );
|
builder.append( get( tokens, ++i ) );
|
||||||
FunctionName name = new FunctionName( builder.substring( 1 ) );
|
FunctionName name = new FunctionName( builder.substring( 1 ) );
|
||||||
addCallInstruction( name, false, javaCodePos, lineNumber );
|
boolean needThisParameter = "<init>".equals( name.methodName ); // TODO should be do lookup to the classLoader
|
||||||
|
addCallInstruction( name, needThisParameter, javaCodePos, lineNumber );
|
||||||
} catch( Exception ex ) {
|
} catch( Exception ex ) {
|
||||||
throw WasmException.create( "The syntax for a function name is $package.ClassName.methodName(paramSignature)returnSignature", ex );
|
throw WasmException.create( "The syntax for a function name is $package.ClassName.methodName(paramSignature)returnSignature", ex );
|
||||||
}
|
}
|
||||||
@ -337,6 +338,10 @@ public class WatParser extends WasmCodeBuilder {
|
|||||||
typeName = get( tokens, ++i );
|
typeName = get( tokens, ++i );
|
||||||
addStructInstruction( StructOperator.NEW_WITH_RTT, typeName, null, javaCodePos, lineNumber );
|
addStructInstruction( StructOperator.NEW_WITH_RTT, typeName, null, javaCodePos, lineNumber );
|
||||||
break;
|
break;
|
||||||
|
case "struct.new_default": // Create instance without executing the constructor, works also with nonGC output
|
||||||
|
typeName = get( tokens, ++i );
|
||||||
|
addStructInstruction( StructOperator.NEW_DEFAULT, typeName, null, javaCodePos, lineNumber );
|
||||||
|
break;
|
||||||
case "array.get":
|
case "array.get":
|
||||||
typeName = get( tokens, ++i );
|
typeName = get( tokens, ++i );
|
||||||
type = ((ArrayType)getTypeManager().valueOf( typeName )).getArrayType();
|
type = ((ArrayType)getTypeManager().valueOf( typeName )).getArrayType();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user