diff --git a/tests/allocators/buddy/assembly/index.ts b/tests/allocators/buddy/assembly/index.ts index 8f384e66..34c299b5 100644 --- a/tests/allocators/buddy/assembly/index.ts +++ b/tests/allocators/buddy/assembly/index.ts @@ -1,2 +1,3 @@ import "./buddy"; export { allocate_memory, free_memory }; +export { set_memory }; diff --git a/tests/allocators/buddy/buddy.optimized.wat b/tests/allocators/buddy/buddy.optimized.wat index c0c1692d..41cebdf2 100644 --- a/tests/allocators/buddy/buddy.optimized.wat +++ b/tests/allocators/buddy/buddy.optimized.wat @@ -3,6 +3,7 @@ (type $iv (func (param i32))) (type $iiv (func (param i32 i32))) (type $iii (func (param i32 i32) (result i32))) + (type $iiiv (func (param i32 i32 i32))) (type $v (func)) (global $assembly/buddy/BUCKET_START (mut i32) (i32.const 0)) (global $assembly/buddy/BUCKET_END (mut i32) (i32.const 0)) @@ -15,6 +16,7 @@ (memory $0 1) (export "allocate_memory" (func $assembly/buddy/allocate_memory)) (export "free_memory" (func $assembly/buddy/free_memory)) + (export "set_memory" (func "$(lib)/memory/set_memory")) (export "memory" (memory $0)) (start $start) (func $assembly/buddy/update_max_ptr (; 0 ;) (type $ii) (param $0 i32) (result i32) @@ -1057,7 +1059,505 @@ ) ) ) - (func $start (; 15 ;) (type $v) + (func "$(lib)/memory/set_memory" (; 15 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i64) + (local $4 i32) + ;;@ (lib)/memory.ts:196:2 + (if + ;;@ (lib)/memory.ts:196:6 + (i32.eqz + ;;@ (lib)/memory.ts:196:7 + (get_local $2) + ) + ;;@ (lib)/memory.ts:197:4 + (return) + ) + ;;@ (lib)/memory.ts:198:2 + (i32.store8 + ;;@ (lib)/memory.ts:198:12 + (get_local $0) + ;;@ (lib)/memory.ts:198:18 + (get_local $1) + ) + ;;@ (lib)/memory.ts:199:2 + (i32.store8 + ;;@ (lib)/memory.ts:199:12 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:199:19 + (get_local $2) + ) + ;;@ (lib)/memory.ts:199:23 + (i32.const 1) + ) + ;;@ (lib)/memory.ts:199:26 + (get_local $1) + ) + ;;@ (lib)/memory.ts:200:2 + (if + ;;@ (lib)/memory.ts:200:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:200:11 + (i32.const 2) + ) + ;;@ (lib)/memory.ts:201:4 + (return) + ) + ;;@ (lib)/memory.ts:203:2 + (i32.store8 + ;;@ (lib)/memory.ts:203:12 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:203:19 + (i32.const 1) + ) + ;;@ (lib)/memory.ts:203:22 + (get_local $1) + ) + ;;@ (lib)/memory.ts:204:2 + (i32.store8 + ;;@ (lib)/memory.ts:204:12 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:204:19 + (i32.const 2) + ) + ;;@ (lib)/memory.ts:204:22 + (get_local $1) + ) + ;;@ (lib)/memory.ts:205:2 + (i32.store8 + ;;@ (lib)/memory.ts:205:12 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:205:19 + (get_local $2) + ) + ;;@ (lib)/memory.ts:205:23 + (i32.const 2) + ) + ;;@ (lib)/memory.ts:205:26 + (get_local $1) + ) + ;;@ (lib)/memory.ts:206:2 + (i32.store8 + ;;@ (lib)/memory.ts:206:12 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:206:19 + (get_local $2) + ) + ;;@ (lib)/memory.ts:206:23 + (i32.const 3) + ) + ;;@ (lib)/memory.ts:206:26 + (get_local $1) + ) + ;;@ (lib)/memory.ts:207:2 + (if + ;;@ (lib)/memory.ts:207:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:207:11 + (i32.const 6) + ) + ;;@ (lib)/memory.ts:208:4 + (return) + ) + ;;@ (lib)/memory.ts:209:2 + (i32.store8 + ;;@ (lib)/memory.ts:209:12 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:209:19 + (i32.const 3) + ) + ;;@ (lib)/memory.ts:209:22 + (get_local $1) + ) + ;;@ (lib)/memory.ts:210:2 + (i32.store8 + ;;@ (lib)/memory.ts:210:12 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:210:19 + (get_local $2) + ) + ;;@ (lib)/memory.ts:210:23 + (i32.const 4) + ) + ;;@ (lib)/memory.ts:210:26 + (get_local $1) + ) + ;;@ (lib)/memory.ts:211:2 + (if + ;;@ (lib)/memory.ts:211:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:211:11 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:212:4 + (return) + ) + ;;@ (lib)/memory.ts:223:2 + (i32.store + ;;@ (lib)/memory.ts:216:2 + (tee_local $0 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:215:2 + (tee_local $4 + ;;@ (lib)/memory.ts:215:17 + (i32.and + (i32.sub + (i32.const 0) + ;;@ (lib)/memory.ts:215:18 + (get_local $0) + ) + ;;@ (lib)/memory.ts:215:25 + (i32.const 3) + ) + ) + ) + ) + ;;@ (lib)/memory.ts:220:2 + (tee_local $1 + ;;@ (lib)/memory.ts:220:17 + (i32.mul + ;;@ (lib)/memory.ts:220:33 + (get_local $1) + (i32.const 16843009) + ) + ) + ) + ;;@ (lib)/memory.ts:224:2 + (i32.store + ;;@ (lib)/memory.ts:224:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:218:2 + (tee_local $2 + (i32.and + (i32.sub + ;;@ (lib)/memory.ts:217:2 + (get_local $2) + ;;@ (lib)/memory.ts:217:7 + (get_local $4) + ) + ;;@ (lib)/memory.ts:218:7 + (i32.const -4) + ) + ) + ) + ;;@ (lib)/memory.ts:224:24 + (i32.const 4) + ) + ;;@ (lib)/memory.ts:224:27 + (get_local $1) + ) + ;;@ (lib)/memory.ts:225:2 + (if + ;;@ (lib)/memory.ts:225:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:225:11 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:226:4 + (return) + ) + ;;@ (lib)/memory.ts:227:2 + (i32.store + ;;@ (lib)/memory.ts:227:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:227:20 + (i32.const 4) + ) + ;;@ (lib)/memory.ts:227:23 + (get_local $1) + ) + ;;@ (lib)/memory.ts:228:2 + (i32.store + ;;@ (lib)/memory.ts:228:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:228:20 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:228:23 + (get_local $1) + ) + ;;@ (lib)/memory.ts:229:2 + (i32.store + ;;@ (lib)/memory.ts:229:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:229:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:229:24 + (i32.const 12) + ) + ;;@ (lib)/memory.ts:229:28 + (get_local $1) + ) + ;;@ (lib)/memory.ts:230:2 + (i32.store + ;;@ (lib)/memory.ts:230:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:230:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:230:24 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:230:27 + (get_local $1) + ) + ;;@ (lib)/memory.ts:231:2 + (if + ;;@ (lib)/memory.ts:231:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:231:11 + (i32.const 24) + ) + ;;@ (lib)/memory.ts:232:4 + (return) + ) + ;;@ (lib)/memory.ts:233:2 + (i32.store + ;;@ (lib)/memory.ts:233:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:233:20 + (i32.const 12) + ) + ;;@ (lib)/memory.ts:233:24 + (get_local $1) + ) + ;;@ (lib)/memory.ts:234:2 + (i32.store + ;;@ (lib)/memory.ts:234:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:234:20 + (i32.const 16) + ) + ;;@ (lib)/memory.ts:234:24 + (get_local $1) + ) + ;;@ (lib)/memory.ts:235:2 + (i32.store + ;;@ (lib)/memory.ts:235:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:235:20 + (i32.const 20) + ) + ;;@ (lib)/memory.ts:235:24 + (get_local $1) + ) + ;;@ (lib)/memory.ts:236:2 + (i32.store + ;;@ (lib)/memory.ts:236:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:236:20 + (i32.const 24) + ) + ;;@ (lib)/memory.ts:236:24 + (get_local $1) + ) + ;;@ (lib)/memory.ts:237:2 + (i32.store + ;;@ (lib)/memory.ts:237:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:237:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:237:24 + (i32.const 28) + ) + ;;@ (lib)/memory.ts:237:28 + (get_local $1) + ) + ;;@ (lib)/memory.ts:238:2 + (i32.store + ;;@ (lib)/memory.ts:238:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:238:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:238:24 + (i32.const 24) + ) + ;;@ (lib)/memory.ts:238:28 + (get_local $1) + ) + ;;@ (lib)/memory.ts:239:2 + (i32.store + ;;@ (lib)/memory.ts:239:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:239:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:239:24 + (i32.const 20) + ) + ;;@ (lib)/memory.ts:239:28 + (get_local $1) + ) + ;;@ (lib)/memory.ts:240:2 + (i32.store + ;;@ (lib)/memory.ts:240:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:240:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:240:24 + (i32.const 16) + ) + ;;@ (lib)/memory.ts:240:28 + (get_local $1) + ) + ;;@ (lib)/memory.ts:244:2 + (set_local $0 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:243:2 + (tee_local $4 + ;;@ (lib)/memory.ts:243:6 + (i32.add + ;;@ (lib)/memory.ts:243:11 + (i32.and + ;;@ (lib)/memory.ts:243:12 + (get_local $0) + ;;@ (lib)/memory.ts:243:19 + (i32.const 4) + ) + ;;@ (lib)/memory.ts:243:6 + (i32.const 24) + ) + ) + ) + ) + ;;@ (lib)/memory.ts:245:2 + (set_local $2 + (i32.sub + (get_local $2) + ;;@ (lib)/memory.ts:245:7 + (get_local $4) + ) + ) + ;;@ (lib)/memory.ts:248:2 + (set_local $3 + ;;@ (lib)/memory.ts:248:17 + (i64.or + (i64.extend_u/i32 + (get_local $1) + ) + ;;@ (lib)/memory.ts:248:28 + (i64.shl + ;;@ (lib)/memory.ts:248:29 + (i64.extend_u/i32 + (get_local $1) + ) + ;;@ (lib)/memory.ts:248:41 + (i64.const 32) + ) + ) + ) + (loop $continue|0 + (if + ;;@ (lib)/memory.ts:249:9 + (i32.ge_u + (get_local $2) + ;;@ (lib)/memory.ts:249:14 + (i32.const 32) + ) + (block + ;;@ (lib)/memory.ts:250:4 + (i64.store + ;;@ (lib)/memory.ts:250:15 + (get_local $0) + ;;@ (lib)/memory.ts:250:21 + (get_local $3) + ) + ;;@ (lib)/memory.ts:251:4 + (i64.store + ;;@ (lib)/memory.ts:251:15 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:251:22 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:251:25 + (get_local $3) + ) + ;;@ (lib)/memory.ts:252:4 + (i64.store + ;;@ (lib)/memory.ts:252:15 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:252:22 + (i32.const 16) + ) + ;;@ (lib)/memory.ts:252:26 + (get_local $3) + ) + ;;@ (lib)/memory.ts:253:4 + (i64.store + ;;@ (lib)/memory.ts:253:15 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:253:22 + (i32.const 24) + ) + ;;@ (lib)/memory.ts:253:26 + (get_local $3) + ) + ;;@ (lib)/memory.ts:254:4 + (set_local $2 + (i32.sub + (get_local $2) + ;;@ (lib)/memory.ts:254:9 + (i32.const 32) + ) + ) + ;;@ (lib)/memory.ts:255:4 + (set_local $0 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:255:12 + (i32.const 32) + ) + ) + (br $continue|0) + ) + ) + ) + ) + (func $start (; 16 ;) (type $v) (set_global $assembly/buddy/BUCKET_START ;;@ assembly/buddy.ts:92:26 (get_global $HEAP_BASE) diff --git a/tests/allocators/buddy/buddy.untouched.wat b/tests/allocators/buddy/buddy.untouched.wat index ccdc7766..911fee09 100644 --- a/tests/allocators/buddy/buddy.untouched.wat +++ b/tests/allocators/buddy/buddy.untouched.wat @@ -5,6 +5,7 @@ (type $iv (func (param i32))) (type $iiv (func (param i32 i32))) (type $iii (func (param i32 i32) (result i32))) + (type $iiiv (func (param i32 i32 i32))) (type $v (func)) (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $assembly/buddy/HEADER_SIZE i32 (i32.const 8)) @@ -26,6 +27,7 @@ (data (i32.const 4) "\11\00\00\00a\00s\00s\00e\00m\00b\00l\00y\00/\00b\00u\00d\00d\00y\00.\00t\00s\00") (export "allocate_memory" (func $assembly/buddy/allocate_memory)) (export "free_memory" (func $assembly/buddy/free_memory)) + (export "set_memory" (func "$(lib)/memory/set_memory")) (export "memory" (memory $0)) (start $start) (func $assembly/buddy/update_max_ptr (; 1 ;) (type $ii) (param $0 i32) (result i32) @@ -1281,7 +1283,527 @@ ) ) ) - (func $start (; 17 ;) (type $v) + (func "$(lib)/memory/set_memory" (; 17 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i64) + ;;@ (lib)/memory.ts:196:2 + (if + ;;@ (lib)/memory.ts:196:6 + (i32.eqz + ;;@ (lib)/memory.ts:196:7 + (get_local $2) + ) + ;;@ (lib)/memory.ts:197:4 + (return) + ) + ;;@ (lib)/memory.ts:198:2 + (i32.store8 + ;;@ (lib)/memory.ts:198:12 + (get_local $0) + ;;@ (lib)/memory.ts:198:18 + (get_local $1) + ) + ;;@ (lib)/memory.ts:199:2 + (i32.store8 + ;;@ (lib)/memory.ts:199:12 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:199:19 + (get_local $2) + ) + ;;@ (lib)/memory.ts:199:23 + (i32.const 1) + ) + ;;@ (lib)/memory.ts:199:26 + (get_local $1) + ) + ;;@ (lib)/memory.ts:200:2 + (if + ;;@ (lib)/memory.ts:200:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:200:11 + (i32.const 2) + ) + ;;@ (lib)/memory.ts:201:4 + (return) + ) + ;;@ (lib)/memory.ts:203:2 + (i32.store8 + ;;@ (lib)/memory.ts:203:12 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:203:19 + (i32.const 1) + ) + ;;@ (lib)/memory.ts:203:22 + (get_local $1) + ) + ;;@ (lib)/memory.ts:204:2 + (i32.store8 + ;;@ (lib)/memory.ts:204:12 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:204:19 + (i32.const 2) + ) + ;;@ (lib)/memory.ts:204:22 + (get_local $1) + ) + ;;@ (lib)/memory.ts:205:2 + (i32.store8 + ;;@ (lib)/memory.ts:205:12 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:205:19 + (get_local $2) + ) + ;;@ (lib)/memory.ts:205:23 + (i32.const 2) + ) + ;;@ (lib)/memory.ts:205:26 + (get_local $1) + ) + ;;@ (lib)/memory.ts:206:2 + (i32.store8 + ;;@ (lib)/memory.ts:206:12 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:206:19 + (get_local $2) + ) + ;;@ (lib)/memory.ts:206:23 + (i32.const 3) + ) + ;;@ (lib)/memory.ts:206:26 + (get_local $1) + ) + ;;@ (lib)/memory.ts:207:2 + (if + ;;@ (lib)/memory.ts:207:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:207:11 + (i32.const 6) + ) + ;;@ (lib)/memory.ts:208:4 + (return) + ) + ;;@ (lib)/memory.ts:209:2 + (i32.store8 + ;;@ (lib)/memory.ts:209:12 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:209:19 + (i32.const 3) + ) + ;;@ (lib)/memory.ts:209:22 + (get_local $1) + ) + ;;@ (lib)/memory.ts:210:2 + (i32.store8 + ;;@ (lib)/memory.ts:210:12 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:210:19 + (get_local $2) + ) + ;;@ (lib)/memory.ts:210:23 + (i32.const 4) + ) + ;;@ (lib)/memory.ts:210:26 + (get_local $1) + ) + ;;@ (lib)/memory.ts:211:2 + (if + ;;@ (lib)/memory.ts:211:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:211:11 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:212:4 + (return) + ) + ;;@ (lib)/memory.ts:215:2 + (set_local $3 + ;;@ (lib)/memory.ts:215:17 + (i32.and + (i32.sub + (i32.const 0) + ;;@ (lib)/memory.ts:215:18 + (get_local $0) + ) + ;;@ (lib)/memory.ts:215:25 + (i32.const 3) + ) + ) + ;;@ (lib)/memory.ts:216:2 + (set_local $0 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:216:10 + (get_local $3) + ) + ) + ;;@ (lib)/memory.ts:217:2 + (set_local $2 + (i32.sub + (get_local $2) + ;;@ (lib)/memory.ts:217:7 + (get_local $3) + ) + ) + ;;@ (lib)/memory.ts:218:2 + (set_local $2 + (i32.and + (get_local $2) + ;;@ (lib)/memory.ts:218:7 + (i32.const -4) + ) + ) + ;;@ (lib)/memory.ts:220:2 + (set_local $4 + ;;@ (lib)/memory.ts:220:17 + (i32.mul + (i32.div_u + (i32.const -1) + ;;@ (lib)/memory.ts:220:27 + (i32.const 255) + ) + ;;@ (lib)/memory.ts:220:33 + (get_local $1) + ) + ) + ;;@ (lib)/memory.ts:223:2 + (i32.store + ;;@ (lib)/memory.ts:223:13 + (get_local $0) + ;;@ (lib)/memory.ts:223:19 + (get_local $4) + ) + ;;@ (lib)/memory.ts:224:2 + (i32.store + ;;@ (lib)/memory.ts:224:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:224:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:224:24 + (i32.const 4) + ) + ;;@ (lib)/memory.ts:224:27 + (get_local $4) + ) + ;;@ (lib)/memory.ts:225:2 + (if + ;;@ (lib)/memory.ts:225:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:225:11 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:226:4 + (return) + ) + ;;@ (lib)/memory.ts:227:2 + (i32.store + ;;@ (lib)/memory.ts:227:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:227:20 + (i32.const 4) + ) + ;;@ (lib)/memory.ts:227:23 + (get_local $4) + ) + ;;@ (lib)/memory.ts:228:2 + (i32.store + ;;@ (lib)/memory.ts:228:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:228:20 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:228:23 + (get_local $4) + ) + ;;@ (lib)/memory.ts:229:2 + (i32.store + ;;@ (lib)/memory.ts:229:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:229:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:229:24 + (i32.const 12) + ) + ;;@ (lib)/memory.ts:229:28 + (get_local $4) + ) + ;;@ (lib)/memory.ts:230:2 + (i32.store + ;;@ (lib)/memory.ts:230:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:230:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:230:24 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:230:27 + (get_local $4) + ) + ;;@ (lib)/memory.ts:231:2 + (if + ;;@ (lib)/memory.ts:231:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:231:11 + (i32.const 24) + ) + ;;@ (lib)/memory.ts:232:4 + (return) + ) + ;;@ (lib)/memory.ts:233:2 + (i32.store + ;;@ (lib)/memory.ts:233:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:233:20 + (i32.const 12) + ) + ;;@ (lib)/memory.ts:233:24 + (get_local $4) + ) + ;;@ (lib)/memory.ts:234:2 + (i32.store + ;;@ (lib)/memory.ts:234:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:234:20 + (i32.const 16) + ) + ;;@ (lib)/memory.ts:234:24 + (get_local $4) + ) + ;;@ (lib)/memory.ts:235:2 + (i32.store + ;;@ (lib)/memory.ts:235:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:235:20 + (i32.const 20) + ) + ;;@ (lib)/memory.ts:235:24 + (get_local $4) + ) + ;;@ (lib)/memory.ts:236:2 + (i32.store + ;;@ (lib)/memory.ts:236:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:236:20 + (i32.const 24) + ) + ;;@ (lib)/memory.ts:236:24 + (get_local $4) + ) + ;;@ (lib)/memory.ts:237:2 + (i32.store + ;;@ (lib)/memory.ts:237:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:237:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:237:24 + (i32.const 28) + ) + ;;@ (lib)/memory.ts:237:28 + (get_local $4) + ) + ;;@ (lib)/memory.ts:238:2 + (i32.store + ;;@ (lib)/memory.ts:238:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:238:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:238:24 + (i32.const 24) + ) + ;;@ (lib)/memory.ts:238:28 + (get_local $4) + ) + ;;@ (lib)/memory.ts:239:2 + (i32.store + ;;@ (lib)/memory.ts:239:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:239:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:239:24 + (i32.const 20) + ) + ;;@ (lib)/memory.ts:239:28 + (get_local $4) + ) + ;;@ (lib)/memory.ts:240:2 + (i32.store + ;;@ (lib)/memory.ts:240:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:240:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:240:24 + (i32.const 16) + ) + ;;@ (lib)/memory.ts:240:28 + (get_local $4) + ) + ;;@ (lib)/memory.ts:243:2 + (set_local $3 + ;;@ (lib)/memory.ts:243:6 + (i32.add + (i32.const 24) + ;;@ (lib)/memory.ts:243:11 + (i32.and + ;;@ (lib)/memory.ts:243:12 + (get_local $0) + ;;@ (lib)/memory.ts:243:19 + (i32.const 4) + ) + ) + ) + ;;@ (lib)/memory.ts:244:2 + (set_local $0 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:244:10 + (get_local $3) + ) + ) + ;;@ (lib)/memory.ts:245:2 + (set_local $2 + (i32.sub + (get_local $2) + ;;@ (lib)/memory.ts:245:7 + (get_local $3) + ) + ) + ;;@ (lib)/memory.ts:248:2 + (set_local $5 + ;;@ (lib)/memory.ts:248:17 + (i64.or + (i64.extend_u/i32 + (get_local $4) + ) + ;;@ (lib)/memory.ts:248:28 + (i64.shl + ;;@ (lib)/memory.ts:248:29 + (i64.extend_u/i32 + (get_local $4) + ) + ;;@ (lib)/memory.ts:248:41 + (i64.const 32) + ) + ) + ) + ;;@ (lib)/memory.ts:249:2 + (block $break|0 + (loop $continue|0 + (if + ;;@ (lib)/memory.ts:249:9 + (i32.ge_u + (get_local $2) + ;;@ (lib)/memory.ts:249:14 + (i32.const 32) + ) + (block + (block + ;;@ (lib)/memory.ts:250:4 + (i64.store + ;;@ (lib)/memory.ts:250:15 + (get_local $0) + ;;@ (lib)/memory.ts:250:21 + (get_local $5) + ) + ;;@ (lib)/memory.ts:251:4 + (i64.store + ;;@ (lib)/memory.ts:251:15 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:251:22 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:251:25 + (get_local $5) + ) + ;;@ (lib)/memory.ts:252:4 + (i64.store + ;;@ (lib)/memory.ts:252:15 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:252:22 + (i32.const 16) + ) + ;;@ (lib)/memory.ts:252:26 + (get_local $5) + ) + ;;@ (lib)/memory.ts:253:4 + (i64.store + ;;@ (lib)/memory.ts:253:15 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:253:22 + (i32.const 24) + ) + ;;@ (lib)/memory.ts:253:26 + (get_local $5) + ) + ;;@ (lib)/memory.ts:254:4 + (set_local $2 + (i32.sub + (get_local $2) + ;;@ (lib)/memory.ts:254:9 + (i32.const 32) + ) + ) + ;;@ (lib)/memory.ts:255:4 + (set_local $0 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:255:12 + (i32.const 32) + ) + ) + ) + (br $continue|0) + ) + ) + ) + ) + ) + (func $start (; 18 ;) (type $v) (set_global $assembly/buddy/BUCKET_START ;;@ assembly/buddy.ts:92:26 (get_global $HEAP_BASE) diff --git a/tests/allocators/buddy/index.js b/tests/allocators/buddy/index.js index 88195d31..615822e6 100644 --- a/tests/allocators/buddy/index.js +++ b/tests/allocators/buddy/index.js @@ -19,15 +19,7 @@ function test(file) { return String.fromCharCode.apply(String, str); } - // TODO: create an actual test-runner - var ptr1 = exports.allocate_memory(16); - var ptr2 = exports.allocate_memory(16); - if (ptr1 == ptr2) throw Error(); - exports.free_memory(ptr1); - exports.free_memory(ptr2); - ptr2 = exports.allocate_memory(16); - if (ptr1 != ptr2) throw Error(); - exports.free_memory(ptr2); + require("../runner")(exports, 20, 20000); console.log("mem final: " + exports.memory.buffer.byteLength); console.log(); diff --git a/tests/allocators/tlsf/runner.js b/tests/allocators/runner.js similarity index 72% rename from tests/allocators/tlsf/runner.js rename to tests/allocators/runner.js index d85e2caf..6d7704eb 100644 --- a/tests/allocators/tlsf/runner.js +++ b/tests/allocators/runner.js @@ -1,15 +1,15 @@ -function runner(tlsf, runs, allocs) { +function runner(allocator, runs, allocs) { var ptrs = []; function randomAlloc(maxSize) { if (!maxSize) maxSize = 8192; var size = ((Math.random() * maxSize) >>> 0) + 1; size = (size + 3) & ~3; - var ptr = tlsf.allocate_memory(size); + var ptr = allocator.allocate_memory(size); if (!ptr) throw Error(); if (ptrs.indexOf(ptr) >= 0) throw Error(); - if (tlsf.set_memory) - tlsf.set_memory(ptr, 0xdc, size); + if (allocator.set_memory) + allocator.set_memory(ptr, 0xdc, size); ptrs.push(ptr); return ptr; } @@ -20,7 +20,7 @@ function runner(tlsf, runs, allocs) { var ptr = ptrs[idx]; ptrs.splice(idx, 1); if (typeof ptr !== "number") throw Error(); - tlsf.free_memory(ptr); + allocator.free_memory(ptr); } function randomFree() { @@ -28,14 +28,14 @@ function runner(tlsf, runs, allocs) { var ptr = ptrs[idx]; if (typeof ptr !== "number") throw Error(); ptrs.splice(idx, 1); - tlsf.free_memory(ptr); + allocator.free_memory(ptr); } // remember the smallest possible memory address - var base = tlsf.allocate_memory(64); + var base = allocator.allocate_memory(64); console.log("base: " + base); - tlsf.free_memory(base); - console.log("mem initial: " + tlsf.memory.buffer.byteLength); + allocator.free_memory(base); + console.log("mem initial: " + allocator.memory.buffer.byteLength); try { for (var j = 0; j < runs; ++j) { @@ -55,17 +55,18 @@ function runner(tlsf, runs, allocs) { while (ptrs.length) randomFree(); // should now be possible to reuse the entire memory - // just try a large portion of the memory here because of SL+1 for allocs - var size = ((tlsf.memory.buffer.byteLength - base) * 9 / 10) >>> 0; - var ptr = tlsf.allocate_memory(size); - if (tlsf.set_memory) - tlsf.set_memory(ptr, 0xac, size); + // just try a large portion of the memory here, for example because of + // SL+1 for allocations in TLSF + var size = ((allocator.memory.buffer.byteLength - base) * 9 / 10) >>> 0; + var ptr = allocator.allocate_memory(size); + if (allocator.set_memory) + allocator.set_memory(ptr, 0xac, size); if (ptr !== base) throw Error("expected " + base + " but got " + ptr); - tlsf.free_memory(ptr); + allocator.free_memory(ptr); } } finally { - // mem(tlsf.memory, 0, 0x10000); + // mem(allocator.memory, 0, 0x10000); } } diff --git a/tests/allocators/tlsf/assembly/index.ts b/tests/allocators/tlsf/assembly/index.ts index 09339aca..68c4065a 100644 --- a/tests/allocators/tlsf/assembly/index.ts +++ b/tests/allocators/tlsf/assembly/index.ts @@ -1,2 +1,3 @@ import "allocator/tlsf"; export { allocate_memory, free_memory }; +export { set_memory }; diff --git a/tests/allocators/tlsf/index.js b/tests/allocators/tlsf/index.js index 5d4affc7..7aadce9f 100644 --- a/tests/allocators/tlsf/index.js +++ b/tests/allocators/tlsf/index.js @@ -1,5 +1,4 @@ const fs = require("fs"); -const runner = require("./runner"); function test(file) { console.log("Testing '" + file + "' ...\n"); @@ -20,7 +19,7 @@ function test(file) { return String.fromCharCode.apply(String, str); } - runner(exports, 20, 20000); // picked so I/O isn't the bottleneck + require("../runner")(exports, 20, 20000); // picked so I/O isn't the bottleneck console.log("mem final: " + exports.memory.buffer.byteLength); console.log(); } diff --git a/tests/allocators/tlsf/tlsf.optimized.wat b/tests/allocators/tlsf/tlsf.optimized.wat index 43de90f6..2bb4ac0a 100644 --- a/tests/allocators/tlsf/tlsf.optimized.wat +++ b/tests/allocators/tlsf/tlsf.optimized.wat @@ -12,6 +12,7 @@ (memory $0 1) (export "allocate_memory" (func "$(lib)/allocator/tlsf/allocate_memory")) (export "free_memory" (func "$(lib)/allocator/tlsf/free_memory")) + (export "set_memory" (func "$(lib)/memory/set_memory")) (export "memory" (memory $0)) (start $start) (func "$(lib)/allocator/tlsf/Root#set:tailRef" (; 0 ;) (type $iiv) (param $0 i32) (param $1 i32) @@ -1093,30 +1094,30 @@ (local $2 i32) (local $3 i32) (local $4 i32) - ;;@ (lib)/allocator/tlsf.ts:438:2 + ;;@ (lib)/allocator/tlsf.ts:439:2 (if - ;;@ (lib)/allocator/tlsf.ts:438:6 + ;;@ (lib)/allocator/tlsf.ts:439:6 (i32.eqz - ;;@ (lib)/allocator/tlsf.ts:437:2 + ;;@ (lib)/allocator/tlsf.ts:438:2 (tee_local $2 - ;;@ (lib)/allocator/tlsf.ts:437:13 + ;;@ (lib)/allocator/tlsf.ts:438:13 (get_global "$(lib)/allocator/tlsf/ROOT") ) ) - ;;@ (lib)/allocator/tlsf.ts:438:13 + ;;@ (lib)/allocator/tlsf.ts:439:13 (block - ;;@ (lib)/allocator/tlsf.ts:440:4 + ;;@ (lib)/allocator/tlsf.ts:441:4 (set_global "$(lib)/allocator/tlsf/ROOT" - ;;@ (lib)/allocator/tlsf.ts:440:11 + ;;@ (lib)/allocator/tlsf.ts:441:11 (tee_local $2 - ;;@ (lib)/allocator/tlsf.ts:439:4 + ;;@ (lib)/allocator/tlsf.ts:440:4 (tee_local $4 - ;;@ (lib)/allocator/tlsf.ts:439:21 + ;;@ (lib)/allocator/tlsf.ts:440:21 (i32.and (i32.add - ;;@ (lib)/allocator/tlsf.ts:439:22 + ;;@ (lib)/allocator/tlsf.ts:440:22 (get_global $HEAP_BASE) - ;;@ (lib)/allocator/tlsf.ts:439:34 + ;;@ (lib)/allocator/tlsf.ts:440:34 (i32.const 3) ) (i32.const -4) @@ -1124,65 +1125,65 @@ ) ) ) - ;;@ (lib)/allocator/tlsf.ts:441:4 + ;;@ (lib)/allocator/tlsf.ts:442:4 (call "$(lib)/allocator/tlsf/Root#set:tailRef" (get_local $2) - ;;@ (lib)/allocator/tlsf.ts:441:19 + ;;@ (lib)/allocator/tlsf.ts:442:19 (i32.const 0) ) - ;;@ (lib)/allocator/tlsf.ts:442:4 + ;;@ (lib)/allocator/tlsf.ts:443:4 (i32.store (get_local $2) - ;;@ (lib)/allocator/tlsf.ts:442:17 + ;;@ (lib)/allocator/tlsf.ts:443:17 (i32.const 0) ) (loop $continue|0 (if - ;;@ (lib)/allocator/tlsf.ts:443:28 + ;;@ (lib)/allocator/tlsf.ts:444:28 (i32.lt_u (get_local $1) - ;;@ (lib)/allocator/tlsf.ts:443:33 + ;;@ (lib)/allocator/tlsf.ts:444:33 (i32.const 23) ) (block - ;;@ (lib)/allocator/tlsf.ts:444:11 + ;;@ (lib)/allocator/tlsf.ts:445:11 (call "$(lib)/allocator/tlsf/Root#setSLMap" - ;;@ (lib)/allocator/tlsf.ts:444:6 + ;;@ (lib)/allocator/tlsf.ts:445:6 (get_local $2) - ;;@ (lib)/allocator/tlsf.ts:444:20 + ;;@ (lib)/allocator/tlsf.ts:445:20 (get_local $1) - ;;@ (lib)/allocator/tlsf.ts:444:24 + ;;@ (lib)/allocator/tlsf.ts:445:24 (i32.const 0) ) - ;;@ (lib)/allocator/tlsf.ts:445:11 + ;;@ (lib)/allocator/tlsf.ts:446:11 (set_local $3 - ;;@ (lib)/allocator/tlsf.ts:445:25 + ;;@ (lib)/allocator/tlsf.ts:446:25 (i32.const 0) ) (loop $continue|1 (if - ;;@ (lib)/allocator/tlsf.ts:445:28 + ;;@ (lib)/allocator/tlsf.ts:446:28 (i32.lt_u (get_local $3) - ;;@ (lib)/allocator/tlsf.ts:445:33 + ;;@ (lib)/allocator/tlsf.ts:446:33 (i32.const 32) ) (block - ;;@ (lib)/allocator/tlsf.ts:446:13 + ;;@ (lib)/allocator/tlsf.ts:447:13 (call "$(lib)/allocator/tlsf/Root#setHead" - ;;@ (lib)/allocator/tlsf.ts:446:8 + ;;@ (lib)/allocator/tlsf.ts:447:8 (get_local $2) - ;;@ (lib)/allocator/tlsf.ts:446:21 + ;;@ (lib)/allocator/tlsf.ts:447:21 (get_local $1) - ;;@ (lib)/allocator/tlsf.ts:446:25 + ;;@ (lib)/allocator/tlsf.ts:447:25 (get_local $3) - ;;@ (lib)/allocator/tlsf.ts:446:29 + ;;@ (lib)/allocator/tlsf.ts:447:29 (i32.const 0) ) - ;;@ (lib)/allocator/tlsf.ts:445:42 + ;;@ (lib)/allocator/tlsf.ts:446:42 (set_local $3 (i32.add - ;;@ (lib)/allocator/tlsf.ts:445:44 + ;;@ (lib)/allocator/tlsf.ts:446:44 (get_local $3) (i32.const 1) ) @@ -1191,10 +1192,10 @@ ) ) ) - ;;@ (lib)/allocator/tlsf.ts:443:42 + ;;@ (lib)/allocator/tlsf.ts:444:42 (set_local $1 (i32.add - ;;@ (lib)/allocator/tlsf.ts:443:44 + ;;@ (lib)/allocator/tlsf.ts:444:44 (get_local $1) (i32.const 1) ) @@ -1203,75 +1204,75 @@ ) ) ) - ;;@ (lib)/allocator/tlsf.ts:448:9 + ;;@ (lib)/allocator/tlsf.ts:449:9 (drop (call "$(lib)/allocator/tlsf/Root#addMemory" - ;;@ (lib)/allocator/tlsf.ts:448:4 + ;;@ (lib)/allocator/tlsf.ts:449:4 (get_local $2) - ;;@ (lib)/allocator/tlsf.ts:448:19 + ;;@ (lib)/allocator/tlsf.ts:449:19 (i32.add (get_local $4) - ;;@ (lib)/allocator/tlsf.ts:448:32 + ;;@ (lib)/allocator/tlsf.ts:449:32 (i32.const 3044) ) - ;;@ (lib)/allocator/tlsf.ts:448:43 + ;;@ (lib)/allocator/tlsf.ts:449:43 (i32.shl (current_memory) - ;;@ (lib)/allocator/tlsf.ts:448:63 + ;;@ (lib)/allocator/tlsf.ts:449:63 (i32.const 16) ) ) ) ) ) - ;;@ (lib)/allocator/tlsf.ts:452:2 + ;;@ (lib)/allocator/tlsf.ts:453:2 (set_local $1 - ;;@ (lib)/allocator/tlsf.ts:452:20 + ;;@ (lib)/allocator/tlsf.ts:453:20 (i32.const 0) ) - ;;@ (lib)/allocator/tlsf.ts:453:2 + ;;@ (lib)/allocator/tlsf.ts:454:2 (if (select - ;;@ (lib)/allocator/tlsf.ts:453:14 + ;;@ (lib)/allocator/tlsf.ts:454:14 (i32.lt_u (get_local $0) - ;;@ (lib)/allocator/tlsf.ts:453:21 + ;;@ (lib)/allocator/tlsf.ts:454:21 (i32.const 1073741824) ) (get_local $0) - ;;@ (lib)/allocator/tlsf.ts:453:6 + ;;@ (lib)/allocator/tlsf.ts:454:6 (get_local $0) ) - ;;@ (lib)/allocator/tlsf.ts:453:37 + ;;@ (lib)/allocator/tlsf.ts:454:37 (block - ;;@ (lib)/allocator/tlsf.ts:457:4 + ;;@ (lib)/allocator/tlsf.ts:458:4 (if - ;;@ (lib)/allocator/tlsf.ts:457:8 + ;;@ (lib)/allocator/tlsf.ts:458:8 (i32.eqz - ;;@ (lib)/allocator/tlsf.ts:456:4 + ;;@ (lib)/allocator/tlsf.ts:457:4 (tee_local $1 - ;;@ (lib)/allocator/tlsf.ts:456:21 + ;;@ (lib)/allocator/tlsf.ts:457:21 (call "$(lib)/allocator/tlsf/Root#search" - ;;@ (lib)/allocator/tlsf.ts:456:16 + ;;@ (lib)/allocator/tlsf.ts:457:16 (get_local $2) - ;;@ (lib)/allocator/tlsf.ts:454:4 + ;;@ (lib)/allocator/tlsf.ts:455:4 (tee_local $0 - ;;@ (lib)/allocator/tlsf.ts:454:11 + ;;@ (lib)/allocator/tlsf.ts:455:11 (select (tee_local $1 - ;;@ (lib)/allocator/tlsf.ts:454:22 + ;;@ (lib)/allocator/tlsf.ts:455:22 (i32.and (i32.add - ;;@ (lib)/allocator/tlsf.ts:454:23 + ;;@ (lib)/allocator/tlsf.ts:455:23 (get_local $0) - ;;@ (lib)/allocator/tlsf.ts:454:30 + ;;@ (lib)/allocator/tlsf.ts:455:30 (i32.const 3) ) (i32.const -4) ) ) (tee_local $3 - ;;@ (lib)/allocator/tlsf.ts:454:51 + ;;@ (lib)/allocator/tlsf.ts:455:51 (i32.const 12) ) (i32.gt_u @@ -1283,36 +1284,36 @@ ) ) ) - ;;@ (lib)/allocator/tlsf.ts:457:16 + ;;@ (lib)/allocator/tlsf.ts:458:16 (block - ;;@ (lib)/allocator/tlsf.ts:462:6 + ;;@ (lib)/allocator/tlsf.ts:463:6 (if - ;;@ (lib)/allocator/tlsf.ts:462:10 + ;;@ (lib)/allocator/tlsf.ts:463:10 (i32.lt_s (grow_memory - ;;@ (lib)/allocator/tlsf.ts:461:24 + ;;@ (lib)/allocator/tlsf.ts:462:24 (select (tee_local $1 - ;;@ (lib)/allocator/tlsf.ts:460:6 + ;;@ (lib)/allocator/tlsf.ts:461:6 (tee_local $4 - ;;@ (lib)/allocator/tlsf.ts:460:24 + ;;@ (lib)/allocator/tlsf.ts:461:24 (current_memory) ) ) (tee_local $3 - ;;@ (lib)/allocator/tlsf.ts:461:41 + ;;@ (lib)/allocator/tlsf.ts:462:41 (i32.shr_u (i32.and - ;;@ (lib)/allocator/tlsf.ts:461:42 + ;;@ (lib)/allocator/tlsf.ts:462:42 (i32.add - ;;@ (lib)/allocator/tlsf.ts:461:43 + ;;@ (lib)/allocator/tlsf.ts:462:43 (get_local $0) - ;;@ (lib)/allocator/tlsf.ts:461:50 + ;;@ (lib)/allocator/tlsf.ts:462:50 (i32.const 65535) ) (i32.const -65536) ) - ;;@ (lib)/allocator/tlsf.ts:461:73 + ;;@ (lib)/allocator/tlsf.ts:462:73 (i32.const 16) ) ) @@ -1322,108 +1323,108 @@ ) ) ) - ;;@ (lib)/allocator/tlsf.ts:462:37 + ;;@ (lib)/allocator/tlsf.ts:463:37 (i32.const 0) ) - ;;@ (lib)/allocator/tlsf.ts:463:8 + ;;@ (lib)/allocator/tlsf.ts:464:8 (unreachable) ) - ;;@ (lib)/allocator/tlsf.ts:465:11 + ;;@ (lib)/allocator/tlsf.ts:466:11 (drop (call "$(lib)/allocator/tlsf/Root#addMemory" - ;;@ (lib)/allocator/tlsf.ts:465:6 + ;;@ (lib)/allocator/tlsf.ts:466:6 (get_local $2) - ;;@ (lib)/allocator/tlsf.ts:465:21 + ;;@ (lib)/allocator/tlsf.ts:466:21 (i32.shl (get_local $4) - ;;@ (lib)/allocator/tlsf.ts:465:43 + ;;@ (lib)/allocator/tlsf.ts:466:43 (i32.const 16) ) - ;;@ (lib)/allocator/tlsf.ts:465:47 + ;;@ (lib)/allocator/tlsf.ts:466:47 (i32.shl - ;;@ (lib)/allocator/tlsf.ts:464:23 + ;;@ (lib)/allocator/tlsf.ts:465:23 (current_memory) - ;;@ (lib)/allocator/tlsf.ts:465:68 + ;;@ (lib)/allocator/tlsf.ts:466:68 (i32.const 16) ) ) ) - ;;@ (lib)/allocator/tlsf.ts:466:6 + ;;@ (lib)/allocator/tlsf.ts:467:6 (set_local $1 - ;;@ (lib)/allocator/tlsf.ts:466:14 + ;;@ (lib)/allocator/tlsf.ts:467:14 (call "$(lib)/allocator/tlsf/Root#search" - ;;@ (lib)/allocator/tlsf.ts:466:21 + ;;@ (lib)/allocator/tlsf.ts:467:21 (get_local $2) - ;;@ (lib)/allocator/tlsf.ts:466:33 + ;;@ (lib)/allocator/tlsf.ts:467:33 (get_local $0) ) ) ) ) - ;;@ (lib)/allocator/tlsf.ts:470:4 + ;;@ (lib)/allocator/tlsf.ts:471:4 (set_local $1 - ;;@ (lib)/allocator/tlsf.ts:470:16 + ;;@ (lib)/allocator/tlsf.ts:471:16 (call "$(lib)/allocator/tlsf/Root#use" - ;;@ (lib)/allocator/tlsf.ts:470:11 + ;;@ (lib)/allocator/tlsf.ts:471:11 (get_local $2) - ;;@ (lib)/allocator/tlsf.ts:470:20 + ;;@ (lib)/allocator/tlsf.ts:471:20 (get_local $1) - ;;@ (lib)/allocator/tlsf.ts:470:27 + ;;@ (lib)/allocator/tlsf.ts:471:27 (get_local $0) ) ) ) ) - ;;@ (lib)/allocator/tlsf.ts:473:9 + ;;@ (lib)/allocator/tlsf.ts:474:9 (get_local $1) ) (func "$(lib)/allocator/tlsf/free_memory" (; 13 ;) (type $iv) (param $0 i32) (local $1 i32) (local $2 i32) - ;;@ (lib)/allocator/tlsf.ts:478:2 + ;;@ (lib)/allocator/tlsf.ts:480:2 (if - ;;@ (lib)/allocator/tlsf.ts:478:6 + ;;@ (lib)/allocator/tlsf.ts:480:6 (get_local $0) - ;;@ (lib)/allocator/tlsf.ts:480:4 + ;;@ (lib)/allocator/tlsf.ts:482:4 (if - ;;@ (lib)/allocator/tlsf.ts:479:4 + ;;@ (lib)/allocator/tlsf.ts:481:4 (tee_local $1 - ;;@ (lib)/allocator/tlsf.ts:479:15 + ;;@ (lib)/allocator/tlsf.ts:481:15 (get_global "$(lib)/allocator/tlsf/ROOT") ) - ;;@ (lib)/allocator/tlsf.ts:480:14 + ;;@ (lib)/allocator/tlsf.ts:482:14 (block - ;;@ (lib)/allocator/tlsf.ts:484:6 + ;;@ (lib)/allocator/tlsf.ts:486:6 (i32.store - ;;@ (lib)/allocator/tlsf.ts:481:6 + ;;@ (lib)/allocator/tlsf.ts:483:6 (tee_local $2 - ;;@ (lib)/allocator/tlsf.ts:481:18 + ;;@ (lib)/allocator/tlsf.ts:483:18 (i32.sub - ;;@ (lib)/allocator/tlsf.ts:481:36 + ;;@ (lib)/allocator/tlsf.ts:483:36 (get_local $0) - ;;@ (lib)/allocator/tlsf.ts:481:43 + ;;@ (lib)/allocator/tlsf.ts:483:43 (i32.const 4) ) ) - ;;@ (lib)/allocator/tlsf.ts:484:19 + ;;@ (lib)/allocator/tlsf.ts:486:19 (i32.or - ;;@ (lib)/allocator/tlsf.ts:482:22 + ;;@ (lib)/allocator/tlsf.ts:484:22 (i32.load (get_local $2) ) - ;;@ (lib)/allocator/tlsf.ts:484:31 + ;;@ (lib)/allocator/tlsf.ts:486:31 (i32.const 1) ) ) - ;;@ (lib)/allocator/tlsf.ts:485:11 + ;;@ (lib)/allocator/tlsf.ts:487:11 (call "$(lib)/allocator/tlsf/Root#insert" - ;;@ (lib)/allocator/tlsf.ts:485:6 + ;;@ (lib)/allocator/tlsf.ts:487:6 (get_local $1) - ;;@ (lib)/allocator/tlsf.ts:485:18 + ;;@ (lib)/allocator/tlsf.ts:487:18 (i32.sub - ;;@ (lib)/allocator/tlsf.ts:485:36 + ;;@ (lib)/allocator/tlsf.ts:487:36 (get_local $0) - ;;@ (lib)/allocator/tlsf.ts:485:43 + ;;@ (lib)/allocator/tlsf.ts:487:43 (i32.const 4) ) ) @@ -1431,7 +1432,505 @@ ) ) ) - (func $start (; 14 ;) (type $v) + (func "$(lib)/memory/set_memory" (; 14 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i64) + (local $4 i32) + ;;@ (lib)/memory.ts:196:2 + (if + ;;@ (lib)/memory.ts:196:6 + (i32.eqz + ;;@ (lib)/memory.ts:196:7 + (get_local $2) + ) + ;;@ (lib)/memory.ts:197:4 + (return) + ) + ;;@ (lib)/memory.ts:198:2 + (i32.store8 + ;;@ (lib)/memory.ts:198:12 + (get_local $0) + ;;@ (lib)/memory.ts:198:18 + (get_local $1) + ) + ;;@ (lib)/memory.ts:199:2 + (i32.store8 + ;;@ (lib)/memory.ts:199:12 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:199:19 + (get_local $2) + ) + ;;@ (lib)/memory.ts:199:23 + (i32.const 1) + ) + ;;@ (lib)/memory.ts:199:26 + (get_local $1) + ) + ;;@ (lib)/memory.ts:200:2 + (if + ;;@ (lib)/memory.ts:200:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:200:11 + (i32.const 2) + ) + ;;@ (lib)/memory.ts:201:4 + (return) + ) + ;;@ (lib)/memory.ts:203:2 + (i32.store8 + ;;@ (lib)/memory.ts:203:12 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:203:19 + (i32.const 1) + ) + ;;@ (lib)/memory.ts:203:22 + (get_local $1) + ) + ;;@ (lib)/memory.ts:204:2 + (i32.store8 + ;;@ (lib)/memory.ts:204:12 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:204:19 + (i32.const 2) + ) + ;;@ (lib)/memory.ts:204:22 + (get_local $1) + ) + ;;@ (lib)/memory.ts:205:2 + (i32.store8 + ;;@ (lib)/memory.ts:205:12 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:205:19 + (get_local $2) + ) + ;;@ (lib)/memory.ts:205:23 + (i32.const 2) + ) + ;;@ (lib)/memory.ts:205:26 + (get_local $1) + ) + ;;@ (lib)/memory.ts:206:2 + (i32.store8 + ;;@ (lib)/memory.ts:206:12 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:206:19 + (get_local $2) + ) + ;;@ (lib)/memory.ts:206:23 + (i32.const 3) + ) + ;;@ (lib)/memory.ts:206:26 + (get_local $1) + ) + ;;@ (lib)/memory.ts:207:2 + (if + ;;@ (lib)/memory.ts:207:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:207:11 + (i32.const 6) + ) + ;;@ (lib)/memory.ts:208:4 + (return) + ) + ;;@ (lib)/memory.ts:209:2 + (i32.store8 + ;;@ (lib)/memory.ts:209:12 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:209:19 + (i32.const 3) + ) + ;;@ (lib)/memory.ts:209:22 + (get_local $1) + ) + ;;@ (lib)/memory.ts:210:2 + (i32.store8 + ;;@ (lib)/memory.ts:210:12 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:210:19 + (get_local $2) + ) + ;;@ (lib)/memory.ts:210:23 + (i32.const 4) + ) + ;;@ (lib)/memory.ts:210:26 + (get_local $1) + ) + ;;@ (lib)/memory.ts:211:2 + (if + ;;@ (lib)/memory.ts:211:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:211:11 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:212:4 + (return) + ) + ;;@ (lib)/memory.ts:223:2 + (i32.store + ;;@ (lib)/memory.ts:216:2 + (tee_local $0 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:215:2 + (tee_local $4 + ;;@ (lib)/memory.ts:215:17 + (i32.and + (i32.sub + (i32.const 0) + ;;@ (lib)/memory.ts:215:18 + (get_local $0) + ) + ;;@ (lib)/memory.ts:215:25 + (i32.const 3) + ) + ) + ) + ) + ;;@ (lib)/memory.ts:220:2 + (tee_local $1 + ;;@ (lib)/memory.ts:220:17 + (i32.mul + ;;@ (lib)/memory.ts:220:33 + (get_local $1) + (i32.const 16843009) + ) + ) + ) + ;;@ (lib)/memory.ts:224:2 + (i32.store + ;;@ (lib)/memory.ts:224:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:218:2 + (tee_local $2 + (i32.and + (i32.sub + ;;@ (lib)/memory.ts:217:2 + (get_local $2) + ;;@ (lib)/memory.ts:217:7 + (get_local $4) + ) + ;;@ (lib)/memory.ts:218:7 + (i32.const -4) + ) + ) + ) + ;;@ (lib)/memory.ts:224:24 + (i32.const 4) + ) + ;;@ (lib)/memory.ts:224:27 + (get_local $1) + ) + ;;@ (lib)/memory.ts:225:2 + (if + ;;@ (lib)/memory.ts:225:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:225:11 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:226:4 + (return) + ) + ;;@ (lib)/memory.ts:227:2 + (i32.store + ;;@ (lib)/memory.ts:227:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:227:20 + (i32.const 4) + ) + ;;@ (lib)/memory.ts:227:23 + (get_local $1) + ) + ;;@ (lib)/memory.ts:228:2 + (i32.store + ;;@ (lib)/memory.ts:228:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:228:20 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:228:23 + (get_local $1) + ) + ;;@ (lib)/memory.ts:229:2 + (i32.store + ;;@ (lib)/memory.ts:229:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:229:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:229:24 + (i32.const 12) + ) + ;;@ (lib)/memory.ts:229:28 + (get_local $1) + ) + ;;@ (lib)/memory.ts:230:2 + (i32.store + ;;@ (lib)/memory.ts:230:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:230:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:230:24 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:230:27 + (get_local $1) + ) + ;;@ (lib)/memory.ts:231:2 + (if + ;;@ (lib)/memory.ts:231:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:231:11 + (i32.const 24) + ) + ;;@ (lib)/memory.ts:232:4 + (return) + ) + ;;@ (lib)/memory.ts:233:2 + (i32.store + ;;@ (lib)/memory.ts:233:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:233:20 + (i32.const 12) + ) + ;;@ (lib)/memory.ts:233:24 + (get_local $1) + ) + ;;@ (lib)/memory.ts:234:2 + (i32.store + ;;@ (lib)/memory.ts:234:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:234:20 + (i32.const 16) + ) + ;;@ (lib)/memory.ts:234:24 + (get_local $1) + ) + ;;@ (lib)/memory.ts:235:2 + (i32.store + ;;@ (lib)/memory.ts:235:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:235:20 + (i32.const 20) + ) + ;;@ (lib)/memory.ts:235:24 + (get_local $1) + ) + ;;@ (lib)/memory.ts:236:2 + (i32.store + ;;@ (lib)/memory.ts:236:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:236:20 + (i32.const 24) + ) + ;;@ (lib)/memory.ts:236:24 + (get_local $1) + ) + ;;@ (lib)/memory.ts:237:2 + (i32.store + ;;@ (lib)/memory.ts:237:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:237:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:237:24 + (i32.const 28) + ) + ;;@ (lib)/memory.ts:237:28 + (get_local $1) + ) + ;;@ (lib)/memory.ts:238:2 + (i32.store + ;;@ (lib)/memory.ts:238:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:238:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:238:24 + (i32.const 24) + ) + ;;@ (lib)/memory.ts:238:28 + (get_local $1) + ) + ;;@ (lib)/memory.ts:239:2 + (i32.store + ;;@ (lib)/memory.ts:239:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:239:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:239:24 + (i32.const 20) + ) + ;;@ (lib)/memory.ts:239:28 + (get_local $1) + ) + ;;@ (lib)/memory.ts:240:2 + (i32.store + ;;@ (lib)/memory.ts:240:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:240:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:240:24 + (i32.const 16) + ) + ;;@ (lib)/memory.ts:240:28 + (get_local $1) + ) + ;;@ (lib)/memory.ts:244:2 + (set_local $0 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:243:2 + (tee_local $4 + ;;@ (lib)/memory.ts:243:6 + (i32.add + ;;@ (lib)/memory.ts:243:11 + (i32.and + ;;@ (lib)/memory.ts:243:12 + (get_local $0) + ;;@ (lib)/memory.ts:243:19 + (i32.const 4) + ) + ;;@ (lib)/memory.ts:243:6 + (i32.const 24) + ) + ) + ) + ) + ;;@ (lib)/memory.ts:245:2 + (set_local $2 + (i32.sub + (get_local $2) + ;;@ (lib)/memory.ts:245:7 + (get_local $4) + ) + ) + ;;@ (lib)/memory.ts:248:2 + (set_local $3 + ;;@ (lib)/memory.ts:248:17 + (i64.or + (i64.extend_u/i32 + (get_local $1) + ) + ;;@ (lib)/memory.ts:248:28 + (i64.shl + ;;@ (lib)/memory.ts:248:29 + (i64.extend_u/i32 + (get_local $1) + ) + ;;@ (lib)/memory.ts:248:41 + (i64.const 32) + ) + ) + ) + (loop $continue|0 + (if + ;;@ (lib)/memory.ts:249:9 + (i32.ge_u + (get_local $2) + ;;@ (lib)/memory.ts:249:14 + (i32.const 32) + ) + (block + ;;@ (lib)/memory.ts:250:4 + (i64.store + ;;@ (lib)/memory.ts:250:15 + (get_local $0) + ;;@ (lib)/memory.ts:250:21 + (get_local $3) + ) + ;;@ (lib)/memory.ts:251:4 + (i64.store + ;;@ (lib)/memory.ts:251:15 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:251:22 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:251:25 + (get_local $3) + ) + ;;@ (lib)/memory.ts:252:4 + (i64.store + ;;@ (lib)/memory.ts:252:15 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:252:22 + (i32.const 16) + ) + ;;@ (lib)/memory.ts:252:26 + (get_local $3) + ) + ;;@ (lib)/memory.ts:253:4 + (i64.store + ;;@ (lib)/memory.ts:253:15 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:253:22 + (i32.const 24) + ) + ;;@ (lib)/memory.ts:253:26 + (get_local $3) + ) + ;;@ (lib)/memory.ts:254:4 + (set_local $2 + (i32.sub + (get_local $2) + ;;@ (lib)/memory.ts:254:9 + (i32.const 32) + ) + ) + ;;@ (lib)/memory.ts:255:4 + (set_local $0 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:255:12 + (i32.const 32) + ) + ) + (br $continue|0) + ) + ) + ) + ) + (func $start (; 15 ;) (type $v) (nop) ) ) diff --git a/tests/allocators/tlsf/tlsf.untouched.wat b/tests/allocators/tlsf/tlsf.untouched.wat index ffc0769b..d1cb6233 100644 --- a/tests/allocators/tlsf/tlsf.untouched.wat +++ b/tests/allocators/tlsf/tlsf.untouched.wat @@ -27,6 +27,7 @@ (data (i32.const 4) "\17\00\00\00(\00l\00i\00b\00)\00/\00a\00l\00l\00o\00c\00a\00t\00o\00r\00/\00t\00l\00s\00f\00.\00t\00s\00") (export "allocate_memory" (func "$(lib)/allocator/tlsf/allocate_memory")) (export "free_memory" (func "$(lib)/allocator/tlsf/free_memory")) + (export "set_memory" (func "$(lib)/memory/set_memory")) (export "memory" (memory $0)) (start $start) (func "$(lib)/allocator/tlsf/Root#set:tailRef" (; 1 ;) (type $iiv) (param $0 i32) (param $1 i32) @@ -2258,115 +2259,115 @@ (local $9 i32) (local $10 i32) (local $11 i32) - ;;@ (lib)/allocator/tlsf.ts:437:2 + ;;@ (lib)/allocator/tlsf.ts:438:2 (set_local $1 - ;;@ (lib)/allocator/tlsf.ts:437:13 + ;;@ (lib)/allocator/tlsf.ts:438:13 (get_global "$(lib)/allocator/tlsf/ROOT") ) - ;;@ (lib)/allocator/tlsf.ts:438:2 + ;;@ (lib)/allocator/tlsf.ts:439:2 (if - ;;@ (lib)/allocator/tlsf.ts:438:6 + ;;@ (lib)/allocator/tlsf.ts:439:6 (i32.eqz - ;;@ (lib)/allocator/tlsf.ts:438:7 + ;;@ (lib)/allocator/tlsf.ts:439:7 (get_local $1) ) - ;;@ (lib)/allocator/tlsf.ts:438:13 + ;;@ (lib)/allocator/tlsf.ts:439:13 (block - ;;@ (lib)/allocator/tlsf.ts:439:4 + ;;@ (lib)/allocator/tlsf.ts:440:4 (set_local $2 - ;;@ (lib)/allocator/tlsf.ts:439:21 + ;;@ (lib)/allocator/tlsf.ts:440:21 (i32.and (i32.add - ;;@ (lib)/allocator/tlsf.ts:439:22 + ;;@ (lib)/allocator/tlsf.ts:440:22 (get_global $HEAP_BASE) - ;;@ (lib)/allocator/tlsf.ts:439:34 + ;;@ (lib)/allocator/tlsf.ts:440:34 (i32.const 3) ) - ;;@ (lib)/allocator/tlsf.ts:439:45 + ;;@ (lib)/allocator/tlsf.ts:440:45 (i32.xor - ;;@ (lib)/allocator/tlsf.ts:439:46 + ;;@ (lib)/allocator/tlsf.ts:440:46 (i32.const 3) (i32.const -1) ) ) ) - ;;@ (lib)/allocator/tlsf.ts:440:4 + ;;@ (lib)/allocator/tlsf.ts:441:4 (set_global "$(lib)/allocator/tlsf/ROOT" - ;;@ (lib)/allocator/tlsf.ts:440:11 + ;;@ (lib)/allocator/tlsf.ts:441:11 (tee_local $1 - ;;@ (lib)/allocator/tlsf.ts:440:18 + ;;@ (lib)/allocator/tlsf.ts:441:18 (get_local $2) ) ) - ;;@ (lib)/allocator/tlsf.ts:441:4 + ;;@ (lib)/allocator/tlsf.ts:442:4 (call "$(lib)/allocator/tlsf/Root#set:tailRef" (get_local $1) - ;;@ (lib)/allocator/tlsf.ts:441:19 - (i32.const 0) - ) - ;;@ (lib)/allocator/tlsf.ts:442:4 - (i32.store - (get_local $1) - ;;@ (lib)/allocator/tlsf.ts:442:17 + ;;@ (lib)/allocator/tlsf.ts:442:19 (i32.const 0) ) ;;@ (lib)/allocator/tlsf.ts:443:4 + (i32.store + (get_local $1) + ;;@ (lib)/allocator/tlsf.ts:443:17 + (i32.const 0) + ) + ;;@ (lib)/allocator/tlsf.ts:444:4 (block $break|0 - ;;@ (lib)/allocator/tlsf.ts:443:9 + ;;@ (lib)/allocator/tlsf.ts:444:9 (set_local $3 - ;;@ (lib)/allocator/tlsf.ts:443:25 + ;;@ (lib)/allocator/tlsf.ts:444:25 (i32.const 0) ) (loop $continue|0 (if - ;;@ (lib)/allocator/tlsf.ts:443:28 + ;;@ (lib)/allocator/tlsf.ts:444:28 (i32.lt_u (get_local $3) - ;;@ (lib)/allocator/tlsf.ts:443:33 + ;;@ (lib)/allocator/tlsf.ts:444:33 (i32.const 23) ) (block (block - ;;@ (lib)/allocator/tlsf.ts:444:11 + ;;@ (lib)/allocator/tlsf.ts:445:11 (call "$(lib)/allocator/tlsf/Root#setSLMap" - ;;@ (lib)/allocator/tlsf.ts:444:6 + ;;@ (lib)/allocator/tlsf.ts:445:6 (get_local $1) - ;;@ (lib)/allocator/tlsf.ts:444:20 + ;;@ (lib)/allocator/tlsf.ts:445:20 (get_local $3) - ;;@ (lib)/allocator/tlsf.ts:444:24 + ;;@ (lib)/allocator/tlsf.ts:445:24 (i32.const 0) ) - ;;@ (lib)/allocator/tlsf.ts:445:6 + ;;@ (lib)/allocator/tlsf.ts:446:6 (block $break|1 - ;;@ (lib)/allocator/tlsf.ts:445:11 + ;;@ (lib)/allocator/tlsf.ts:446:11 (set_local $4 - ;;@ (lib)/allocator/tlsf.ts:445:25 + ;;@ (lib)/allocator/tlsf.ts:446:25 (i32.const 0) ) (loop $continue|1 (if - ;;@ (lib)/allocator/tlsf.ts:445:28 + ;;@ (lib)/allocator/tlsf.ts:446:28 (i32.lt_u (get_local $4) - ;;@ (lib)/allocator/tlsf.ts:445:33 + ;;@ (lib)/allocator/tlsf.ts:446:33 (i32.const 32) ) (block - ;;@ (lib)/allocator/tlsf.ts:446:13 + ;;@ (lib)/allocator/tlsf.ts:447:13 (call "$(lib)/allocator/tlsf/Root#setHead" - ;;@ (lib)/allocator/tlsf.ts:446:8 + ;;@ (lib)/allocator/tlsf.ts:447:8 (get_local $1) - ;;@ (lib)/allocator/tlsf.ts:446:21 + ;;@ (lib)/allocator/tlsf.ts:447:21 (get_local $3) - ;;@ (lib)/allocator/tlsf.ts:446:25 + ;;@ (lib)/allocator/tlsf.ts:447:25 (get_local $4) - ;;@ (lib)/allocator/tlsf.ts:446:29 + ;;@ (lib)/allocator/tlsf.ts:447:29 (i32.const 0) ) - ;;@ (lib)/allocator/tlsf.ts:445:42 + ;;@ (lib)/allocator/tlsf.ts:446:42 (set_local $4 (i32.add - ;;@ (lib)/allocator/tlsf.ts:445:44 + ;;@ (lib)/allocator/tlsf.ts:446:44 (get_local $4) (i32.const 1) ) @@ -2377,10 +2378,10 @@ ) ) ) - ;;@ (lib)/allocator/tlsf.ts:443:42 + ;;@ (lib)/allocator/tlsf.ts:444:42 (set_local $3 (i32.add - ;;@ (lib)/allocator/tlsf.ts:443:44 + ;;@ (lib)/allocator/tlsf.ts:444:44 (get_local $3) (i32.const 1) ) @@ -2390,73 +2391,73 @@ ) ) ) - ;;@ (lib)/allocator/tlsf.ts:448:9 + ;;@ (lib)/allocator/tlsf.ts:449:9 (drop (call "$(lib)/allocator/tlsf/Root#addMemory" - ;;@ (lib)/allocator/tlsf.ts:448:4 + ;;@ (lib)/allocator/tlsf.ts:449:4 (get_local $1) - ;;@ (lib)/allocator/tlsf.ts:448:19 + ;;@ (lib)/allocator/tlsf.ts:449:19 (i32.add (get_local $2) - ;;@ (lib)/allocator/tlsf.ts:448:32 + ;;@ (lib)/allocator/tlsf.ts:449:32 (i32.const 3044) ) - ;;@ (lib)/allocator/tlsf.ts:448:43 + ;;@ (lib)/allocator/tlsf.ts:449:43 (i32.shl (current_memory) - ;;@ (lib)/allocator/tlsf.ts:448:63 + ;;@ (lib)/allocator/tlsf.ts:449:63 (i32.const 16) ) ) ) ) ) - ;;@ (lib)/allocator/tlsf.ts:452:2 + ;;@ (lib)/allocator/tlsf.ts:453:2 (set_local $5 - ;;@ (lib)/allocator/tlsf.ts:452:20 + ;;@ (lib)/allocator/tlsf.ts:453:20 (i32.const 0) ) - ;;@ (lib)/allocator/tlsf.ts:453:2 + ;;@ (lib)/allocator/tlsf.ts:454:2 (if - ;;@ (lib)/allocator/tlsf.ts:453:6 + ;;@ (lib)/allocator/tlsf.ts:454:6 (if (result i32) (i32.ne (get_local $0) (i32.const 0) ) - ;;@ (lib)/allocator/tlsf.ts:453:14 + ;;@ (lib)/allocator/tlsf.ts:454:14 (i32.lt_u (get_local $0) - ;;@ (lib)/allocator/tlsf.ts:453:21 + ;;@ (lib)/allocator/tlsf.ts:454:21 (i32.const 1073741824) ) (get_local $0) ) - ;;@ (lib)/allocator/tlsf.ts:453:37 + ;;@ (lib)/allocator/tlsf.ts:454:37 (block - ;;@ (lib)/allocator/tlsf.ts:454:4 + ;;@ (lib)/allocator/tlsf.ts:455:4 (set_local $0 - ;;@ (lib)/allocator/tlsf.ts:454:11 + ;;@ (lib)/allocator/tlsf.ts:455:11 (select (tee_local $6 - ;;@ (lib)/allocator/tlsf.ts:454:22 + ;;@ (lib)/allocator/tlsf.ts:455:22 (i32.and (i32.add - ;;@ (lib)/allocator/tlsf.ts:454:23 + ;;@ (lib)/allocator/tlsf.ts:455:23 (get_local $0) - ;;@ (lib)/allocator/tlsf.ts:454:30 + ;;@ (lib)/allocator/tlsf.ts:455:30 (i32.const 3) ) - ;;@ (lib)/allocator/tlsf.ts:454:41 + ;;@ (lib)/allocator/tlsf.ts:455:41 (i32.xor - ;;@ (lib)/allocator/tlsf.ts:454:42 + ;;@ (lib)/allocator/tlsf.ts:455:42 (i32.const 3) (i32.const -1) ) ) ) (tee_local $7 - ;;@ (lib)/allocator/tlsf.ts:454:51 + ;;@ (lib)/allocator/tlsf.ts:455:51 (i32.const 12) ) (i32.gt_u @@ -2465,57 +2466,57 @@ ) ) ) - ;;@ (lib)/allocator/tlsf.ts:456:4 + ;;@ (lib)/allocator/tlsf.ts:457:4 (set_local $8 - ;;@ (lib)/allocator/tlsf.ts:456:21 + ;;@ (lib)/allocator/tlsf.ts:457:21 (call "$(lib)/allocator/tlsf/Root#search" - ;;@ (lib)/allocator/tlsf.ts:456:16 + ;;@ (lib)/allocator/tlsf.ts:457:16 (get_local $1) - ;;@ (lib)/allocator/tlsf.ts:456:28 + ;;@ (lib)/allocator/tlsf.ts:457:28 (get_local $0) ) ) - ;;@ (lib)/allocator/tlsf.ts:457:4 + ;;@ (lib)/allocator/tlsf.ts:458:4 (if - ;;@ (lib)/allocator/tlsf.ts:457:8 + ;;@ (lib)/allocator/tlsf.ts:458:8 (i32.eqz - ;;@ (lib)/allocator/tlsf.ts:457:9 + ;;@ (lib)/allocator/tlsf.ts:458:9 (get_local $8) ) - ;;@ (lib)/allocator/tlsf.ts:457:16 + ;;@ (lib)/allocator/tlsf.ts:458:16 (block - ;;@ (lib)/allocator/tlsf.ts:460:6 + ;;@ (lib)/allocator/tlsf.ts:461:6 (set_local $9 - ;;@ (lib)/allocator/tlsf.ts:460:24 + ;;@ (lib)/allocator/tlsf.ts:461:24 (current_memory) ) - ;;@ (lib)/allocator/tlsf.ts:461:6 + ;;@ (lib)/allocator/tlsf.ts:462:6 (set_local $10 - ;;@ (lib)/allocator/tlsf.ts:461:24 + ;;@ (lib)/allocator/tlsf.ts:462:24 (select (tee_local $6 - ;;@ (lib)/allocator/tlsf.ts:461:28 + ;;@ (lib)/allocator/tlsf.ts:462:28 (get_local $9) ) (tee_local $7 - ;;@ (lib)/allocator/tlsf.ts:461:41 + ;;@ (lib)/allocator/tlsf.ts:462:41 (i32.shr_u (i32.and - ;;@ (lib)/allocator/tlsf.ts:461:42 + ;;@ (lib)/allocator/tlsf.ts:462:42 (i32.add - ;;@ (lib)/allocator/tlsf.ts:461:43 + ;;@ (lib)/allocator/tlsf.ts:462:43 (get_local $0) - ;;@ (lib)/allocator/tlsf.ts:461:50 + ;;@ (lib)/allocator/tlsf.ts:462:50 (i32.const 65535) ) - ;;@ (lib)/allocator/tlsf.ts:461:60 + ;;@ (lib)/allocator/tlsf.ts:462:60 (i32.xor - ;;@ (lib)/allocator/tlsf.ts:461:61 + ;;@ (lib)/allocator/tlsf.ts:462:61 (i32.const 65535) (i32.const -1) ) ) - ;;@ (lib)/allocator/tlsf.ts:461:73 + ;;@ (lib)/allocator/tlsf.ts:462:73 (i32.const 16) ) ) @@ -2525,55 +2526,55 @@ ) ) ) - ;;@ (lib)/allocator/tlsf.ts:462:6 + ;;@ (lib)/allocator/tlsf.ts:463:6 (if - ;;@ (lib)/allocator/tlsf.ts:462:10 + ;;@ (lib)/allocator/tlsf.ts:463:10 (i32.lt_s (grow_memory - ;;@ (lib)/allocator/tlsf.ts:462:22 + ;;@ (lib)/allocator/tlsf.ts:463:22 (get_local $10) ) - ;;@ (lib)/allocator/tlsf.ts:462:37 + ;;@ (lib)/allocator/tlsf.ts:463:37 (i32.const 0) ) - ;;@ (lib)/allocator/tlsf.ts:463:8 + ;;@ (lib)/allocator/tlsf.ts:464:8 (unreachable) ) - ;;@ (lib)/allocator/tlsf.ts:464:6 + ;;@ (lib)/allocator/tlsf.ts:465:6 (set_local $11 - ;;@ (lib)/allocator/tlsf.ts:464:23 + ;;@ (lib)/allocator/tlsf.ts:465:23 (current_memory) ) - ;;@ (lib)/allocator/tlsf.ts:465:11 + ;;@ (lib)/allocator/tlsf.ts:466:11 (drop (call "$(lib)/allocator/tlsf/Root#addMemory" - ;;@ (lib)/allocator/tlsf.ts:465:6 + ;;@ (lib)/allocator/tlsf.ts:466:6 (get_local $1) - ;;@ (lib)/allocator/tlsf.ts:465:21 + ;;@ (lib)/allocator/tlsf.ts:466:21 (i32.shl (get_local $9) - ;;@ (lib)/allocator/tlsf.ts:465:43 + ;;@ (lib)/allocator/tlsf.ts:466:43 (i32.const 16) ) - ;;@ (lib)/allocator/tlsf.ts:465:47 + ;;@ (lib)/allocator/tlsf.ts:466:47 (i32.shl (get_local $11) - ;;@ (lib)/allocator/tlsf.ts:465:68 + ;;@ (lib)/allocator/tlsf.ts:466:68 (i32.const 16) ) ) ) - ;;@ (lib)/allocator/tlsf.ts:466:6 + ;;@ (lib)/allocator/tlsf.ts:467:6 (set_local $8 - ;;@ (lib)/allocator/tlsf.ts:466:14 + ;;@ (lib)/allocator/tlsf.ts:467:14 (if (result i32) (i32.eqz (tee_local $6 - ;;@ (lib)/allocator/tlsf.ts:466:26 + ;;@ (lib)/allocator/tlsf.ts:467:26 (call "$(lib)/allocator/tlsf/Root#search" - ;;@ (lib)/allocator/tlsf.ts:466:21 + ;;@ (lib)/allocator/tlsf.ts:467:21 (get_local $1) - ;;@ (lib)/allocator/tlsf.ts:466:33 + ;;@ (lib)/allocator/tlsf.ts:467:33 (get_local $0) ) ) @@ -2582,7 +2583,7 @@ (call $abort (i32.const 0) (i32.const 4) - (i32.const 466) + (i32.const 467) (i32.const 14) ) (unreachable) @@ -2592,24 +2593,24 @@ ) ) ) - ;;@ (lib)/allocator/tlsf.ts:469:4 + ;;@ (lib)/allocator/tlsf.ts:470:4 (if (i32.eqz - ;;@ (lib)/allocator/tlsf.ts:469:11 + ;;@ (lib)/allocator/tlsf.ts:470:11 (i32.ge_u (i32.and - ;;@ (lib)/allocator/tlsf.ts:469:12 + ;;@ (lib)/allocator/tlsf.ts:470:12 (i32.load (get_local $8) ) - ;;@ (lib)/allocator/tlsf.ts:469:25 + ;;@ (lib)/allocator/tlsf.ts:470:25 (i32.xor - ;;@ (lib)/allocator/tlsf.ts:469:26 + ;;@ (lib)/allocator/tlsf.ts:470:26 (i32.const 3) (i32.const -1) ) ) - ;;@ (lib)/allocator/tlsf.ts:469:35 + ;;@ (lib)/allocator/tlsf.ts:470:35 (get_local $0) ) ) @@ -2617,27 +2618,27 @@ (call $abort (i32.const 0) (i32.const 4) - (i32.const 469) + (i32.const 470) (i32.const 4) ) (unreachable) ) ) - ;;@ (lib)/allocator/tlsf.ts:470:4 + ;;@ (lib)/allocator/tlsf.ts:471:4 (set_local $5 - ;;@ (lib)/allocator/tlsf.ts:470:16 + ;;@ (lib)/allocator/tlsf.ts:471:16 (call "$(lib)/allocator/tlsf/Root#use" - ;;@ (lib)/allocator/tlsf.ts:470:11 + ;;@ (lib)/allocator/tlsf.ts:471:11 (get_local $1) - ;;@ (lib)/allocator/tlsf.ts:470:20 + ;;@ (lib)/allocator/tlsf.ts:471:20 (get_local $8) - ;;@ (lib)/allocator/tlsf.ts:470:27 + ;;@ (lib)/allocator/tlsf.ts:471:27 (get_local $0) ) ) ) ) - ;;@ (lib)/allocator/tlsf.ts:473:9 + ;;@ (lib)/allocator/tlsf.ts:474:9 (return (get_local $5) ) @@ -2646,50 +2647,50 @@ (local $1 i32) (local $2 i32) (local $3 i32) - ;;@ (lib)/allocator/tlsf.ts:478:2 + ;;@ (lib)/allocator/tlsf.ts:480:2 (if - ;;@ (lib)/allocator/tlsf.ts:478:6 + ;;@ (lib)/allocator/tlsf.ts:480:6 (get_local $0) - ;;@ (lib)/allocator/tlsf.ts:478:12 + ;;@ (lib)/allocator/tlsf.ts:480:12 (block - ;;@ (lib)/allocator/tlsf.ts:479:4 + ;;@ (lib)/allocator/tlsf.ts:481:4 (set_local $1 - ;;@ (lib)/allocator/tlsf.ts:479:15 + ;;@ (lib)/allocator/tlsf.ts:481:15 (get_global "$(lib)/allocator/tlsf/ROOT") ) - ;;@ (lib)/allocator/tlsf.ts:480:4 + ;;@ (lib)/allocator/tlsf.ts:482:4 (if - ;;@ (lib)/allocator/tlsf.ts:480:8 + ;;@ (lib)/allocator/tlsf.ts:482:8 (get_local $1) - ;;@ (lib)/allocator/tlsf.ts:480:14 + ;;@ (lib)/allocator/tlsf.ts:482:14 (block - ;;@ (lib)/allocator/tlsf.ts:481:6 + ;;@ (lib)/allocator/tlsf.ts:483:6 (set_local $2 - ;;@ (lib)/allocator/tlsf.ts:481:18 + ;;@ (lib)/allocator/tlsf.ts:483:18 (i32.sub - ;;@ (lib)/allocator/tlsf.ts:481:36 + ;;@ (lib)/allocator/tlsf.ts:483:36 (get_local $0) - ;;@ (lib)/allocator/tlsf.ts:481:43 + ;;@ (lib)/allocator/tlsf.ts:483:43 (i32.const 4) ) ) - ;;@ (lib)/allocator/tlsf.ts:482:6 + ;;@ (lib)/allocator/tlsf.ts:484:6 (set_local $3 - ;;@ (lib)/allocator/tlsf.ts:482:22 + ;;@ (lib)/allocator/tlsf.ts:484:22 (i32.load (get_local $2) ) ) - ;;@ (lib)/allocator/tlsf.ts:483:6 + ;;@ (lib)/allocator/tlsf.ts:485:6 (if (i32.eqz - ;;@ (lib)/allocator/tlsf.ts:483:13 + ;;@ (lib)/allocator/tlsf.ts:485:13 (i32.eqz - ;;@ (lib)/allocator/tlsf.ts:483:14 + ;;@ (lib)/allocator/tlsf.ts:485:14 (i32.and - ;;@ (lib)/allocator/tlsf.ts:483:15 + ;;@ (lib)/allocator/tlsf.ts:485:15 (get_local $3) - ;;@ (lib)/allocator/tlsf.ts:483:27 + ;;@ (lib)/allocator/tlsf.ts:485:27 (i32.const 1) ) ) @@ -2698,31 +2699,31 @@ (call $abort (i32.const 0) (i32.const 4) - (i32.const 483) + (i32.const 485) (i32.const 6) ) (unreachable) ) ) - ;;@ (lib)/allocator/tlsf.ts:484:6 + ;;@ (lib)/allocator/tlsf.ts:486:6 (i32.store (get_local $2) - ;;@ (lib)/allocator/tlsf.ts:484:19 + ;;@ (lib)/allocator/tlsf.ts:486:19 (i32.or (get_local $3) - ;;@ (lib)/allocator/tlsf.ts:484:31 + ;;@ (lib)/allocator/tlsf.ts:486:31 (i32.const 1) ) ) - ;;@ (lib)/allocator/tlsf.ts:485:11 + ;;@ (lib)/allocator/tlsf.ts:487:11 (call "$(lib)/allocator/tlsf/Root#insert" - ;;@ (lib)/allocator/tlsf.ts:485:6 + ;;@ (lib)/allocator/tlsf.ts:487:6 (get_local $1) - ;;@ (lib)/allocator/tlsf.ts:485:18 + ;;@ (lib)/allocator/tlsf.ts:487:18 (i32.sub - ;;@ (lib)/allocator/tlsf.ts:485:36 + ;;@ (lib)/allocator/tlsf.ts:487:36 (get_local $0) - ;;@ (lib)/allocator/tlsf.ts:485:43 + ;;@ (lib)/allocator/tlsf.ts:487:43 (i32.const 4) ) ) @@ -2731,7 +2732,527 @@ ) ) ) - (func $start (; 20 ;) (type $v) + (func "$(lib)/memory/set_memory" (; 20 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i64) + ;;@ (lib)/memory.ts:196:2 + (if + ;;@ (lib)/memory.ts:196:6 + (i32.eqz + ;;@ (lib)/memory.ts:196:7 + (get_local $2) + ) + ;;@ (lib)/memory.ts:197:4 + (return) + ) + ;;@ (lib)/memory.ts:198:2 + (i32.store8 + ;;@ (lib)/memory.ts:198:12 + (get_local $0) + ;;@ (lib)/memory.ts:198:18 + (get_local $1) + ) + ;;@ (lib)/memory.ts:199:2 + (i32.store8 + ;;@ (lib)/memory.ts:199:12 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:199:19 + (get_local $2) + ) + ;;@ (lib)/memory.ts:199:23 + (i32.const 1) + ) + ;;@ (lib)/memory.ts:199:26 + (get_local $1) + ) + ;;@ (lib)/memory.ts:200:2 + (if + ;;@ (lib)/memory.ts:200:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:200:11 + (i32.const 2) + ) + ;;@ (lib)/memory.ts:201:4 + (return) + ) + ;;@ (lib)/memory.ts:203:2 + (i32.store8 + ;;@ (lib)/memory.ts:203:12 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:203:19 + (i32.const 1) + ) + ;;@ (lib)/memory.ts:203:22 + (get_local $1) + ) + ;;@ (lib)/memory.ts:204:2 + (i32.store8 + ;;@ (lib)/memory.ts:204:12 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:204:19 + (i32.const 2) + ) + ;;@ (lib)/memory.ts:204:22 + (get_local $1) + ) + ;;@ (lib)/memory.ts:205:2 + (i32.store8 + ;;@ (lib)/memory.ts:205:12 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:205:19 + (get_local $2) + ) + ;;@ (lib)/memory.ts:205:23 + (i32.const 2) + ) + ;;@ (lib)/memory.ts:205:26 + (get_local $1) + ) + ;;@ (lib)/memory.ts:206:2 + (i32.store8 + ;;@ (lib)/memory.ts:206:12 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:206:19 + (get_local $2) + ) + ;;@ (lib)/memory.ts:206:23 + (i32.const 3) + ) + ;;@ (lib)/memory.ts:206:26 + (get_local $1) + ) + ;;@ (lib)/memory.ts:207:2 + (if + ;;@ (lib)/memory.ts:207:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:207:11 + (i32.const 6) + ) + ;;@ (lib)/memory.ts:208:4 + (return) + ) + ;;@ (lib)/memory.ts:209:2 + (i32.store8 + ;;@ (lib)/memory.ts:209:12 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:209:19 + (i32.const 3) + ) + ;;@ (lib)/memory.ts:209:22 + (get_local $1) + ) + ;;@ (lib)/memory.ts:210:2 + (i32.store8 + ;;@ (lib)/memory.ts:210:12 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:210:19 + (get_local $2) + ) + ;;@ (lib)/memory.ts:210:23 + (i32.const 4) + ) + ;;@ (lib)/memory.ts:210:26 + (get_local $1) + ) + ;;@ (lib)/memory.ts:211:2 + (if + ;;@ (lib)/memory.ts:211:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:211:11 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:212:4 + (return) + ) + ;;@ (lib)/memory.ts:215:2 + (set_local $3 + ;;@ (lib)/memory.ts:215:17 + (i32.and + (i32.sub + (i32.const 0) + ;;@ (lib)/memory.ts:215:18 + (get_local $0) + ) + ;;@ (lib)/memory.ts:215:25 + (i32.const 3) + ) + ) + ;;@ (lib)/memory.ts:216:2 + (set_local $0 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:216:10 + (get_local $3) + ) + ) + ;;@ (lib)/memory.ts:217:2 + (set_local $2 + (i32.sub + (get_local $2) + ;;@ (lib)/memory.ts:217:7 + (get_local $3) + ) + ) + ;;@ (lib)/memory.ts:218:2 + (set_local $2 + (i32.and + (get_local $2) + ;;@ (lib)/memory.ts:218:7 + (i32.const -4) + ) + ) + ;;@ (lib)/memory.ts:220:2 + (set_local $4 + ;;@ (lib)/memory.ts:220:17 + (i32.mul + (i32.div_u + (i32.const -1) + ;;@ (lib)/memory.ts:220:27 + (i32.const 255) + ) + ;;@ (lib)/memory.ts:220:33 + (get_local $1) + ) + ) + ;;@ (lib)/memory.ts:223:2 + (i32.store + ;;@ (lib)/memory.ts:223:13 + (get_local $0) + ;;@ (lib)/memory.ts:223:19 + (get_local $4) + ) + ;;@ (lib)/memory.ts:224:2 + (i32.store + ;;@ (lib)/memory.ts:224:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:224:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:224:24 + (i32.const 4) + ) + ;;@ (lib)/memory.ts:224:27 + (get_local $4) + ) + ;;@ (lib)/memory.ts:225:2 + (if + ;;@ (lib)/memory.ts:225:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:225:11 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:226:4 + (return) + ) + ;;@ (lib)/memory.ts:227:2 + (i32.store + ;;@ (lib)/memory.ts:227:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:227:20 + (i32.const 4) + ) + ;;@ (lib)/memory.ts:227:23 + (get_local $4) + ) + ;;@ (lib)/memory.ts:228:2 + (i32.store + ;;@ (lib)/memory.ts:228:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:228:20 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:228:23 + (get_local $4) + ) + ;;@ (lib)/memory.ts:229:2 + (i32.store + ;;@ (lib)/memory.ts:229:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:229:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:229:24 + (i32.const 12) + ) + ;;@ (lib)/memory.ts:229:28 + (get_local $4) + ) + ;;@ (lib)/memory.ts:230:2 + (i32.store + ;;@ (lib)/memory.ts:230:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:230:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:230:24 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:230:27 + (get_local $4) + ) + ;;@ (lib)/memory.ts:231:2 + (if + ;;@ (lib)/memory.ts:231:6 + (i32.le_u + (get_local $2) + ;;@ (lib)/memory.ts:231:11 + (i32.const 24) + ) + ;;@ (lib)/memory.ts:232:4 + (return) + ) + ;;@ (lib)/memory.ts:233:2 + (i32.store + ;;@ (lib)/memory.ts:233:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:233:20 + (i32.const 12) + ) + ;;@ (lib)/memory.ts:233:24 + (get_local $4) + ) + ;;@ (lib)/memory.ts:234:2 + (i32.store + ;;@ (lib)/memory.ts:234:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:234:20 + (i32.const 16) + ) + ;;@ (lib)/memory.ts:234:24 + (get_local $4) + ) + ;;@ (lib)/memory.ts:235:2 + (i32.store + ;;@ (lib)/memory.ts:235:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:235:20 + (i32.const 20) + ) + ;;@ (lib)/memory.ts:235:24 + (get_local $4) + ) + ;;@ (lib)/memory.ts:236:2 + (i32.store + ;;@ (lib)/memory.ts:236:13 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:236:20 + (i32.const 24) + ) + ;;@ (lib)/memory.ts:236:24 + (get_local $4) + ) + ;;@ (lib)/memory.ts:237:2 + (i32.store + ;;@ (lib)/memory.ts:237:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:237:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:237:24 + (i32.const 28) + ) + ;;@ (lib)/memory.ts:237:28 + (get_local $4) + ) + ;;@ (lib)/memory.ts:238:2 + (i32.store + ;;@ (lib)/memory.ts:238:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:238:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:238:24 + (i32.const 24) + ) + ;;@ (lib)/memory.ts:238:28 + (get_local $4) + ) + ;;@ (lib)/memory.ts:239:2 + (i32.store + ;;@ (lib)/memory.ts:239:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:239:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:239:24 + (i32.const 20) + ) + ;;@ (lib)/memory.ts:239:28 + (get_local $4) + ) + ;;@ (lib)/memory.ts:240:2 + (i32.store + ;;@ (lib)/memory.ts:240:13 + (i32.sub + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:240:20 + (get_local $2) + ) + ;;@ (lib)/memory.ts:240:24 + (i32.const 16) + ) + ;;@ (lib)/memory.ts:240:28 + (get_local $4) + ) + ;;@ (lib)/memory.ts:243:2 + (set_local $3 + ;;@ (lib)/memory.ts:243:6 + (i32.add + (i32.const 24) + ;;@ (lib)/memory.ts:243:11 + (i32.and + ;;@ (lib)/memory.ts:243:12 + (get_local $0) + ;;@ (lib)/memory.ts:243:19 + (i32.const 4) + ) + ) + ) + ;;@ (lib)/memory.ts:244:2 + (set_local $0 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:244:10 + (get_local $3) + ) + ) + ;;@ (lib)/memory.ts:245:2 + (set_local $2 + (i32.sub + (get_local $2) + ;;@ (lib)/memory.ts:245:7 + (get_local $3) + ) + ) + ;;@ (lib)/memory.ts:248:2 + (set_local $5 + ;;@ (lib)/memory.ts:248:17 + (i64.or + (i64.extend_u/i32 + (get_local $4) + ) + ;;@ (lib)/memory.ts:248:28 + (i64.shl + ;;@ (lib)/memory.ts:248:29 + (i64.extend_u/i32 + (get_local $4) + ) + ;;@ (lib)/memory.ts:248:41 + (i64.const 32) + ) + ) + ) + ;;@ (lib)/memory.ts:249:2 + (block $break|0 + (loop $continue|0 + (if + ;;@ (lib)/memory.ts:249:9 + (i32.ge_u + (get_local $2) + ;;@ (lib)/memory.ts:249:14 + (i32.const 32) + ) + (block + (block + ;;@ (lib)/memory.ts:250:4 + (i64.store + ;;@ (lib)/memory.ts:250:15 + (get_local $0) + ;;@ (lib)/memory.ts:250:21 + (get_local $5) + ) + ;;@ (lib)/memory.ts:251:4 + (i64.store + ;;@ (lib)/memory.ts:251:15 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:251:22 + (i32.const 8) + ) + ;;@ (lib)/memory.ts:251:25 + (get_local $5) + ) + ;;@ (lib)/memory.ts:252:4 + (i64.store + ;;@ (lib)/memory.ts:252:15 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:252:22 + (i32.const 16) + ) + ;;@ (lib)/memory.ts:252:26 + (get_local $5) + ) + ;;@ (lib)/memory.ts:253:4 + (i64.store + ;;@ (lib)/memory.ts:253:15 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:253:22 + (i32.const 24) + ) + ;;@ (lib)/memory.ts:253:26 + (get_local $5) + ) + ;;@ (lib)/memory.ts:254:4 + (set_local $2 + (i32.sub + (get_local $2) + ;;@ (lib)/memory.ts:254:9 + (i32.const 32) + ) + ) + ;;@ (lib)/memory.ts:255:4 + (set_local $0 + (i32.add + (get_local $0) + ;;@ (lib)/memory.ts:255:12 + (i32.const 32) + ) + ) + ) + (br $continue|0) + ) + ) + ) + ) + ) + (func $start (; 21 ;) (type $v) ;;@ (lib)/allocator/tlsf.ts:50:0 (if (i32.eqz