Add support for the loop operator

This commit is contained in:
Volker Berlin 2018-05-20 11:52:16 +02:00
parent 2cb0988e68
commit 652d6c3d6a
3 changed files with 9 additions and 0 deletions

View File

@ -656,6 +656,10 @@ public class BinaryModuleWriter extends ModuleWriter implements InstructionOpcod
codeStream.writeVaruint32( i );
}
break;
case LOOP:
codeStream.write( LOOP );
codeStream.write( 0x40 ); // void; the return type of the loop. currently we does not use it
break;
default:
throw new Error( "Unknown block: " + op );
}

View File

@ -32,4 +32,5 @@ public enum WasmBlockOperator {
BR,
BR_IF,
BR_TABLE,
LOOP,
}

View File

@ -289,6 +289,10 @@ public class TextModuleWriter extends ModuleWriter {
}
name = builder.toString();
break;
case LOOP:
name = "loop";
insetAfter++;
break;
default:
throw new Error( "Unknown block: " + op );
}