WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
159700
DFG should really support jneq_ptr
https://bugs.webkit.org/show_bug.cgi?id=159700
Summary
DFG should really support jneq_ptr
Filip Pizlo
Reported
2016-07-12 19:12:01 PDT
Patch forthcoming.
Attachments
the patch
(25.03 KB, patch)
2016-07-12 19:17 PDT
,
Filip Pizlo
keith_miller
: review+
Details
Formatted Diff
Diff
patch for landing
(25.55 KB, patch)
2016-07-12 20:10 PDT
,
Filip Pizlo
no flags
Details
Formatted Diff
Diff
performance
(78.13 KB, text/plain)
2016-07-13 11:17 PDT
,
Filip Pizlo
no flags
Details
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Filip Pizlo
Comment 1
2016-07-12 19:17:32 PDT
Created
attachment 283485
[details]
the patch
Keith Miller
Comment 2
2016-07-12 19:30:16 PDT
Comment on
attachment 283485
[details]
the patch View in context:
https://bugs.webkit.org/attachment.cgi?id=283485&action=review
r=me with question.
> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:8268 > + m_jit.boxBooleanPayload(false, resultGPR); > + JITCompiler::JumpList notEqual = m_jit.branchIfNotEqual(regs, node->cellOperand()->value()); > + m_jit.boxBooleanPayload(true, resultGPR); > + notEqual.link(&m_jit);
Is this more efficient than doing: JITCompiler::JumpList notEqual = m_jit.branchIfNotEqual(regs, node->cellOperand()->value()); m_jit.boxBooleanPayload(true, resultGPR); JITCompiler::Jump done = m_jit.jump(); notEqual.link(&m_jit); m_jit.boxBooleanPayload(false, resultGPR); done.link(&m_jit);
Filip Pizlo
Comment 3
2016-07-12 19:38:03 PDT
(In reply to
comment #2
)
> Comment on
attachment 283485
[details]
> the patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=283485&action=review
> > r=me with question. > > > Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:8268 > > + m_jit.boxBooleanPayload(false, resultGPR); > > + JITCompiler::JumpList notEqual = m_jit.branchIfNotEqual(regs, node->cellOperand()->value()); > > + m_jit.boxBooleanPayload(true, resultGPR); > > + notEqual.link(&m_jit); > > Is this more efficient than doing: > > JITCompiler::JumpList notEqual = m_jit.branchIfNotEqual(regs, > node->cellOperand()->value()); > m_jit.boxBooleanPayload(true, resultGPR); > JITCompiler::Jump done = m_jit.jump(); > notEqual.link(&m_jit); > m_jit.boxBooleanPayload(false, resultGPR); > done.link(&m_jit);
I don't know! I think that my version is better because: - Moving zero into a register is basically free. - Your version will do two branches in the worst case, while mine will do one. One of your branches is a jump, which is cheap, but probably worse than zeroing a register. My version also involves less code. I like to err on the side of small code when everything else is up in the air.
Filip Pizlo
Comment 4
2016-07-12 19:51:33 PDT
(In reply to
comment #3
)
> (In reply to
comment #2
) > > Comment on
attachment 283485
[details]
> > the patch > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=283485&action=review
> > > > r=me with question. > > > > > Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:8268 > > > + m_jit.boxBooleanPayload(false, resultGPR); > > > + JITCompiler::JumpList notEqual = m_jit.branchIfNotEqual(regs, node->cellOperand()->value()); > > > + m_jit.boxBooleanPayload(true, resultGPR); > > > + notEqual.link(&m_jit); > > > > Is this more efficient than doing: > > > > JITCompiler::JumpList notEqual = m_jit.branchIfNotEqual(regs, > > node->cellOperand()->value()); > > m_jit.boxBooleanPayload(true, resultGPR); > > JITCompiler::Jump done = m_jit.jump(); > > notEqual.link(&m_jit); > > m_jit.boxBooleanPayload(false, resultGPR); > > done.link(&m_jit); > > I don't know! I think that my version is better because: > > - Moving zero into a register is basically free. > - Your version will do two branches in the worst case, while mine will do > one. One of your branches is a jump, which is cheap, but probably worse > than zeroing a register. > > My version also involves less code. I like to err on the side of small code > when everything else is up in the air.
Brainfart: I'm not moving zero into a register. I guess the question is: do we care about this code being fast or small? I like small a bit better, since if it really needs to be fast, it'll get to FTL. DFG is for functions that don't run that much, so icache matters more.
Filip Pizlo
Comment 5
2016-07-12 20:10:04 PDT
Created
attachment 283486
[details]
patch for landing
Filip Pizlo
Comment 6
2016-07-13 11:17:59 PDT
Created
attachment 283549
[details]
performance Looks pretty good!
Filip Pizlo
Comment 7
2016-07-18 12:14:17 PDT
Landed in
https://trac.webkit.org/changeset/203361
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