[Webkit-unassigned] [Bug 16525] New: Possible to optimize out for(var x = 0; x < 500; x++) in JSC?

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 20 04:39:21 PST 2007


http://bugs.webkit.org/show_bug.cgi?id=16525

           Summary: Possible to optimize out for(var x = 0; x < 500; x++) in
                    JSC?
           Product: WebKit
           Version: 525+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: eric at webkit.org
                CC: ggaren at apple.com


Possible to optimize out for(var x = 0; x < 500; x++) in JSC?

I wonder if it wouldn't be possible to completely optimize out the variable
handling for "x" in the above statement in JavaScriptCore.  Meaning, pull x
completely out of JS and make it be only on c-stack.

This would require two things:
1.  Walk the for subtree and make sure x is never referenced.
2.  Assure that "x < 500" is a statement involving only x and constants.

Requirement #1 could be relaxed if we actually exposed x in the scope chain.

This sort of optimization might be way overly complicated at this point.  But I
saw LessNode::evaluateToNumber() as 1.2% as well as
LocalVarAccessNode::evaluateToNumber() as 1.6% on the sample tonight, and
started to wonder.


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



More information about the webkit-unassigned mailing list