-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(compiler): Provide named function export for recursive functions (#…
…843)
- Loading branch information
Showing
3 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
exports › let_rec_export | ||
(module | ||
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) | ||
(type $none_=>_none (func)) | ||
(type $none_=>_i32 (func (result i32))) | ||
(type $i32_=>_i32 (func (param i32) (result i32))) | ||
(import \"_grainEnv\" \"mem\" (memory $0 0)) | ||
(import \"_grainEnv\" \"tbl\" (table $tbl 0 funcref)) | ||
(elem $elem (global.get $import__grainEnv_0_relocBase_0) $foo_1145) | ||
(import \"_grainEnv\" \"relocBase\" (global $import__grainEnv_0_relocBase_0 i32)) | ||
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$malloc\" (global $import_GRAIN$MODULE$runtime/gc_0_GRAIN$EXPORT$malloc_0 (mut i32))) | ||
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$decRefIgnoreZeros\" (global $import_GRAIN$MODULE$runtime/gc_0_GRAIN$EXPORT$decRefIgnoreZeros_0 (mut i32))) | ||
(import \"GRAIN$MODULE$runtime/gc\" \"malloc\" (func $import_GRAIN$MODULE$runtime/gc_0_malloc_0 (param i32 i32) (result i32))) | ||
(import \"GRAIN$MODULE$runtime/gc\" \"decRefIgnoreZeros\" (func $import_GRAIN$MODULE$runtime/gc_0_decRefIgnoreZeros_0 (param i32 i32) (result i32))) | ||
(global $global_0 (mut i32) (i32.const 0)) | ||
(global $global_2 i32 (i32.const 1)) | ||
(export \"memory\" (memory $0)) | ||
(export \"GRAIN$EXPORT$foo\" (global $global_0)) | ||
(export \"foo\" (func $foo_1145)) | ||
(export \"_gmain\" (func $_gmain)) | ||
(export \"_start\" (func $_start)) | ||
(export \"GRAIN$TABLE_SIZE\" (global $global_2)) | ||
(func $foo_1145 (; has Stack IR ;) (param $0 i32) (result i32) | ||
(i32.const 11) | ||
) | ||
(func $_gmain (; has Stack IR ;) (result i32) | ||
(local $0 i32) | ||
(tuple.extract 0 | ||
(tuple.make | ||
(block (result i32) | ||
(global.set $global_0 | ||
(tuple.extract 0 | ||
(tuple.make | ||
(block (result i32) | ||
(i32.store | ||
(local.tee $0 | ||
(tuple.extract 0 | ||
(tuple.make | ||
(call $import_GRAIN$MODULE$runtime/gc_0_malloc_0 | ||
(global.get $import_GRAIN$MODULE$runtime/gc_0_GRAIN$EXPORT$malloc_0) | ||
(i32.const 16) | ||
) | ||
(i32.const 0) | ||
) | ||
) | ||
) | ||
(i32.const 7) | ||
) | ||
(i32.store offset=4 | ||
(local.get $0) | ||
(i32.const 1) | ||
) | ||
(i32.store offset=8 | ||
(local.get $0) | ||
(global.get $import__grainEnv_0_relocBase_0) | ||
) | ||
(i32.store offset=12 | ||
(local.get $0) | ||
(i32.const 0) | ||
) | ||
(local.get $0) | ||
) | ||
(call $import_GRAIN$MODULE$runtime/gc_0_decRefIgnoreZeros_0 | ||
(global.get $import_GRAIN$MODULE$runtime/gc_0_GRAIN$EXPORT$decRefIgnoreZeros_0) | ||
(global.get $global_0) | ||
) | ||
) | ||
) | ||
) | ||
(i32.const 1879048190) | ||
) | ||
(tuple.extract 0 | ||
(tuple.make | ||
(global.get $global_0) | ||
(local.get $0) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
(func $_start (; has Stack IR ;) | ||
(drop | ||
(call $_gmain) | ||
) | ||
) | ||
;; custom section \"cmi\", size 607 | ||
) |
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