WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
95784
BytecodeGenerator::resolve is unnecessarily pessimistic
https://bugs.webkit.org/show_bug.cgi?id=95784
Summary
BytecodeGenerator::resolve is unnecessarily pessimistic
Oliver Hunt
Reported
2012-09-04 14:46:43 PDT
Currently BytecodeGenerator::resolve does: // Cases where we cannot statically optimize the lookup. if (property == propertyNames().arguments || !canOptimizeNonLocals()) return ResolveResult::dynamicResolve(0); ScopeChainIterator iter = m_scope->begin(); ScopeChainIterator end = m_scope->end(); size_t depth = 0; size_t depthOfFirstScopeWithDynamicChecks = 0; unsigned flags = 0; It should be possible to make it: // Cases where we cannot statically optimize the lookup. if (property == propertyNames().arguments) return ResolveResult::dynamicResolve(0); ScopeChainIterator iter = m_scope->begin(); ScopeChainIterator end = m_scope->end(); size_t depth = 0; size_t depthOfFirstScopeWithDynamicChecks = 0; unsigned flags = canOptimizeNonLocals() ? 0 : ResolveResult::DynamicFlag; The only thing of obvious concern is that resolve_dynamic (and related thingies) may not deal well with the idea that the top scope chain may itself need to be checked
Attachments
Add attachment
proposed patch, testcase, etc.
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