WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
126778
DFG should allow Phantoms after terminals
https://bugs.webkit.org/show_bug.cgi?id=126778
Summary
DFG should allow Phantoms after terminals
Filip Pizlo
Reported
2014-01-10 13:43:52 PST
This would allow us to get rid of some hacks and would also enable new kinds of CFG simplification.
Attachments
work in progress
(44.89 KB, patch)
2015-04-19 16:26 PDT
,
Filip Pizlo
no flags
Details
Formatted Diff
Diff
the patch
(51.08 KB, patch)
2015-04-20 18:43 PDT
,
Filip Pizlo
mark.lam
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Filip Pizlo
Comment 1
2015-04-19 16:26:39 PDT
Created
attachment 251134
[details]
work in progress
Filip Pizlo
Comment 2
2015-04-20 18:43:11 PDT
Created
attachment 251209
[details]
the patch
WebKit Commit Bot
Comment 3
2015-04-20 18:46:01 PDT
Attachment 251209
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/dfg/DFGBasicBlock.h:121: The parameter name "node" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/dfg/DFGValidate.cpp:202: Place brace on its own line for function definitions. [whitespace/braces] [4] Total errors found: 2 in 28 files If any of these errors are false positives, please file a bug against check-webkit-style.
Mark Lam
Comment 4
2015-04-21 15:17:38 PDT
Comment on
attachment 251209
[details]
the patch View in context:
https://bugs.webkit.org/attachment.cgi?id=251209&action=review
Please fix style issues. r=me with suggestions addressed.
> Source/JavaScriptCore/dfg/DFGBasicBlock.h:313 > private: > + > friend class InsertionSet;
Unnecessary blank line added here. Please remove.
> Source/JavaScriptCore/dfg/DFGSSAConversionPhase.cpp:339 > + size_t upsilonInsertionPoint = block->findTerminal().index; > + NodeOrigin upsilonOrigin = block->terminal()->origin;
block->terminal() will invoke findTerminal() again. Why not just cache and use the NodeAndIndex result?
> Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:1932 > - case MovHint: > - case ZombieHint: { > + case MovHint: { > DFG_CRASH(m_jit.graph(), node, "Unexpected node"); > break; > } > + > + case ZombieHint: { > + recordSetLocal(m_currentNode->unlinkedLocal(), VirtualRegister(), DataFormatDead); > + break; > + }
This part is already in ToT, right?
> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:-1449 > - case ZombieHint: { > - recordSetLocal(m_currentNode->unlinkedLocal(), VirtualRegister(), DataFormatDead); > - break; > - } > -
Ditto. Already in ToT.
> Source/JavaScriptCore/dfg/DFGTierUpCheckInjectionPhase.cpp:109 > + if (block->terminal()->op() == Return) { > insertionSet.insertNode( > - block->size() - 1, SpecNone, CheckTierUpAtReturn, block->last()->origin); > + block->findTerminal().index, SpecNone, CheckTierUpAtReturn, > + block->terminal()->origin);
Again, you're calling findTerminal() 3 times here. Why not cache and reuse the NodeAndIndex?
Mark Lam
Comment 5
2015-04-21 15:22:31 PDT
Comment on
attachment 251209
[details]
the patch View in context:
https://bugs.webkit.org/attachment.cgi?id=251209&action=review
> Source/JavaScriptCore/dfg/DFGCFGSimplificationPhase.cpp:155 > + if (block->terminal()->child1()->hasConstant()) { > + FrozenValue* value = block->terminal()->child1()->constant();
Ditto, can call findTerminal() and cache here.
> Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp:465 > + size_t upsilonInsertionPoint = block->findTerminal().index; > + Node* upsilonWhere = block->terminal();
Ditto. Use findTerminal() once?
> Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp:712 > + size_t upsilonInsertionPoint = block->findTerminal().index; > + NodeOrigin upsilonOrigin = block->terminal()->origin;
Ditto. Use findTerminal() once?
> Source/JavaScriptCore/dfg/DFGPutStackSinkingPhase.cpp:445 > + size_t upsilonInsertionPoint = block->findTerminal().index; > + NodeOrigin upsilonOrigin = block->terminal()->origin;
Ditto. Use findTerminal() once?
> Source/JavaScriptCore/dfg/DFGStaticExecutionCountEstimationPhase.cpp:66 > + switch (block->terminal()->op()) {
Ditto. Use findTerminal() once?
Filip Pizlo
Comment 6
2015-04-21 20:22:00 PDT
I fixed all of the repeated terminal() calls locally.
Filip Pizlo
Comment 7
2015-04-21 20:22:29 PDT
(In reply to
comment #4
)
> Comment on
attachment 251209
[details]
> the patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=251209&action=review
> > Please fix style issues. > > r=me with suggestions addressed. > > > Source/JavaScriptCore/dfg/DFGBasicBlock.h:313 > > private: > > + > > friend class InsertionSet; > > Unnecessary blank line added here. Please remove. > > > Source/JavaScriptCore/dfg/DFGSSAConversionPhase.cpp:339 > > + size_t upsilonInsertionPoint = block->findTerminal().index; > > + NodeOrigin upsilonOrigin = block->terminal()->origin; > > block->terminal() will invoke findTerminal() again. Why not just cache and > use the NodeAndIndex result? > > > Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:1932 > > - case MovHint: > > - case ZombieHint: { > > + case MovHint: { > > DFG_CRASH(m_jit.graph(), node, "Unexpected node"); > > break; > > } > > + > > + case ZombieHint: { > > + recordSetLocal(m_currentNode->unlinkedLocal(), VirtualRegister(), DataFormatDead); > > + break; > > + } > > This part is already in ToT, right?
Correct - this was the part of what I landed in an earlier patch that I needed to write this patch.
> > > Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:-1449 > > - case ZombieHint: { > > - recordSetLocal(m_currentNode->unlinkedLocal(), VirtualRegister(), DataFormatDead); > > - break; > > - } > > - > > Ditto. Already in ToT. > > > Source/JavaScriptCore/dfg/DFGTierUpCheckInjectionPhase.cpp:109 > > + if (block->terminal()->op() == Return) { > > insertionSet.insertNode( > > - block->size() - 1, SpecNone, CheckTierUpAtReturn, block->last()->origin); > > + block->findTerminal().index, SpecNone, CheckTierUpAtReturn, > > + block->terminal()->origin); > > Again, you're calling findTerminal() 3 times here. Why not cache and reuse > the NodeAndIndex?
Filip Pizlo
Comment 8
2015-04-21 20:41:15 PDT
Landed in
http://trac.webkit.org/changeset/183094
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