Skip to content

BigInt support - #2726

Merged
kripken merged 3 commits into
masterfrom
bigint
Apr 7, 2020
Merged

BigInt support#2726
kripken merged 3 commits into
masterfrom
bigint

Conversation

@kripken

@kripken kripken commented Apr 7, 2020

Copy link
Copy Markdown
Member

If wasm-emscripten-finalize is given the BigInt flag, then we will
be using BigInts on the JS side, and need no legalization at all
since i64s will just be BigInts.

Comment thread test/lld/bigint.wat Outdated
(unreachable)
)
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove trailing newline

Comment thread test/lld/bigint.wat
(export "__data_end" (global $global$1))
(global $global$0 (mut i32) (i32.const 66208))
(global $global$1 i32 (i32.const 658))
(func $foo (param i64) (result i64)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was expecting to see imports and exports of i64 functions here... is putting it the table enough to test the legalization?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the legalization path would create a legalized dynCall with i32 pairs etc.

@kripken
kripken merged commit eaa7240 into master Apr 7, 2020
@kripken
kripken deleted the bigint branch April 7, 2020 18:59
kripken added a commit to emscripten-core/emscripten that referenced this pull request Apr 10, 2020
This adds a flag WASM_BIGINT which enables this feature, with
which we let the JS VM use a JS BigInt for a wasm i64. In that case
we don't need to legalize i64s into pairs of i32s.

This is fairly straightforward, but we do need to modify the JS code
of each library method that receives or returns an i64.

Tests verify that we can send and receive i64s from wasm to JS,
and also that a dynCall works. This depends on
WebAssembly/binaryen#2726 for that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants