RESOLVED FIXED 28209
Restrict use of FuncDeclNode & FuncExprNode to the parser.
https://bugs.webkit.org/show_bug.cgi?id=28209
Summary Restrict use of FuncDeclNode & FuncExprNode to the parser.
Gavin Barraclough
Reported 2009-08-11 19:43:30 PDT
These objects were also being referenced from the CodeBlock. By changing this to just retain pointers to FunctionBodyNodes these classes can be restricted to use during parsing.
Attachments
The Patch. (28.74 KB, patch)
2009-08-11 19:50 PDT, Gavin Barraclough
no flags
Gavin Barraclough
Comment 1 2009-08-11 19:50:54 PDT
Created attachment 34633 [details] The Patch.
Gavin Barraclough
Comment 2 2009-08-11 22:34:44 PDT
Sending JavaScriptCore/ChangeLog Sending JavaScriptCore/JavaScriptCore.exp Sending JavaScriptCore/bytecode/CodeBlock.cpp Sending JavaScriptCore/bytecode/CodeBlock.h Sending JavaScriptCore/bytecompiler/BytecodeGenerator.cpp Sending JavaScriptCore/bytecompiler/BytecodeGenerator.h Sending JavaScriptCore/interpreter/Interpreter.cpp Sending JavaScriptCore/jit/JITOpcodes.cpp Sending JavaScriptCore/jit/JITStubs.cpp Sending JavaScriptCore/jit/JITStubs.h Sending JavaScriptCore/parser/Grammar.y Sending JavaScriptCore/parser/NodeConstructors.h Sending JavaScriptCore/parser/Nodes.cpp Sending JavaScriptCore/parser/Nodes.h Sending JavaScriptCore/runtime/JSFunction.h Sending WebCore/ChangeLog Sending WebCore/inspector/JavaScriptDebugServer.cpp Sending WebKitTools/Scripts/run-javascriptcore-tests Transmitting file data .................. Committed revision 47089. Sending JavaScriptCore/ChangeLog Sending JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def Sending JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def Transmitting file data ... Committed revision 47090.
Kenneth Rohde Christiansen
Comment 3 2009-08-12 08:20:45 PDT
Hi there, You commit https://trac.webkit.org/changeset/47089 JavaScriptCore: Restrict use of FuncDeclNode & FuncExprNode to the parser. https://bugs.webkit.org/show_bug.cgi?id=28209 seems to break the fast/js tests for Qt 64bit linux. The tests breaking are: fast/js/const.html expected fast/js/exception-thrown-from-function-with-lazy-activation.html fast/js/function-call-register-allocation.html fast/js/function-dot-arguments-and-caller.html fast/js/named-function-expression.html fast/js/static-scope-object.html plugins/netscape-invoke-default.html Cheers, Kenneth
Kenneth Rohde Christiansen
Comment 4 2009-08-12 10:18:32 PDT
Here you have the diffs of the failing tests fast/js/const.html -PASS f() is f +FAIL f() should be function g() { g="FAIL"; return g; } (of type function). Was FAIL (of type string). fast/js/exception-thrown-from-function-with-lazy-activation.html -PASS: args[0] should be 1 and is. +FAIL: args[0] should be 1 but instead is undefined. fast/js/function-call-register-allocation.html -PASS: Recursion did not run out of stack space. +FAIL: Recursion threw an exception: ReferenceError: Can't find variable: f fast/js/function-dot-arguments-and-caller.html -PASS,PASS,PASS,PASS,PASS,PASS,PASS,PASS,PASS,PASS,PASS,PASS,PASS,PASS,PASS,PASS,PASS fast/js/named-function-expression.html -PASS var z = 10; var x = eval('(function Named(a,b){ return (!!Named) ? (a + b + z) : -999; })'); x(4,5) is 19 +FAIL var z = 10; var x = eval('(function Named(a,b){ return (!!Named) ? (a + b + z) : -999; })'); x(4,5) should -PASS var ctr = 3; var x = (function Named(a,b){ if(--ctr) return 2 * Named(a,b); else return a + b; }); x(5,6) is 44 +FAIL var ctr = 3; var x = (function Named(a,b){ if(--ctr) return 2 * Named(a,b); else return a + b; }); x(5,6) should be 44. Threw exception ReferenceError: Can't find variable: Named fast/js/static-scope-object.html -PASS namedFunctionExpression() is globalObject +FAIL namedFunctionExpression() should be the global object. Threw exception ReferenceError: Can't find variable: f plugins/netscape-invoke-default.html This tests that it's possible to call NPN_InvokeDefault on a JavaScript object. If this test succeeded, the text "SUCCESS" should be shown below. -SUCCESS +FAILURE
Gavin Barraclough
Comment 5 2009-08-12 10:47:50 PDT
Gah, sorry, it looks like I've broken the interpreter, can repro on Mac with the JIT disabled. Will investigate, & will roll the change out if I can't fix this quickly.
Eric Seidel (no email)
Comment 6 2009-08-12 15:33:06 PDT
I can't tell if this is still pending commit. But I think it's not supposed to be, or?
Gavin Barraclough
Comment 7 2009-08-12 15:35:54 PDT
I'm not sure I understand your question. :-) This patch is committed, currently pending decommit.
Eric Seidel (no email)
Comment 8 2009-08-12 15:37:21 PDT
Comment on attachment 34633 [details] The Patch. Ok. Removing the r+ to remove it from the to-be-committed list.
Gavin Barraclough
Comment 9 2009-08-12 15:42:31 PDT
Hmmm, is removing the r+ flag a good idea? :-/ Are we not losing the information from bugzilla as to who reviewed the patch, and which patches have been approved? What problem is this solving, does this related to the commit queue? If so, it seems the commit queue shouldn't care about this bug, since it was not added to the queue. If there is a problem, are we solving it in the right way here? - does the review queue mechanism need to be smarter? (Apologies if I'm just misunderstanding something here). cheers, G.
Gavin Barraclough
Comment 11 2009-08-12 15:58:18 PDT
Ah, I see. Fair enough. :-)
Gavin Barraclough
Comment 12 2009-08-12 22:28:55 PDT
Sorry about that, should be fixed now in r47183.
Note You need to log in before you can comment on or make changes to this bug.