-
-
Notifications
You must be signed in to change notification settings - Fork 667
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support lazy global and function exports (#1371)
- Loading branch information
Showing
6 changed files
with
63 additions
and
11 deletions.
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
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,5 @@ | ||
{ | ||
"asc_flags": [ | ||
"--runtime none" | ||
] | ||
} |
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,13 @@ | ||
(module | ||
(type $none_=>_none (func)) | ||
(memory $0 1) | ||
(data (i32.const 1024) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03") | ||
(data (i32.const 1056) "\10\00\00\00\01\00\00\00\03\00\00\00\10\00\00\00\10\04\00\00\10\04\00\00\0c\00\00\00\03") | ||
(global $exports-lazy/lazyGlobalUsed i32 (i32.const 1072)) | ||
(export "memory" (memory $0)) | ||
(export "lazyGlobalUsed" (global $exports-lazy/lazyGlobalUsed)) | ||
(export "lazyFuncUsed" (func $~start)) | ||
(func $~start | ||
nop | ||
) | ||
) |
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,9 @@ | ||
@lazy export const lazyGlobalUnused: i32[] = [1,2,3]; | ||
|
||
@lazy export const lazyGlobalUsed: i32[] = [1,2,3]; | ||
lazyGlobalUsed; | ||
|
||
@lazy export function lazyFuncUnused(): void {} | ||
|
||
@lazy export function lazyFuncUsed(): void {} | ||
lazyFuncUsed(); |
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,25 @@ | ||
(module | ||
(type $none_=>_none (func)) | ||
(memory $0 1) | ||
(data (i32.const 16) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") | ||
(data (i32.const 48) "\10\00\00\00\01\00\00\00\03\00\00\00\10\00\00\00 \00\00\00 \00\00\00\0c\00\00\00\03\00\00\00") | ||
(table $0 1 funcref) | ||
(global $exports-lazy/lazyGlobalUsed i32 (i32.const 64)) | ||
(export "memory" (memory $0)) | ||
(export "lazyGlobalUsed" (global $exports-lazy/lazyGlobalUsed)) | ||
(export "lazyFuncUsed" (func $exports-lazy/lazyFuncUsed)) | ||
(start $~start) | ||
(func $start:exports-lazy | ||
(local $0 i32) | ||
(local $1 i32) | ||
global.get $exports-lazy/lazyGlobalUsed | ||
drop | ||
call $exports-lazy/lazyFuncUsed | ||
) | ||
(func $~start | ||
call $start:exports-lazy | ||
) | ||
(func $exports-lazy/lazyFuncUsed | ||
nop | ||
) | ||
) |