Commit b19f56a
[32 bit] DFG graph generation: intrinsic getters are fallible
https://bugs.webkit.org/show_bug.cgi?id=260908
Reviewed by Yusuke Suzuki.
On 32-bit, unlike 64-bit, some of the DFG intrinsic getters (really, the
TypedArray ones) are _fallible_: if the SpeculatedType doesn't match our
expecations (a non-strict subset of SpecInt32Only), we refuse to generate code. [1]
However, DFG::ByteCodeParser::handleGetById doesn't appear to handle this case
gracefully--if `handleIntrinsicGetter` fails, we attempt to generate a call to
the getter, but in the case of TypedArray intrinsics, we won't have the
necessary CallLinkStatus and while attempting to do so, we crash.
To fix this, I've added a bit of code that handles the failure from
handleIntrinsicGetter and emits an ordinary `GetById` node instead of trying to
inline anything for this op.
I've added a test that demonstrates the current behavior (a segfault) on armv7
and passes with tihs patch.
[1] For what it's worth, maybe this shouldn't be the case: it does seem like we
should still be able to generate code in these cases anyhow, but it's simpler to
just cope with the failure.
* JSTests/stress/typed-array-intrinsic-getter-with-conflicting-value-profile.js: Added.
(foo):
(i.null.foo.Object.create):
(i.42.foo):
* Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleGetById):
Canonical link: https://commits.webkit.org/267511@main1 parent c888663 commit b19f56a
2 files changed
Lines changed: 48 additions & 12 deletions
File tree
- JSTests/stress
- Source/JavaScriptCore/dfg
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4760 | 4760 | | |
4761 | 4761 | | |
4762 | 4762 | | |
| 4763 | + | |
| 4764 | + | |
| 4765 | + | |
| 4766 | + | |
| 4767 | + | |
| 4768 | + | |
| 4769 | + | |
| 4770 | + | |
| 4771 | + | |
| 4772 | + | |
| 4773 | + | |
| 4774 | + | |
| 4775 | + | |
| 4776 | + | |
| 4777 | + | |
| 4778 | + | |
| 4779 | + | |
| 4780 | + | |
| 4781 | + | |
| 4782 | + | |
| 4783 | + | |
| 4784 | + | |
| 4785 | + | |
| 4786 | + | |
4763 | 4787 | | |
4764 | 4788 | | |
4765 | 4789 | | |
4766 | | - | |
4767 | | - | |
| 4790 | + | |
4768 | 4791 | | |
4769 | 4792 | | |
4770 | 4793 | | |
4771 | | - | |
4772 | | - | |
4773 | | - | |
4774 | | - | |
4775 | | - | |
4776 | | - | |
4777 | | - | |
4778 | | - | |
4779 | | - | |
4780 | | - | |
4781 | 4794 | | |
4782 | 4795 | | |
4783 | 4796 | | |
| 4797 | + | |
4784 | 4798 | | |
4785 | 4799 | | |
4786 | 4800 | | |
| |||
0 commit comments