[Webkit-unassigned] [Bug 95784] New: BytecodeGenerator::resolve is unnecessarily pessimistic

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 4 14:46:30 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=95784

           Summary: BytecodeGenerator::resolve is unnecessarily
                    pessimistic
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: oliver at apple.com
                CC: fpizlo at apple.com


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

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list