Module: Relaton::Un::Wasm

Defined in:
lib/relaton/un/wasm.rb,
lib/relaton/un/wasm/memory.rb,
lib/relaton/un/wasm/module.rb,
lib/relaton/un/wasm/decoder.rb,
lib/relaton/un/wasm/instance.rb,
lib/relaton/un/wasm/interpreter.rb

Defined Under Namespace

Classes: Caller, Code, Data, DecodeError, Decoder, Element, Export, ExportRef, FuncRef, FuncType, Global, Import, Instance, Interpreter, LinkError, Memory, MemoryAdapter, MemoryType, Module, TableType, Trap

Constant Summary collapse

I32_MASK =
0xFFFF_FFFF
I64_MASK =
0xFFFF_FFFF_FFFF_FFFF
I32_SIGN =
0x8000_0000
I64_SIGN =
0x8000_0000_0000_0000
I32_RANGE =
0x1_0000_0000
I64_RANGE =
0x1_0000_0000_0000_0000

Class Method Summary collapse

Class Method Details

.to_s32(x) ⇒ Object

Convert unsigned i32/i64 to signed.



14
# File 'lib/relaton/un/wasm/interpreter.rb', line 14

def self.to_s32(x); x >= I32_SIGN ? x - I32_RANGE : x; end

.to_s64(x) ⇒ Object



15
# File 'lib/relaton/un/wasm/interpreter.rb', line 15

def self.to_s64(x); x >= I64_SIGN ? x - I64_RANGE : x; end