-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
349 changed files
with
26,753 additions
and
51,394 deletions.
There are no files selected for viewing
276 changes: 27 additions & 249 deletions
276
compiler/test/__snapshots__/arrays.0f9e7d37.0.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,250 +1,28 @@ | ||
arrays › array_access | ||
(module | ||
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) | ||
(type $none_=>_i32 (func (result i32))) | ||
(type $none_=>_none (func)) | ||
(import \"_genv\" \"tbl\" (table $tbl 0 funcref)) | ||
(import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) | ||
(import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) | ||
(import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) | ||
(import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) | ||
(import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) | ||
(import \"GRAIN$MODULE$runtime/exception.gr\" \"GRAIN$EXPORT$panicWithException\" (global $GRAIN$EXPORT$panicWithException_0 (mut i32))) | ||
(import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) | ||
(import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) | ||
(import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) | ||
(import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) | ||
(import \"GRAIN$MODULE$runtime/exception.gr\" \"panicWithException\" (func $panicWithException_0 (param i32 i32) (result i32))) | ||
(global $x_1113 (mut i32) (i32.const 0)) | ||
(global $GRAIN$TABLE_SIZE i32 (i32.const 0)) | ||
(memory $0 0) | ||
(elem $elem (global.get $relocBase_0)) | ||
(export \"memory\" (memory $0)) | ||
(export \"_gmain\" (func $_gmain)) | ||
(export \"_start\" (func $_start)) | ||
(export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) | ||
(func $_gmain (result i32) | ||
(local $0 i32) | ||
(local $1 i32) | ||
(local $2 i32) | ||
(local $3 i64) | ||
(local $4 f32) | ||
(local $5 f64) | ||
(block $compile_block.10 (result i32) | ||
(block $compile_store.3 | ||
(global.set $x_1113 | ||
(block $allocate_array.1 (result i32) | ||
(i32.store | ||
(local.tee $0 | ||
(call $malloc_0 | ||
(global.get $GRAIN$EXPORT$malloc_0) | ||
(i32.const 20) | ||
) | ||
) | ||
(i32.const 4) | ||
) | ||
(i32.store offset=4 | ||
(local.get $0) | ||
(i32.const 3) | ||
) | ||
(i32.store offset=8 | ||
(local.get $0) | ||
(i32.const 3) | ||
) | ||
(i32.store offset=12 | ||
(local.get $0) | ||
(i32.const 5) | ||
) | ||
(i32.store offset=16 | ||
(local.get $0) | ||
(i32.const 7) | ||
) | ||
(local.get $0) | ||
) | ||
) | ||
(block $do_backpatches.2 | ||
) | ||
) | ||
(block $MArrayGet.9 (result i32) | ||
(local.set $1 | ||
(i32.const 1) | ||
) | ||
(local.set $2 | ||
(global.get $x_1113) | ||
) | ||
(block $resolve_idx.8 | ||
(if | ||
(i32.eqz | ||
(i32.and | ||
(local.get $1) | ||
(i32.const 1) | ||
) | ||
) | ||
(block $IndexNotSimpleInteger.7 | ||
(local.set $1 | ||
(i32.load offset=4 | ||
(local.get $1) | ||
) | ||
) | ||
(drop | ||
(if (result i32) | ||
(i32.or | ||
(i32.eq | ||
(local.get $1) | ||
(i32.const 2) | ||
) | ||
(i32.eq | ||
(local.get $1) | ||
(i32.const 4) | ||
) | ||
) | ||
(call $panicWithException_0 | ||
(global.get $GRAIN$EXPORT$panicWithException_0) | ||
(block $allocate_adt.6 (result i32) | ||
(i32.store | ||
(local.tee $0 | ||
(call $malloc_0 | ||
(global.get $GRAIN$EXPORT$malloc_0) | ||
(i32.const 20) | ||
) | ||
) | ||
(i32.const 2) | ||
) | ||
(i32.store offset=4 | ||
(local.get $0) | ||
(i32.const 1) | ||
) | ||
(i32.store offset=8 | ||
(local.get $0) | ||
(i32.const 5) | ||
) | ||
(i32.store offset=12 | ||
(local.get $0) | ||
(i32.const 67) | ||
) | ||
(i32.store offset=16 | ||
(local.get $0) | ||
(i32.const 0) | ||
) | ||
(local.get $0) | ||
) | ||
) | ||
(call $panicWithException_0 | ||
(global.get $GRAIN$EXPORT$panicWithException_0) | ||
(block $allocate_adt.5 (result i32) | ||
(i32.store | ||
(local.tee $0 | ||
(call $malloc_0 | ||
(global.get $GRAIN$EXPORT$malloc_0) | ||
(i32.const 20) | ||
) | ||
) | ||
(i32.const 2) | ||
) | ||
(i32.store offset=4 | ||
(local.get $0) | ||
(i32.const 1) | ||
) | ||
(i32.store offset=8 | ||
(local.get $0) | ||
(i32.const 5) | ||
) | ||
(i32.store offset=12 | ||
(local.get $0) | ||
(i32.const 69) | ||
) | ||
(i32.store offset=16 | ||
(local.get $0) | ||
(i32.const 0) | ||
) | ||
(local.get $0) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
(local.set $1 | ||
(i32.shr_s | ||
(local.get $1) | ||
(i32.const 1) | ||
) | ||
) | ||
(if | ||
(i32.lt_s | ||
(local.get $1) | ||
(i32.const 0) | ||
) | ||
(local.set $1 | ||
(i32.add | ||
(local.get $1) | ||
(i32.load offset=4 | ||
(local.get $2) | ||
) | ||
) | ||
) | ||
) | ||
(if | ||
(i32.le_u | ||
(i32.load offset=4 | ||
(local.get $2) | ||
) | ||
(local.get $1) | ||
) | ||
(drop | ||
(call $panicWithException_0 | ||
(global.get $GRAIN$EXPORT$panicWithException_0) | ||
(block $allocate_adt.4 (result i32) | ||
(i32.store | ||
(local.tee $0 | ||
(call $malloc_0 | ||
(global.get $GRAIN$EXPORT$malloc_0) | ||
(i32.const 20) | ||
) | ||
) | ||
(i32.const 2) | ||
) | ||
(i32.store offset=4 | ||
(local.get $0) | ||
(i32.const 1) | ||
) | ||
(i32.store offset=8 | ||
(local.get $0) | ||
(i32.const 5) | ||
) | ||
(i32.store offset=12 | ||
(local.get $0) | ||
(i32.const 67) | ||
) | ||
(i32.store offset=16 | ||
(local.get $0) | ||
(i32.const 0) | ||
) | ||
(local.get $0) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
(call $incRef_0 | ||
(global.get $GRAIN$EXPORT$incRef_0) | ||
(i32.load offset=8 | ||
(i32.add | ||
(i32.shl | ||
(local.get $1) | ||
(i32.const 2) | ||
) | ||
(local.get $2) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
(func $_start | ||
(drop | ||
(call $_gmain) | ||
) | ||
) | ||
;; custom section \"cmi\", size 368 | ||
) | ||
((functions ()) (imports ()) (exports ()) | ||
(main_body | ||
(((instr_desc | ||
(MStore | ||
(((MGlobalBind x_1113 Managed) | ||
((instr_desc | ||
(MAllocate | ||
(MArray | ||
(((immediate_desc (MImmConst (MConstI32 1))) | ||
(immediate_analyses ((last_usage Unknown)))) | ||
((immediate_desc (MImmConst (MConstI32 2))) | ||
(immediate_analyses ((last_usage Unknown)))) | ||
((immediate_desc (MImmConst (MConstI32 3))) | ||
(immediate_analyses ((last_usage Unknown)))))))))))))) | ||
((instr_desc | ||
(MArrayOp | ||
(MArrayGet | ||
((immediate_desc (MImmConst (MConstI32 0))) | ||
(immediate_analyses ((last_usage Unknown))))) | ||
((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) | ||
(immediate_analyses ((last_usage Last))))))))) | ||
(main_body_stack_size | ||
((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) | ||
(stack_size_f32 0) (stack_size_f64 0))) | ||
(globals ((((name x)) true Managed ()))) (function_table_elements ()) | ||
(global_function_table_offset ((name function_table_global))) | ||
(compilation_mode Normal) (signature <opaque>) (type_metadata <opaque>)) |
Oops, something went wrong.