Bug 62920

Summary: JSONP is unnecessarily slow
Product: WebKit Reporter: Oliver Hunt <oliver>
Component: New BugsAssignee: Oliver Hunt <oliver>
Status: RESOLVED FIXED    
Severity: Normal CC: ossy, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 62927    
Bug Blocks:    
Attachments:
Description Flags
Patch none

Description Oliver Hunt 2011-06-17 18:11:20 PDT
JSONP is unnecessarily slow
Comment 1 Oliver Hunt 2011-06-17 18:17:16 PDT
Created attachment 97677 [details]
Patch
Comment 2 Gavin Barraclough 2011-06-17 18:37:30 PDT
Comment on attachment 97677 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=97677&action=review

R+, with changes above.

> Source/JavaScriptCore/interpreter/Interpreter.cpp:766
> +            JSValue baseObject(globalObject);

Please either (1) make this throw the correct errors, or (2) file a bug, add a comment with the bug number here.

> Source/JavaScriptCore/runtime/LiteralParser.cpp:227
> +            return TokAssign;

TokSemi!

> Source/JavaScriptCore/runtime/LiteralParser.cpp:230
> +            while (m_ptr < m_end && (isASCIIAlphanumeric(*m_ptr) || *m_ptr == '_' || *m_ptr == '$'))

I think this while loop is double-checking the identifier start? - not a bug per se, but I think you could add an increment to m_ptr prior to the while & skip a redundant check.
Comment 3 Oliver Hunt 2011-06-17 21:27:28 PDT
Committed r89184: <http://trac.webkit.org/changeset/89184>
Comment 5 Oliver Hunt 2011-06-19 12:50:03 PDT
Committed r89219: <http://trac.webkit.org/changeset/89219>
Comment 6 Ryosuke Niwa 2011-06-19 19:49:37 PDT
fast/workers/worker-script-error.html is failing on all bots:
http://build.webkit.org/results/SnowLeopard%20Intel%20Release%20(Tests)/r89219%20(30527)/fast/workers/worker-script-error-pretty-diff.html

-PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1.
-PASS: event listener invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1.
+PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 0.
+PASS: event listener invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 0.

This is change intentional?
Comment 7 Oliver Hunt 2011-06-19 19:58:29 PDT
(In reply to comment #6)
> fast/workers/worker-script-error.html is failing on all bots:
> http://build.webkit.org/results/SnowLeopard%20Intel%20Release%20(Tests)/r89219%20(30527)/fast/workers/worker-script-error-pretty-diff.html
> 
> -PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1.
> -PASS: event listener invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1.
> +PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 0.
> +PASS: event listener invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 0.
> 
> This is change intentional?

No. fixed.