WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
211038
[JSC] ValueAdd, VaueSub, ValueMul, Inc, Dec should say SpecBigInt32 prediction based on ArithProfile
https://bugs.webkit.org/show_bug.cgi?id=211038
Summary
[JSC] ValueAdd, VaueSub, ValueMul, Inc, Dec should say SpecBigInt32 predictio...
Yusuke Suzuki
Reported
2020-04-25 19:54:32 PDT
...
Attachments
Patch
(33.74 KB, patch)
2020-04-25 21:17 PDT
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
Patch
(45.72 KB, patch)
2020-04-25 22:04 PDT
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
Patch
(45.90 KB, patch)
2020-04-25 22:48 PDT
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
Patch
(45.90 KB, patch)
2020-04-25 22:52 PDT
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
Patch
(46.35 KB, patch)
2020-04-25 22:55 PDT
,
Yusuke Suzuki
fpizlo
: review+
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Yusuke Suzuki
Comment 1
2020-04-25 21:17:57 PDT
Created
attachment 397608
[details]
Patch
Yusuke Suzuki
Comment 2
2020-04-25 21:25:42 PDT
Comment on
attachment 397608
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=397608&action=review
> Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:1112 > + if (arithProfile->didObserveBigInt32()) > + node->mergeFlags(NodeMayHaveBigInt32Result); > + if (arithProfile->didObserveHeapBigInt() || m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BigInt32Overflow)) > + node->mergeFlags(NodeMayHaveHeapBigIntResult);
We are currently telling this but not using it yet for ValueDiv.
Yusuke Suzuki
Comment 3
2020-04-25 21:27:12 PDT
I'll do Inc / Dec too.
Yusuke Suzuki
Comment 4
2020-04-25 22:04:33 PDT
Created
attachment 397609
[details]
Patch
Yusuke Suzuki
Comment 5
2020-04-25 22:48:56 PDT
Created
attachment 397610
[details]
Patch
Yusuke Suzuki
Comment 6
2020-04-25 22:52:14 PDT
Created
attachment 397611
[details]
Patch
Yusuke Suzuki
Comment 7
2020-04-25 22:55:36 PDT
Created
attachment 397612
[details]
Patch
Yusuke Suzuki
Comment 8
2020-04-26 14:11:55 PDT
Committed
r260730
: <
https://trac.webkit.org/changeset/260730
>
Radar WebKit Bug Importer
Comment 9
2020-04-26 14:12:16 PDT
<
rdar://problem/62408278
>
Saam Barati
Comment 10
2020-04-27 18:36:16 PDT
Comment on
attachment 397612
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=397612&action=review
> Source/JavaScriptCore/dfg/DFGFixupPhase.cpp:328 > + // Shift can throw RangeError.
is this specified though? But maybe it's best to be consistent amongst the tiers.
> Source/JavaScriptCore/dfg/DFGFixupPhase.cpp:763 > + if (Node::shouldSpeculateHeapBigInt(node->child1().node(), node->child2().node())) {
nice: I commented on this in Robin's patch but I'm glad you're fixing it here
> Source/JavaScriptCore/dfg/DFGNode.h:2880 > + bool canSpeculateBigInt32(RareCaseProfilingSource source)
we're not using the rare case profiling for this, so do we really need it passed around?
> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:4136 > + // FIXME: Introduce another BigInt32 code generation: binary use kinds are BigIntUse32, but result is SpecAnyInt and accepting overflow.
Not super important, but it's not SpecAnyInt, it's: SpecAnyInt => SpecAnyBigInt or SpecBigInt
> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:4986 > + // FIXME: Introduce another BigInt32 code generation: binary use kinds are BigIntUse32, but result is SpecAnyInt and accepting overflow.
ditto
> Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:2146 > + // FIXME: Introduce another BigInt32 code generation: binary use kinds are BigIntUse32, but result is SpecAnyInt and accepting overflow.
ditto
Yusuke Suzuki
Comment 11
2020-04-27 18:43:38 PDT
Comment on
attachment 397612
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=397612&action=review
>> Source/JavaScriptCore/dfg/DFGFixupPhase.cpp:328 >> + // Shift can throw RangeError. > > is this specified though? But maybe it's best to be consistent amongst the tiers.
I think, to make it consistent with JSString etc. we should throw OOM error instead of RangeError. And in that case, we can clear MustGenerate.
https://bugs.webkit.org/show_bug.cgi?id=211111
>> Source/JavaScriptCore/dfg/DFGNode.h:2880 >> + bool canSpeculateBigInt32(RareCaseProfilingSource source) > > we're not using the rare case profiling for this, so do we really need it passed around?
Currently not using it. But I left it for the future extension. 168 // We always attempt to produce BigInt32 as much as possible. If we see HeapBigInt, we observed overflow. 169 // FIXME: Extend this information by tiered profiling (from Baseline, DFG etc.). 170 //
https://bugs.webkit.org/show_bug.cgi?id=211039
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug