Closed
Bug 1489994
Opened 6 years ago
Closed 6 years ago
ARM64-sim crashes on anyref-global-prebarrier.js
Categories
(Core :: JavaScript: WebAssembly, enhancement)
Tracking
()
RESOLVED
FIXED
mozilla64
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: lth, Assigned: lth)
References
Details
Attachments
(1 file)
1.43 KB,
patch
|
bbouvier
:
review+
|
Details | Diff | Splinter Review |
Just build m-i form arm64 simulator and jit-test wasm/gc/anyref-global-prebarrier.js. It looks like this happens in the second call to set(), when we set the value back to null, which is as expected.
I don't have a full diagnosis yet but from where i'm sitting it could look like the code for the prebarrier, which was emitted by Ion, has been emitted assuming that the PSP (x28) has been set up. But wasm code does not use the PSP; wasm code almost certainly needs a separate prebarrier stub on arm64.
Assignee | ||
Comment 1•6 years ago
|
||
What worries me is that the build bots have not seen this. Either we're not running with --wasm-gc on the bots, or we're not running arm64 code on the bots at all, or the error has been masked somewhere.
Assignee | ||
Comment 2•6 years ago
|
||
And if it's a problem for the prebarrier, it's likely also a problem for the arguments rectifier and the exception tail functions, since they appear to be obtained in the same way.
Assignee | ||
Comment 3•6 years ago
|
||
Blocks fennec due to risk of arguments rectifier and exception tail functionality also being affected.
Blocks: Fennec-ARM64
Assignee | ||
Comment 4•6 years ago
|
||
... and of course once we're not using the PSP but the real SP, basically no shared code in jit/ (or indeed jit code in jit/arm64/) works because it has a lot of individual push and pop operations, which are verboten on ARM64.
The obvious avenue to try is to save/restore x28 around the call to the barrier stub and to move the sp to x28 for the duration of the barrier call, we'll see.
Assignee | ||
Comment 5•6 years ago
|
||
Unblocking Fennec - I have inspected the paths for the arguments rectifier and the exception signaling, and they do set up the correct SP before executing. It's only the prebarrier that's the problem.
No longer blocks: Fennec-ARM64
Comment 6•6 years ago
|
||
Aouch. See also bug 1464157, which suggests that having our own barrier in wasm would be better anyways. Maybe a chance to kill two birds with one stone.
Assignee | ||
Comment 7•6 years ago
|
||
Aha!! Well, this week I will take whatever bird I can get with whatever stone I have, I have other patches to land :)
Assignee | ||
Comment 8•6 years ago
|
||
Comment 9•6 years ago
|
||
Comment on attachment 9007802 [details] [diff] [review]
bug1489994-prebarrier-psp.patch
Review of attachment 9007802 [details] [diff] [review]:
-----------------------------------------------------------------
Alrighty then. Thanks!
::: js/src/wasm/WasmBaselineCompile.cpp
@@ +5655,5 @@
> masm.loadPtr(Address(scratch, Instance::offsetOfPreBarrierCode()), scratch);
> +# ifdef JS_CODEGEN_ARM64
> + // The prebarrier stub assumes the PseudoStackPointer is set up. We do
> + // not need to save and restore x28 because it is not yet allocatable.
> + MOZ_ASSERT(!GeneralRegisterSet::All().hasRegisterIndex(x28.asUnsized()));
Can this be a static_assert with no efforts?
Attachment #9007802 -
Flags: review?(bbouvier) → review+
Assignee | ||
Comment 10•6 years ago
|
||
(In reply to Benjamin Bouvier [:bbouvier] from comment #9)
> Can this be a static_assert with no efforts?
I don't think so, because most of the constants for ARM64 are const but not constexpr, ditto the methods of TypedRegisterSet. And TypedRegisterSet::All() is just plain static, and I don't know where that falls on the spectrum either. I can try it just to see what happens but I expect failure :)
Comment 11•6 years ago
|
||
Pushed by lhansen@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b22c01fefae4
On ARM64, make sure to switch to the PSP for the prebarrier stub when calling from wasm. r=bbouvier
Comment 12•6 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in
before you can comment on or make changes to this bug.
Description
•