Class: Relaton::Un::Wasm::Decoder
- Inherits:
-
Object
- Object
- Relaton::Un::Wasm::Decoder
- Defined in:
- lib/relaton/un/wasm/decoder.rb
Overview
Binary WebAssembly decoder. Handles the subset of WASM MVP plus the sign-extension proposal that the shipped wasm_v_bg.wasm uses. No floats, no SIMD, no bulk-memory, no reference types beyond funcref.
Constant Summary collapse
- MAGIC =
"\x00asm".b
- VERSION =
"\x01\x00\x00\x00".b
- VALTYPE_I32 =
0x7F- VALTYPE_I64 =
0x7E- VALTYPE_F32 =
0x7D- VALTYPE_F64 =
0x7C
Instance Method Summary collapse
- #decode ⇒ Object
-
#initialize(bytes) ⇒ Decoder
constructor
A new instance of Decoder.
Constructor Details
#initialize(bytes) ⇒ Decoder
Returns a new instance of Decoder.
18 19 20 21 |
# File 'lib/relaton/un/wasm/decoder.rb', line 18 def initialize(bytes) @bytes = bytes.b @pos = 0 end |