[JSC] ArrayPatternNode::emitDirectBinding does not return assignment target value...
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Jun 2018 10:05:50 +0000 (10:05 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Jun 2018 10:05:50 +0000 (10:05 +0000)
commit9a106aa5c6360a7ec6aae431a5759ef98c6698b9
tree7f4fae32da1a951e1ae2bb57f6fa9f6e47289778
parentf76f8fd8310ad95e834c1f64c22f9ed827444ff1
[JSC] ArrayPatternNode::emitDirectBinding does not return assignment target value if dst is nullptr
https://bugs.webkit.org/show_bug.cgi?id=185943

Reviewed by Mark Lam.

JSTests:

* stress/direct-binding-return-result.js: Added.
(shouldBe):
(test):

Source/JavaScriptCore:

ArrayPatternNode::emitDirectBinding should return a register with an assignment target instead of filling
the result with undefined if `dst` is nullptr. While `dst == ignoredResult()` means we do not require
the result, `dst == nullptr` just means "dst is required, but a register for dst is not allocated.".
This patch fixes emitDirectBinding to return an appropriate value with an allocated register for dst.

ArrayPatternNode::emitDirectBinding() should be removed later since it does not follow array spreading protocol,
but it should be done in a separate patch since it would be performance sensitive.

* bytecompiler/NodesCodegen.cpp:
(JSC::ArrayPatternNode::emitDirectBinding):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/direct-binding-return-result.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp