write memory/data section also with nonGC polyfill

This commit is contained in:
Volker Berlin 2019-09-14 21:26:46 +02:00
parent c8e8c09a8e
commit 6ddf5b1c85
3 changed files with 9 additions and 1 deletions

View File

@ -458,6 +458,10 @@ public class BinaryModuleWriter extends ModuleWriter implements InstructionOpcod
dataStream.write( functIdx >>> 24 );
}
if( !options.useGC() ) {
return ValueType.anyref.getCode();
}
int typeId = functionTypes.size();
functionTypes.add( new StructTypeEntry( type.getFields() ) );
return typeId;

View File

@ -207,7 +207,7 @@ public class TypeManager {
methods = new ArrayList<>();
HashSet<String> allNeededFields = new HashSet<>();
listStructFields( name, functions, types, libraries, allNeededFields );
code = types.options.useGC() ? writer.writeStructType( this ) : ValueType.anyref.getCode();
code = writer.writeStructType( this );
}
/**

View File

@ -180,6 +180,10 @@ public class TextModuleWriter extends ModuleWriter {
dataStream.write( functIdx >>> 24 );
}
if( !options.useGC() ) {
return ValueType.anyref.getCode();
}
int oldInset = inset;
inset = 1;
newline( output );