Implement i64<>JavaScript’s BigInt conversions proposal (basic functionality + most stubs)
Categories
(Core :: JavaScript: WebAssembly, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: sven, Assigned: asumu)
References
Details
Attachments
(6 files, 2 obsolete files)
Bug 1511958 - Implement i64<>JavaScript’s BigInt conversions proposal (part 1, build system changes)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Reporter | ||
Comment 1•6 years ago
|
||
Comment 2•6 years ago
|
||
Reporter | ||
Comment 3•6 years ago
|
||
Comment 4•6 years ago
|
||
Updated•6 years ago
|
Reporter | ||
Comment 5•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 6•6 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:sven, could you have a look please?
Updated•6 years ago
|
Assignee | ||
Comment 7•5 years ago
|
||
Continues rev D22990 to implement the I64 to BigInt conversions proposal (https://github.com/WebAssembly/JS-BigInt-integration), original rev by Sven Sauleau
Assignee | ||
Comment 8•5 years ago
|
||
This is part 1 of a series of revs that split up D41710 into smaller revs. This rev just adds a compile-time flag for wasm BigInt to I64 conversion but does not use it anywhere, as its uses are for toggling features in subsequent revs.
Assignee | ||
Comment 9•5 years ago
|
||
This is part 2 of a series of revs that split up D41710 (for Wasm I64 to BigInt conversion) into smaller revs. This rev depends on the compile-time flag added in D43177 and adds a runtime flag to JSContext options that will toggle whether I64 to BigInt conversion is used. The flag will get used mostly in WasmInstance.cpp, but it also needs to be used to toggle I64 error checks in both Ion inlining code and in Wasm stub generation code. To pass that information along, the flag is also put in CompileArgs for WasmCompile and then copied to wasm module metadata (so that it can be read from lazy stub generation code).
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Setting checkin-needed for https://phabricator.services.mozilla.com/D43177. @asumu I think it can make sense to open new bugs blocking this one when you have additional patches beyond the second one in the series that's already up.
Updated•5 years ago
|
Comment 11•5 years ago
|
||
Pushed by rgurzau@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d2072e34a3b1
Implement i64<>JavaScript’s BigInt conversions proposal (part 1, build system changes) r=wingo,bbouvier
Comment 12•5 years ago
|
||
https://phabricator.services.mozilla.com/D43179 needs review from bbouvier to continue. Thank you.
Comment 13•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Comment 14•5 years ago
|
||
bugherder uplift |
Assignee | ||
Comment 15•5 years ago
|
||
This is part 3 of a series of revs that split up D41710 (for Wasm I64 to BigInt conversion) into smaller revs. This rev depends on the compile-time flag added in D43177 and the run-time flag in D43179. Sorry for the delay in uploading this, there were a number of bugs I had to fix.
The rev adds support for BigInt<->I64 conversion in WasmInstance and to the Wasm stubs for the JIT, and in the inlining code in MCallOptimize. It addresses some of the main concerns that wingo brought up in comments on the original rev: the BigInt to I64 code path in the stubs is now written in assembly (in MacroAssembly.cpp) to avoid some hacky code. Most of the changes are also guarded by an ifdef for ENABLE_WASM_BIGINT now.
One comment that I haven't addressed yet but I'll add is BigInt fast paths for the JIT entry stub for simple cases.
Assignee | ||
Comment 16•5 years ago
|
||
This is part 4 of a series of revs that split up D41710 (for Wasm I64 to BigInt conversion) into smaller revs. This rev depends on the compile-time flag added in D43177 and the run-time flag in D43179 and the main implementation in D46205.
This rev adds tests in the JIT test suite that exercises the BigInt conversion code, and also modifies existing tests to work with the --wasm-big-int
flag either enabled or disabled (with different expected results).
Comment 17•5 years ago
|
||
Is the spec rendered somewhere, please? In particular, I wanted to learn if/why it was fine to wrap an incoming BigInt into an i64 (since a big integer may be arbitrarily large, unless its name stands for a lie).
Comment 18•5 years ago
|
||
bbouvier: it is now: https://webassembly.github.io/JS-BigInt-integration/js-api/index.html
BigInt values wrap around modulo 2^64, just like Numbers do for i32.
Comment 19•5 years ago
|
||
Code freeze is now lifted, we can land scary things again.
Asumu, what is your estimate for when you think you might land this? I have a big patch I think will conflict with your work quite a lot and I'm happy to wait until you've landed and take the burden of rebasing, but only if you think you're going to land by Dec 13, say -- I'd like to get things landed before the holidays.
Assignee | ||
Comment 20•5 years ago
|
||
Hi Lars, I expect to address all the remaining comments on the part 3 and 4 revs for this today, so parts 2 to 4 should be ready very soon. So I am on board with your timeline, and thanks for taking on the rebasing in that case.
I do have two patches remaining (parts 5 and 6) that I will put on phabricator that I think are less involved and adds the changes to wasm globals needed for the proposal plus tests. These changes are confined to WasmJS.cpp/h and test files. I can put these up today too.
Assignee | ||
Comment 21•5 years ago
|
||
This is part 5 of a series of revs that split up D41710 (to implement the Wasm I64 to BigInt conversion proposal) into smaller revs.
The rev adds support for handling globals with I64 types in the Wasm to JS interface.
Assignee | ||
Comment 22•5 years ago
|
||
This is part 6 of a series of revs that split up D41710 (to implement the Wasm I64 to BigInt conversion proposal) into smaller revs.
The rev adds tests for wasm global handling with the Wasm to JS interface.
Comment 23•5 years ago
|
||
Comment 24•5 years ago
|
||
bugherder |
Comment 25•5 years ago
|
||
Comment 26•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 27•5 years ago
|
||
Comment 28•5 years ago
|
||
bugherder |
Comment 29•5 years ago
|
||
Comment 30•5 years ago
|
||
bugherder |
Comment 31•5 years ago
|
||
Comment 32•5 years ago
|
||
bugherder |
Comment 33•5 years ago
|
||
Fabulous work!
Are we still missing code for the extra-special Ion->Wasm fast call path? Or maybe I should ask, are there plans to do something about that, or should we close this bug now and do that "later"?
Comment 34•5 years ago
|
||
We should also discuss whether it would not be appropriate to enable this feature by default in the shell and in Nightly.
Assignee | ||
Comment 35•5 years ago
|
||
Hi Lars, thanks! (sorry for the delayed response, I'm only reading e-mail intermittently during these last weeks of the year) I have a work-in-progress patch that would enable the Ion->Wasm fast path, which has been made easier by some of the recent BigInt-related macroassembler changes. I am hoping to finish that in early January or so when I'm back from the holidays, so I could file that patch under this bug then (or under a new one too if that's preferable).
Also, sounds good on the discussion, what are the typical criteria for enabling a feature in the shell/nightly?
Comment 37•5 years ago
|
||
(In reply to Asumu Takikawa from comment #35)
Hi Lars, thanks! (sorry for the delayed response, I'm only reading e-mail intermittently during these last weeks of the year) I have a work-in-progress patch that would enable the Ion->Wasm fast path, which has been made easier by some of the recent BigInt-related macroassembler changes. I am hoping to finish that in early January or so when I'm back from the holidays, so I could file that patch under this bug then (or under a new one too if that's preferable).
Let's do a new bug.
I'm also going to remove the [meta] tag from this bug since metabugs should carry no patches but this one has many :-) I will make a new metabug and create new bugs for the ion->wasm fast path and for the enable-on-nightly, and I'll assign them both to you.
After that I think we can close this one?
Also, sounds good on the discussion, what are the typical criteria for enabling a feature in the shell/nightly?
Basically, we need to believe that the feature design is "stable enough" and that the code is pretty solid and can benefit from the extra testing. The spec seems to be stage 3, which is fine on the first count, and so far all our testing and reviews have lead to code that's pretty decent, I would say, so I'm not worried about the second count either.
Updated•5 years ago
|
Comment 38•5 years ago
|
||
Metabug for remaining work is bug 1608770.
Updated•5 years ago
|
Description
•