Bug 18626 - SQUIRRELFISH: support the "slow script" dialog
Summary: SQUIRRELFISH: support the "slow script" dialog
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Oliver Hunt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-19 14:37 PDT by Maciej Stachowiak
Modified: 2008-06-27 21:11 PDT (History)
1 user (show)

See Also:


Attachments
Patch, regresses perf on some systems (9.43 KB, patch)
2008-05-16 02:59 PDT, Oliver Hunt
no flags Details | Formatted Diff | Diff
More complete version patch (11.40 KB, patch)
2008-05-20 01:45 PDT, Oliver Hunt
no flags Details | Formatted Diff | Diff
Final (hopefully) patch (27.52 KB, patch)
2008-06-27 20:31 PDT, Oliver Hunt
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Stachowiak 2008-04-19 14:37:09 PDT
SquirrelFish does not support the timeouts and callbacks that trunk uses to implement the "slow script" dialog. We'll need this to work to merge to trunk.
Comment 1 Oliver Hunt 2008-05-15 02:32:38 PDT
Added for for, while, and do..while loops with
	M	JavaScriptCore/ChangeLog
	M	JavaScriptCore/VM/CodeBlock.cpp
	M	JavaScriptCore/VM/CodeGenerator.cpp
	M	JavaScriptCore/VM/CodeGenerator.h
	M	JavaScriptCore/VM/ExceptionHelpers.cpp
	M	JavaScriptCore/VM/ExceptionHelpers.h
	M	JavaScriptCore/VM/Machine.cpp
	M	JavaScriptCore/VM/Opcode.h
	M	JavaScriptCore/kjs/interpreter.cpp
	M	JavaScriptCore/kjs/nodes.cpp
	M	JavaScriptCore/kjs/object.h
Committed r33483

Comment 2 Oliver Hunt 2008-05-15 05:56:46 PDT
That patch caused an epic regression on cameron's system so i rolled it out in r33484
Comment 3 Oliver Hunt 2008-05-16 02:59:52 PDT
Created attachment 21200 [details]
Patch, regresses perf on some systems
Comment 4 Geoffrey Garen 2008-05-17 12:05:05 PDT
Olliej also mentioned that the existing patch doesn't fix for...in.
Comment 5 Geoffrey Garen 2008-05-17 12:06:12 PDT
I'm working on this now.
Comment 6 Geoffrey Garen 2008-05-19 12:02:00 PDT
Oliver's patch measured as a 1.0% regression on my system.

I changed it to use a local variable, like so:

        ++count;
        if (UNLIKELY(count == THRESHOLD)) {
            exceptionValue = createInterruptedExecutionException(exec);
            goto vm_throw;
        }

(This isn't completely correct -- it's just a prototype.)

That got the regression down to 0.2%.

So, I think we could improve things by using a local variable in the common case, and only consulting the global object when the local variable reached some threshold.
Comment 7 Geoffrey Garen 2008-05-19 21:25:43 PDT
Back to Oliver.
Comment 8 Oliver Hunt 2008-05-20 01:45:32 PDT
Created attachment 21250 [details]
More complete version patch

This still regresses perf on some systems, but it doesn't on my system, so i can't do an further work on this :-(
Comment 9 Oliver Hunt 2008-06-27 20:31:44 PDT
Created attachment 21979 [details]
Final (hopefully) patch
Comment 10 Oliver Hunt 2008-06-27 21:03:09 PDT
Comment on attachment 21979 [details]
Final (hopefully) patch

Reviewed by Sam
Comment 11 Oliver Hunt 2008-06-27 21:03:21 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	JavaScriptCore/ChangeLog
	M	JavaScriptCore/JavaScriptCore.exp
	M	JavaScriptCore/VM/CodeBlock.cpp
	M	JavaScriptCore/VM/CodeGenerator.cpp
	M	JavaScriptCore/VM/ExceptionHelpers.cpp
	M	JavaScriptCore/VM/ExceptionHelpers.h
	M	JavaScriptCore/VM/LabelID.h
	M	JavaScriptCore/VM/Machine.cpp
	M	JavaScriptCore/VM/Machine.h
	M	JavaScriptCore/VM/Opcode.cpp
	M	JavaScriptCore/VM/Opcode.h
	M	JavaScriptCore/kjs/JSGlobalObject.cpp
	M	JavaScriptCore/kjs/JSGlobalObject.h
	M	JavaScriptCore/kjs/JSObject.h
	M	JavaScriptCore/kjs/interpreter.cpp
Committed r34842

Comment 12 Geoffrey Garen 2008-06-27 21:11:02 PDT
Woohoo!