Commit 5f5c48da authored by littledan's avatar littledan Committed by Commit bot

Revert removal of TypedArray constructor optimization

When the TypedArray iterator constructor code path was added, a technically
incorrect optimization was added which uses the arraylike code path on array
arguments, even though the %ArrayIterator% could have been monkey-patched
to give different behavior. A previous patch removed this optimization, and
this patch restores it due to the huge performance regression that resulted.

The optimization was previously removed in
https://codereview.chromium.org/1767893002

BUG=chromium:593644
R=adamk
LOG=Y

Review URL: https://codereview.chromium.org/1779373002

Cr-Commit-Position: refs/heads/master@{#34697}
parent c91faa0b
......@@ -270,7 +270,7 @@ function NAMEConstructor(arg1, arg2, arg3) {
NAMEConstructByTypedArray(this, arg1);
} else {
var iteratorFn = arg1[iteratorSymbol];
if (IS_UNDEFINED(iteratorFn)) {
if (IS_UNDEFINED(iteratorFn) || iteratorFn === ArrayValues) {
NAMEConstructByArrayLike(this, arg1, arg1.length);
} else {
NAMEConstructByIterable(this, arg1, iteratorFn);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment