REGRESSION (r174226): Header on huffingtonpost.com is too large
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jan 2015 19:38:21 +0000 (19:38 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jan 2015 19:38:21 +0000 (19:38 +0000)
commitb0ddaf1236c8f2c02bee1a576646ce8cc07c1999
tree8294bc7d9da45d8ef0c28295559467f7fbbaa90a
parent451118442b83943aee82748a93b8c60bfd02bb26
REGRESSION (r174226): Header on huffingtonpost.com is too large
https://bugs.webkit.org/show_bug.cgi?id=140306

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

BytecodeGenerator::willResolveToArguments() is used to check to see if we can use the
arguments register or whether we need to resolve "arguments".  If the arguments have
been captured, then they are stored in the lexical environment and the arguments
register is not used.
Changed BytecodeGenerator::willResolveToArguments() to also check to see if the arguments
register is captured.  Renamed the function to willResolveToArgumentsRegister() to
better indicate what we are checking.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::willResolveToArgumentsRegister):
(JSC::BytecodeGenerator::uncheckedLocalArgumentsRegister):
(JSC::BytecodeGenerator::emitCall):
(JSC::BytecodeGenerator::emitConstruct):
(JSC::BytecodeGenerator::emitEnumeration):
(JSC::BytecodeGenerator::willResolveToArguments): Deleted.
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::BracketAccessorNode::emitBytecode):
(JSC::DotAccessorNode::emitBytecode):
(JSC::getArgumentByVal):
(JSC::ApplyFunctionCallDotNode::emitBytecode):
(JSC::ArrayPatternNode::emitDirectBinding):

LayoutTests:

Updated js/arguments-iterator to test changing argument to array values.
Removed tests that changed arguments to a string and an object as they were
bogus and didn't test what the appeared to test.
for .. of works on iterable objects only.

Added new regression test, js/regress-140306.

* js/arguments-iterator-expected.txt:
* js/regress-140306-expected.txt: Added.
* js/regress-140306.html: Added.
* js/script-tests/arguments-iterator.js:
(testEmptyArrayArguments):
(testArrayArguments):
(testOverwrittenArguments): Deleted.
(testNullArguments): Deleted.
(testNonArrayLikeArguments): Deleted.
* js/script-tests/regress-140306.js: Added.
(checkArgs):
(applyToArgs):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178432 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/arguments-iterator-expected.txt
LayoutTests/js/regress-140306-expected.txt [new file with mode: 0644]
LayoutTests/js/regress-140306.html [new file with mode: 0644]
LayoutTests/js/script-tests/arguments-iterator.js
LayoutTests/js/script-tests/regress-140306.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp