Repository navigation
Commit 600fe6f
committed
[Wasm] JSToWasm IC needs assume no tag registers consistently
https://bugs.webkit.org/show_bug.cgi?id=329421
rdar://191643874
Reviewed by Yusuke Suzuki.
When 325503@main stopped materializing tag registers in
jsToWasmICEntrypoint, the f32/f64 argument case still called
branchIfInt32 and unboxDouble in HaveTagRegisters mode. If wasm leaves
an i64 in numberTagRegister and a JS tail call jumps into the IC, Int32
arguments get unboxed as doubles and come out as NaN (and doubles get
converted as Int32s). This patch adds DoNotHaveTagRegisters for both,
and uses a separate result register because unboxDouble overwrites its
result before it reads the input without tags.
Also, switch jitAssertIsJSDouble to use constants rather than assume
the state of the tag registers. This broke when passing
DoNotHaveTagRegisters to unboxDouble.
Tests: JSTests/stress/wasm-js-to-wasm-ic-materializes-tag-registers.js:
* JSTests/stress/wasm-js-to-wasm-ic-materializes-tag-registers.js:
* Source/JavaScriptCore/jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::jitAssertIsJSDouble):
* Source/JavaScriptCore/wasm/js/JSToWasm.cpp:
(JSC::Wasm::RTT::jsToWasmICEntrypoint const):
Canonical link: https://commits.webkit.org/325593@main1 parent e865968 commit 600fe6f
3 files changed
Lines changed: 25 additions & 5 deletions
File tree
- JSTests/stress
- Source/JavaScriptCore
- jit
- wasm/js
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
178 | | - | |
| 177 | + | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
624 | | - | |
625 | | - | |
| 624 | + | |
| 625 | + | |
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
| |||
0 commit comments