mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-21 18:51:43 +00:00
Precompute and inline constant globals
This is necessary so that other constant globals referencing constant globals can be precomputed as well (NON_STANDALONE_FLOW in binaryen)
This commit is contained in:
24
tests/compiler/enum.optimized.wast
Normal file
24
tests/compiler/enum.optimized.wast
Normal file
@ -0,0 +1,24 @@
|
||||
(module
|
||||
(type $i (func (result i32)))
|
||||
(type $v (func))
|
||||
(global $enum/NonConstant.ZERO (mut i32) (i32.const 0))
|
||||
(global $enum/NonConstant.ONE (mut i32) (i32.const 0))
|
||||
(memory $0 1)
|
||||
(data (i32.const 4) "\08")
|
||||
(export "memory" (memory $0))
|
||||
(start $start)
|
||||
(func $enum/getZero (; 0 ;) (type $i) (result i32)
|
||||
(i32.const 0)
|
||||
)
|
||||
(func $start (; 1 ;) (type $v)
|
||||
(set_global $enum/NonConstant.ZERO
|
||||
(call $enum/getZero)
|
||||
)
|
||||
(set_global $enum/NonConstant.ONE
|
||||
(i32.add
|
||||
(get_global $enum/NonConstant.ZERO)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
29
tests/compiler/enum.ts
Normal file
29
tests/compiler/enum.ts
Normal file
@ -0,0 +1,29 @@
|
||||
export enum Implicit {
|
||||
ZERO,
|
||||
ONE,
|
||||
TWO,
|
||||
THREE
|
||||
}
|
||||
|
||||
export enum Explicit {
|
||||
ZERO = 0,
|
||||
ONE = 0 + 1,
|
||||
TWO = 1 + 1,
|
||||
THREE = 3
|
||||
}
|
||||
|
||||
export enum Mixed {
|
||||
ZERO,
|
||||
ONE,
|
||||
THREE = 3,
|
||||
FOUR
|
||||
}
|
||||
|
||||
function getZero(): i32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
export enum NonConstant {
|
||||
ZERO = getZero(),
|
||||
ONE
|
||||
}
|
76
tests/compiler/enum.wast
Normal file
76
tests/compiler/enum.wast
Normal file
@ -0,0 +1,76 @@
|
||||
(module
|
||||
(type $i (func (result i32)))
|
||||
(type $v (func))
|
||||
(global $enum/Implicit.ZERO i32 (i32.const 0))
|
||||
(global $enum/Implicit.ONE i32 (i32.const 1))
|
||||
(global $enum/Implicit.TWO i32 (i32.const 2))
|
||||
(global $enum/Implicit.THREE i32 (i32.const 3))
|
||||
(global $enum/Explicit.ZERO i32 (i32.const 0))
|
||||
(global $enum/Explicit.ONE i32 (i32.const 1))
|
||||
(global $enum/Explicit.TWO i32 (i32.const 2))
|
||||
(global $enum/Explicit.THREE i32 (i32.const 3))
|
||||
(global $enum/Mixed.ZERO i32 (i32.const 0))
|
||||
(global $enum/Mixed.ONE i32 (i32.const 1))
|
||||
(global $enum/Mixed.THREE i32 (i32.const 3))
|
||||
(global $enum/Mixed.FOUR i32 (i32.const 4))
|
||||
(global $enum/NonConstant.ZERO (mut i32) (i32.const 0))
|
||||
(global $enum/NonConstant.ONE (mut i32) (i32.const 0))
|
||||
(memory $0 1)
|
||||
(data (i32.const 4) "\08\00\00\00")
|
||||
(export "memory" (memory $0))
|
||||
(start $start)
|
||||
(func $enum/getZero (; 0 ;) (type $i) (result i32)
|
||||
(return
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(func $start (; 1 ;) (type $v)
|
||||
(set_global $enum/NonConstant.ZERO
|
||||
(call $enum/getZero)
|
||||
)
|
||||
(set_global $enum/NonConstant.ONE
|
||||
(i32.add
|
||||
(get_global $enum/NonConstant.ZERO)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(;
|
||||
[program.elements]
|
||||
clz
|
||||
ctz
|
||||
popcnt
|
||||
rotl
|
||||
rotr
|
||||
abs
|
||||
ceil
|
||||
copysign
|
||||
floor
|
||||
max
|
||||
min
|
||||
nearest
|
||||
sqrt
|
||||
trunc
|
||||
current_memory
|
||||
grow_memory
|
||||
unreachable
|
||||
load
|
||||
store
|
||||
reinterpret
|
||||
select
|
||||
sizeof
|
||||
isNaN
|
||||
isFinite
|
||||
assert
|
||||
enum/Implicit
|
||||
enum/Explicit
|
||||
enum/Mixed
|
||||
enum/getZero
|
||||
enum/NonConstant
|
||||
[program.exports]
|
||||
enum/Implicit
|
||||
enum/Explicit
|
||||
enum/Mixed
|
||||
enum/NonConstant
|
||||
;)
|
@ -1,8 +1,6 @@
|
||||
(module
|
||||
(type $iii (func (param i32 i32) (result i32)))
|
||||
(type $v (func))
|
||||
(global $export/a i32 (i32.const 1))
|
||||
(global $export/b i32 (i32.const 2))
|
||||
(memory $0 1)
|
||||
(data (i32.const 4) "\08")
|
||||
(export "memory" (memory $0))
|
||||
@ -23,12 +21,12 @@
|
||||
(drop
|
||||
(i32.add
|
||||
(call $export/add
|
||||
(get_global $export/a)
|
||||
(get_global $export/b)
|
||||
(i32.const 1)
|
||||
(i32.const 2)
|
||||
)
|
||||
(call $export/sub
|
||||
(get_global $export/b)
|
||||
(get_global $export/a)
|
||||
(i32.const 2)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -27,12 +27,12 @@
|
||||
(drop
|
||||
(i32.add
|
||||
(call $export/add
|
||||
(get_global $export/a)
|
||||
(get_global $export/b)
|
||||
(i32.const 1)
|
||||
(i32.const 2)
|
||||
)
|
||||
(call $export/sub
|
||||
(get_global $export/b)
|
||||
(get_global $export/a)
|
||||
(i32.const 2)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -5,18 +5,6 @@
|
||||
(type $iiiiv (func (param i32 i32 i32 i32)))
|
||||
(type $iv (func (param i32)))
|
||||
(type $v (func))
|
||||
(global $tlsf/ALIGN_SIZE_LOG2 i32 (i32.const 3))
|
||||
(global $tlsf/ALIGN_SIZE (mut i32) (i32.const 0))
|
||||
(global $tlsf/BLOCK_PREV_PHYS_OFFSET i32 (i32.const 0))
|
||||
(global $tlsf/BLOCK_SIZE_OFFSET (mut i32) (i32.const 0))
|
||||
(global $tlsf/BLOCK_NEXT_FREE_OFFSET (mut i32) (i32.const 0))
|
||||
(global $tlsf/BLOCK_PREV_FREE_OFFSET (mut i32) (i32.const 0))
|
||||
(global $tlsf/CONTROL_FL_BITMAP_OFFSET (mut i32) (i32.const 0))
|
||||
(global $tlsf/FL_INDEX_MAX i32 (i32.const 30))
|
||||
(global $tlsf/SL_INDEX_COUNT_LOG2 i32 (i32.const 5))
|
||||
(global $tlsf/FL_INDEX_SHIFT (mut i32) (i32.const 0))
|
||||
(global $tlsf/FL_INDEX_COUNT (mut i32) (i32.const 0))
|
||||
(global $tlsf/SL_INDEX_COUNT (mut i32) (i32.const 0))
|
||||
(memory $0 1)
|
||||
(data (i32.const 4) "\08")
|
||||
(export "control_construct" (func $tlsf/control_construct))
|
||||
@ -47,7 +35,7 @@
|
||||
(i32.store
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(get_global $tlsf/BLOCK_NEXT_FREE_OFFSET)
|
||||
(i32.const 8)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
@ -56,7 +44,7 @@
|
||||
(i32.store
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(get_global $tlsf/BLOCK_PREV_FREE_OFFSET)
|
||||
(i32.const 12)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
@ -65,7 +53,7 @@
|
||||
(i32.store
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(get_global $tlsf/CONTROL_FL_BITMAP_OFFSET)
|
||||
(i32.const 16)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
@ -74,13 +62,16 @@
|
||||
(if
|
||||
(i32.ge_s
|
||||
(get_local $1)
|
||||
(get_global $tlsf/FL_INDEX_COUNT)
|
||||
(i32.const 23)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(i32.store
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.const 20)
|
||||
)
|
||||
(i32.mul
|
||||
(get_local $1)
|
||||
(i32.const 4)
|
||||
@ -93,25 +84,28 @@
|
||||
(if
|
||||
(i32.ge_s
|
||||
(get_local $1)
|
||||
(get_global $tlsf/FL_INDEX_COUNT)
|
||||
(i32.const 23)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.ge_s
|
||||
(get_local $2)
|
||||
(get_global $tlsf/SL_INDEX_COUNT)
|
||||
(i32.const 32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(i32.store
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.const 112)
|
||||
)
|
||||
(i32.mul
|
||||
(i32.add
|
||||
(i32.mul
|
||||
(get_local $1)
|
||||
(get_global $tlsf/SL_INDEX_COUNT)
|
||||
(i32.const 32)
|
||||
)
|
||||
(get_local $2)
|
||||
)
|
||||
@ -143,7 +137,7 @@
|
||||
(if
|
||||
(i32.lt_s
|
||||
(get_local $1)
|
||||
(get_global $tlsf/FL_INDEX_COUNT)
|
||||
(i32.const 23)
|
||||
)
|
||||
(block
|
||||
(call $tlsf/control_set_sl
|
||||
@ -158,7 +152,7 @@
|
||||
(if
|
||||
(i32.lt_s
|
||||
(get_local $2)
|
||||
(get_global $tlsf/SL_INDEX_COUNT)
|
||||
(i32.const 32)
|
||||
)
|
||||
(block
|
||||
(call $tlsf/control_set_block
|
||||
@ -246,67 +240,9 @@
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $tlsf/ALIGN_SIZE
|
||||
(i32.shl
|
||||
(i32.const 1)
|
||||
(get_global $tlsf/ALIGN_SIZE_LOG2)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.ne
|
||||
(get_global $tlsf/ALIGN_SIZE)
|
||||
(i32.const 8)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $tlsf/BLOCK_SIZE_OFFSET
|
||||
(i32.add
|
||||
(get_global $tlsf/BLOCK_PREV_PHYS_OFFSET)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(set_global $tlsf/BLOCK_NEXT_FREE_OFFSET
|
||||
(i32.add
|
||||
(get_global $tlsf/BLOCK_SIZE_OFFSET)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(set_global $tlsf/BLOCK_PREV_FREE_OFFSET
|
||||
(i32.add
|
||||
(get_global $tlsf/BLOCK_NEXT_FREE_OFFSET)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(set_global $tlsf/CONTROL_FL_BITMAP_OFFSET
|
||||
(i32.add
|
||||
(get_global $tlsf/BLOCK_PREV_FREE_OFFSET)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(set_global $tlsf/FL_INDEX_SHIFT
|
||||
(i32.add
|
||||
(get_global $tlsf/SL_INDEX_COUNT_LOG2)
|
||||
(get_global $tlsf/ALIGN_SIZE_LOG2)
|
||||
)
|
||||
)
|
||||
(set_global $tlsf/FL_INDEX_COUNT
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_global $tlsf/FL_INDEX_MAX)
|
||||
(get_global $tlsf/FL_INDEX_SHIFT)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $tlsf/SL_INDEX_COUNT
|
||||
(i32.shl
|
||||
(i32.const 1)
|
||||
(get_global $tlsf/SL_INDEX_COUNT_LOG2)
|
||||
)
|
||||
)
|
||||
(call $tlsf/control_construct
|
||||
(i32.load
|
||||
(i32.const 8)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -104,24 +104,24 @@ function control_set_fl(ptr: usize, value: u32): void {
|
||||
|
||||
function control_get_sl(ptr: usize, flIndex: usize): u32 {
|
||||
assert(flIndex < FL_INDEX_COUNT);
|
||||
return load<u32>(ptr + flIndex * sizeof<u32>());
|
||||
return load<u32>(ptr + CONTROL_SL_BITMAP_OFFSET + flIndex * sizeof<u32>());
|
||||
}
|
||||
|
||||
function control_set_sl(ptr: usize, flIndex: usize, value: u32): void {
|
||||
assert(flIndex < FL_INDEX_COUNT);
|
||||
store<u32>(ptr + flIndex * sizeof<u32>(), value);
|
||||
store<u32>(ptr + CONTROL_SL_BITMAP_OFFSET + flIndex * sizeof<u32>(), value);
|
||||
}
|
||||
|
||||
function control_get_block(ptr: usize, flIndex: usize, slIndex: usize): usize {
|
||||
assert(flIndex < FL_INDEX_COUNT);
|
||||
assert(slIndex < SL_INDEX_COUNT);
|
||||
return load<usize>(ptr + (flIndex * SL_INDEX_COUNT + slIndex) * sizeof<usize>());
|
||||
return load<usize>(ptr + CONTROL_BLOCKS_OFFSET + (flIndex * SL_INDEX_COUNT + slIndex) * sizeof<usize>());
|
||||
}
|
||||
|
||||
function control_set_block(ptr: usize, flIndex: usize, slIndex: usize, value: usize): void {
|
||||
assert(flIndex < FL_INDEX_COUNT);
|
||||
assert(slIndex < SL_INDEX_COUNT);
|
||||
store<usize>(ptr + (flIndex * SL_INDEX_COUNT + slIndex) * sizeof<usize>(), value);
|
||||
store<usize>(ptr + CONTROL_BLOCKS_OFFSET + (flIndex * SL_INDEX_COUNT + slIndex) * sizeof<usize>(), value);
|
||||
}
|
||||
|
||||
/* Clear structure and point all empty lists at the null block. */
|
||||
@ -136,4 +136,4 @@ export function control_construct(ptr: usize): void {
|
||||
}
|
||||
}
|
||||
|
||||
control_construct(load<usize>(8));
|
||||
control_construct(load<usize>(sizeof<usize>())); // get HEAP_OFFSET and initialize there
|
||||
|
@ -1,22 +1,25 @@
|
||||
(module
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $i (func (result i32)))
|
||||
(type $iiv (func (param i32 i32)))
|
||||
(type $iiiv (func (param i32 i32 i32)))
|
||||
(type $iiiiv (func (param i32 i32 i32 i32)))
|
||||
(type $iv (func (param i32)))
|
||||
(type $v (func))
|
||||
(global $tlsf/ALIGN_SIZE_LOG2 i32 (i32.const 3))
|
||||
(global $tlsf/ALIGN_SIZE (mut i32) (i32.const 0))
|
||||
(global $tlsf/ALIGN_SIZE i32 (i32.const 8))
|
||||
(global $tlsf/BLOCK_PREV_PHYS_OFFSET i32 (i32.const 0))
|
||||
(global $tlsf/BLOCK_SIZE_OFFSET (mut i32) (i32.const 0))
|
||||
(global $tlsf/BLOCK_NEXT_FREE_OFFSET (mut i32) (i32.const 0))
|
||||
(global $tlsf/BLOCK_PREV_FREE_OFFSET (mut i32) (i32.const 0))
|
||||
(global $tlsf/CONTROL_FL_BITMAP_OFFSET (mut i32) (i32.const 0))
|
||||
(global $tlsf/BLOCK_SIZE_OFFSET i32 (i32.const 4))
|
||||
(global $tlsf/BLOCK_NEXT_FREE_OFFSET i32 (i32.const 8))
|
||||
(global $tlsf/BLOCK_PREV_FREE_OFFSET i32 (i32.const 12))
|
||||
(global $tlsf/CONTROL_FL_BITMAP_OFFSET i32 (i32.const 16))
|
||||
(global $tlsf/FL_INDEX_MAX i32 (i32.const 30))
|
||||
(global $tlsf/SL_INDEX_COUNT_LOG2 i32 (i32.const 5))
|
||||
(global $tlsf/FL_INDEX_SHIFT (mut i32) (i32.const 0))
|
||||
(global $tlsf/FL_INDEX_COUNT (mut i32) (i32.const 0))
|
||||
(global $tlsf/SL_INDEX_COUNT (mut i32) (i32.const 0))
|
||||
(global $tlsf/FL_INDEX_SHIFT i32 (i32.const 8))
|
||||
(global $tlsf/FL_INDEX_COUNT i32 (i32.const 23))
|
||||
(global $tlsf/CONTROL_SL_BITMAP_OFFSET i32 (i32.const 20))
|
||||
(global $tlsf/SL_INDEX_COUNT i32 (i32.const 32))
|
||||
(global $tlsf/CONTROL_BLOCKS_OFFSET i32 (i32.const 112))
|
||||
(memory $0 1)
|
||||
(data (i32.const 4) "\08\00\00\00")
|
||||
(export "control_construct" (func $tlsf/control_construct))
|
||||
@ -61,7 +64,7 @@
|
||||
(i32.store
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(get_global $tlsf/BLOCK_NEXT_FREE_OFFSET)
|
||||
(i32.const 8)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
@ -70,7 +73,7 @@
|
||||
(i32.store
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(get_global $tlsf/BLOCK_PREV_FREE_OFFSET)
|
||||
(i32.const 12)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
@ -79,7 +82,7 @@
|
||||
(i32.store
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(get_global $tlsf/CONTROL_FL_BITMAP_OFFSET)
|
||||
(i32.const 16)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
@ -89,14 +92,17 @@
|
||||
(i32.eqz
|
||||
(i32.lt_s
|
||||
(get_local $1)
|
||||
(get_global $tlsf/FL_INDEX_COUNT)
|
||||
(i32.const 23)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(i32.store
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.const 20)
|
||||
)
|
||||
(i32.mul
|
||||
(get_local $1)
|
||||
(i32.const 4)
|
||||
@ -110,7 +116,7 @@
|
||||
(i32.eqz
|
||||
(i32.lt_s
|
||||
(get_local $1)
|
||||
(get_global $tlsf/FL_INDEX_COUNT)
|
||||
(i32.const 23)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
@ -119,19 +125,22 @@
|
||||
(i32.eqz
|
||||
(i32.lt_s
|
||||
(get_local $2)
|
||||
(get_global $tlsf/SL_INDEX_COUNT)
|
||||
(i32.const 32)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(i32.store
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.const 112)
|
||||
)
|
||||
(i32.mul
|
||||
(i32.add
|
||||
(i32.mul
|
||||
(get_local $1)
|
||||
(get_global $tlsf/SL_INDEX_COUNT)
|
||||
(i32.const 32)
|
||||
)
|
||||
(get_local $2)
|
||||
)
|
||||
@ -166,7 +175,7 @@
|
||||
(if
|
||||
(i32.lt_s
|
||||
(get_local $1)
|
||||
(get_global $tlsf/FL_INDEX_COUNT)
|
||||
(i32.const 23)
|
||||
)
|
||||
(block
|
||||
(block
|
||||
@ -185,7 +194,7 @@
|
||||
(if
|
||||
(i32.lt_s
|
||||
(get_local $2)
|
||||
(get_global $tlsf/SL_INDEX_COUNT)
|
||||
(i32.const 32)
|
||||
)
|
||||
(block
|
||||
(call $tlsf/control_set_block
|
||||
@ -302,69 +311,18 @@
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $tlsf/ALIGN_SIZE
|
||||
(i32.shl
|
||||
(i32.const 1)
|
||||
(get_global $tlsf/ALIGN_SIZE_LOG2)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(i32.eq
|
||||
(get_global $tlsf/ALIGN_SIZE)
|
||||
(i32.const 8)
|
||||
(i32.const 8)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $tlsf/BLOCK_SIZE_OFFSET
|
||||
(i32.add
|
||||
(get_global $tlsf/BLOCK_PREV_PHYS_OFFSET)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(set_global $tlsf/BLOCK_NEXT_FREE_OFFSET
|
||||
(i32.add
|
||||
(get_global $tlsf/BLOCK_SIZE_OFFSET)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(set_global $tlsf/BLOCK_PREV_FREE_OFFSET
|
||||
(i32.add
|
||||
(get_global $tlsf/BLOCK_NEXT_FREE_OFFSET)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(set_global $tlsf/CONTROL_FL_BITMAP_OFFSET
|
||||
(i32.add
|
||||
(get_global $tlsf/BLOCK_PREV_FREE_OFFSET)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(set_global $tlsf/FL_INDEX_SHIFT
|
||||
(i32.add
|
||||
(get_global $tlsf/SL_INDEX_COUNT_LOG2)
|
||||
(get_global $tlsf/ALIGN_SIZE_LOG2)
|
||||
)
|
||||
)
|
||||
(set_global $tlsf/FL_INDEX_COUNT
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_global $tlsf/FL_INDEX_MAX)
|
||||
(get_global $tlsf/FL_INDEX_SHIFT)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $tlsf/SL_INDEX_COUNT
|
||||
(i32.shl
|
||||
(i32.const 1)
|
||||
(get_global $tlsf/SL_INDEX_COUNT_LOG2)
|
||||
)
|
||||
)
|
||||
(call $tlsf/control_construct
|
||||
(i32.load
|
||||
(i32.const 8)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user