WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 97221
Refactored the interpreter and JIT so they don't dictate closure layout
https://bugs.webkit.org/show_bug.cgi?id=97221
Summary
Refactored the interpreter and JIT so they don't dictate closure layout
Geoffrey Garen
Reported
2012-09-20 08:20:32 PDT
Refactored the interpreter and JIT so they don't dictate closure layout
Attachments
Patch
(36.48 KB, patch)
2012-09-20 10:59 PDT
,
Geoffrey Garen
no flags
Details
Formatted Diff
Diff
Patch
(38.72 KB, patch)
2012-09-20 11:20 PDT
,
Geoffrey Garen
oliver
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Geoffrey Garen
Comment 1
2012-09-20 10:59:46 PDT
Created
attachment 164946
[details]
Patch
Oliver Hunt
Comment 2
2012-09-20 11:09:01 PDT
Comment on
attachment 164946
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=164946&action=review
> Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:4223 > + size_t baseOffset = > + (node.codeOrigin.inlineCallFrame > + ? node.codeOrigin.inlineCallFrame->stackOffset > + : 0) * sizeof(Register);
i think i'd prefer a plain if() here. baseOffset = 0; if (inlineFrame) baseOffset = thingy * sizeof(Register)
Geoffrey Garen
Comment 3
2012-09-20 11:20:02 PDT
Created
attachment 164953
[details]
Patch
Geoffrey Garen
Comment 4
2012-09-20 11:20:46 PDT
> i think i'd prefer a plain if() here.
"* sizeof(Register)" is not optional, so I couldn't do exactly what you suggested, but I think you'll like what I came up with.
Oliver Hunt
Comment 5
2012-09-20 11:32:25 PDT
Comment on
attachment 164953
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=164953&action=review
This seems okay to me, the only concern is the baseOffset stuff. I'll r+ as it is, but personally i think i'd prefer it if you factored out CodeOrigin::baseOffset()
> Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:4221 > + size_t baseOffset = node.codeOrigin.inlineCallFrame ? node.codeOrigin.inlineCallFrame->stackOffset : 0; > + baseOffset *= sizeof(Register);
This is nicer, but i still think the purely if based one works nicer (actual code now rather than bus typing logic): size_t baseOffset = 0; if (InlineCallFrame* inlineCallFrame = node.codeOrigin.inlineCallFrame) baseOffset = inlineCallFrame->stackOffset * sizeof(Register) how does that feel? I'm okay with your code as it stands, but personally i'd prefer the if() approach
> Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:4239 > + size_t baseOffset = node.codeOrigin.inlineCallFrame ? node.codeOrigin.inlineCallFrame->stackOffset : 0; > + baseOffset = (baseOffset + CallFrame::argumentOffsetIncludingThis(0)) * sizeof(Register);
Ditto here -- although the repeated logic here makes me wonder if we actually want a baseOffset() function on CodeOrigin, then all this code would be: size_t baseOffset = (code.codeOrigin.baseOffset() + thingyIfNecessary) * sizeof(Register) how does that sound? It would also encapsulate that production of baseOffset, so that if we decided to change the logic in future we would need to go around hunting all these sites down.
> Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:4301 > + size_t baseOffset = node.codeOrigin.inlineCallFrame ? node.codeOrigin.inlineCallFrame->stackOffset : 0; > + baseOffset *= sizeof(Register);
Yeah, all this duplicated code makes me think a CodeOrigin::baseOffset() function is the best approach. Thoughts?
Oliver Hunt
Comment 6
2012-09-20 11:32:40 PDT
Comment on
attachment 164953
[details]
Patch (- != + )
Geoffrey Garen
Comment 7
2012-09-20 12:51:25 PDT
Committed
r129156
: <
http://trac.webkit.org/changeset/129156
>
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