-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert debug intrinsics into annotations, and print them
ignore --debuginfo if not emitting text, as wasm binaries don't support that yet
- Loading branch information
Showing
13 changed files
with
404 additions
and
8 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
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
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,26 @@ | ||
function () { | ||
"use asm"; | ||
function add(x, y) { | ||
x = x | 0; | ||
y = y | 0; | ||
x = x; //@line 5 "tests/hello_world.c" | ||
y = y; //@line 6 "tests/hello_world.c" | ||
x = y; //@line 314159 "tests/other_file.cpp" | ||
return x + y | 0; | ||
} | ||
function ret(x) { | ||
x = x | 0; | ||
x = x << 1; //@line 50 "return.cpp" | ||
return x + 1 | 0; //@line 100 "return.cpp" | ||
} | ||
function opts(x, y) { | ||
x = x | 0; | ||
y = y | 0; | ||
x = (x + y) | 0; //@line 1 "even-opted.cpp" | ||
y = y >> x; //@line 2 "even-opted.cpp" | ||
x = (x | 0) % (y | 0); //@line 3 "even-opted.cpp" | ||
return x + y | 0; | ||
} | ||
return { add: add, ret: ret, opts: opts }; | ||
} | ||
|
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,54 @@ | ||
(module | ||
(type $FUNCSIG$iii (func (param i32 i32) (result i32))) | ||
(type $FUNCSIG$vii (func (param i32 i32))) | ||
(import "env" "emscripten_debuginfo" (func $emscripten_debuginfo (param i32 i32))) | ||
(import "asm2wasm" "i32s-rem" (func $i32s-rem (param i32 i32) (result i32))) | ||
(import "env" "memory" (memory $0 256 256)) | ||
(import "env" "table" (table 0 0 anyfunc)) | ||
(import "env" "memoryBase" (global $memoryBase i32)) | ||
(import "env" "tableBase" (global $tableBase i32)) | ||
(data (get_global $memoryBase) "debugInfo.asm.js") | ||
(export "add" (func $add)) | ||
(export "ret" (func $ret)) | ||
(export "opts" (func $opts)) | ||
(func $add (param $0 i32) (param $1 i32) (result i32) | ||
(i32.add | ||
(get_local $1) | ||
(get_local $1) | ||
) | ||
) | ||
(func $ret (param $0 i32) (result i32) | ||
(i32.add | ||
(i32.shl | ||
(get_local $0) | ||
(i32.const 1) | ||
) | ||
(i32.const 1) | ||
) | ||
) | ||
(func $opts (param $0 i32) (param $1 i32) (result i32) | ||
;; even-opted.cpp:2 | ||
(set_local $1 | ||
(i32.shr_s | ||
(get_local $1) | ||
(tee_local $0 | ||
(i32.add | ||
(get_local $0) | ||
(get_local $1) | ||
) | ||
) | ||
) | ||
) | ||
;; even-opted.cpp:3 | ||
(set_local $0 | ||
(call $i32s-rem | ||
(get_local $0) | ||
(get_local $1) | ||
) | ||
) | ||
(i32.add | ||
(get_local $0) | ||
(get_local $1) | ||
) | ||
) | ||
) |
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,47 @@ | ||
(module | ||
(type $FUNCSIG$vii (func (param i32 i32))) | ||
(import "env" "emscripten_debuginfo" (func $emscripten_debuginfo (param i32 i32))) | ||
(import "env" "memory" (memory $0 256 256)) | ||
(import "env" "table" (table 0 0 anyfunc)) | ||
(import "env" "memoryBase" (global $memoryBase i32)) | ||
(import "env" "tableBase" (global $tableBase i32)) | ||
(export "add" (func $add)) | ||
(export "ret" (func $ret)) | ||
(export "opts" (func $opts)) | ||
(func $add (param $0 i32) (param $1 i32) (result i32) | ||
(i32.add | ||
(get_local $1) | ||
(get_local $1) | ||
) | ||
) | ||
(func $ret (param $0 i32) (result i32) | ||
(i32.add | ||
(i32.shl | ||
(get_local $0) | ||
(i32.const 1) | ||
) | ||
(i32.const 1) | ||
) | ||
) | ||
(func $opts (param $0 i32) (param $1 i32) (result i32) | ||
;; even-opted.cpp:2 | ||
(set_local $1 | ||
(i32.shr_s | ||
(get_local $1) | ||
(tee_local $0 | ||
(i32.add | ||
(get_local $0) | ||
(get_local $1) | ||
) | ||
) | ||
) | ||
) | ||
(i32.add | ||
(i32.rem_s | ||
(get_local $0) | ||
(get_local $1) | ||
) | ||
(get_local $1) | ||
) | ||
) | ||
) |
Oops, something went wrong.