Bug 95784

Summary: BytecodeGenerator::resolve is unnecessarily pessimistic
Product: WebKit Reporter: Oliver Hunt <oliver>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: fpizlo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

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
Note You need to log in before you can comment on or make changes to this bug.