WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
39256
Make sure globalExec always has a correct scopechain
https://bugs.webkit.org/show_bug.cgi?id=39256
Summary
Make sure globalExec always has a correct scopechain
Oliver Hunt
Reported
2010-05-17 18:33:49 PDT
Make sure globalExec always has a correct scopechain
Attachments
Patch
(2.71 KB, patch)
2010-05-17 19:58 PDT
,
Oliver Hunt
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Oliver Hunt
Comment 1
2010-05-17 19:58:55 PDT
Created
attachment 56310
[details]
Patch
Darin Adler
Comment 2
2010-05-17 20:01:53 PDT
Comment on
attachment 56310
[details]
Patch
> ExecState* JSGlobalObject::globalExec() > { > - return CallFrame::create(d()->globalCallFrame + RegisterFile::CallFrameHeaderSize); > + ExecState* result = CallFrame::create(d()->globalCallFrame + RegisterFile::CallFrameHeaderSize); > + ASSERT(d()->globalScopeChain.node()); > + result->init(0, 0, d()->globalScopeChain.node(), CallFrame::noCaller(), 0, 0, 0); > + return result; > }
This seems to add quite a bit of extra work to a function that used to just compute and return a pointer. Why is this better?
Oliver Hunt
Comment 3
2010-05-17 20:04:21 PDT
(In reply to
comment #2
)
> (From update of
attachment 56310
[details]
) > > ExecState* JSGlobalObject::globalExec() > > { > > - return CallFrame::create(d()->globalCallFrame + RegisterFile::CallFrameHeaderSize); > > + ExecState* result = CallFrame::create(d()->globalCallFrame + RegisterFile::CallFrameHeaderSize); > > + ASSERT(d()->globalScopeChain.node()); > > + result->init(0, 0, d()->globalScopeChain.node(), CallFrame::noCaller(), 0, 0, 0); > > + return result; > > } > > This seems to add quite a bit of extra work to a function that used to just compute and return a pointer. Why is this better?
it's groundwork for future optimisations
Geoffrey Garen
Comment 4
2010-05-17 20:47:22 PDT
Can you arrange to initialize d()->globalCallFrame once? As it stands, globalExec() will neurotically write the same ScopeChainNode* and CallFrame::noCaller() value to d()->globalCallFrame every time it's called.
Oliver Hunt
Comment 5
2010-05-17 23:04:50 PDT
Comment on
attachment 56310
[details]
Patch this isn't necessary, it turns out everything is currently as we want it to be.
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