mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 23:47:51 +01:00
Add support for the loop operator
This commit is contained in:
parent
2cb0988e68
commit
652d6c3d6a
@ -656,6 +656,10 @@ public class BinaryModuleWriter extends ModuleWriter implements InstructionOpcod
|
|||||||
codeStream.writeVaruint32( i );
|
codeStream.writeVaruint32( i );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case LOOP:
|
||||||
|
codeStream.write( LOOP );
|
||||||
|
codeStream.write( 0x40 ); // void; the return type of the loop. currently we does not use it
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Error( "Unknown block: " + op );
|
throw new Error( "Unknown block: " + op );
|
||||||
}
|
}
|
||||||
|
@ -32,4 +32,5 @@ public enum WasmBlockOperator {
|
|||||||
BR,
|
BR,
|
||||||
BR_IF,
|
BR_IF,
|
||||||
BR_TABLE,
|
BR_TABLE,
|
||||||
|
LOOP,
|
||||||
}
|
}
|
||||||
|
@ -289,6 +289,10 @@ public class TextModuleWriter extends ModuleWriter {
|
|||||||
}
|
}
|
||||||
name = builder.toString();
|
name = builder.toString();
|
||||||
break;
|
break;
|
||||||
|
case LOOP:
|
||||||
|
name = "loop";
|
||||||
|
insetAfter++;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Error( "Unknown block: " + op );
|
throw new Error( "Unknown block: " + op );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user