Use Symbol.species in the builtin TypedArray.prototype functions
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Feb 2016 20:07:50 +0000 (20:07 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Feb 2016 20:07:50 +0000 (20:07 +0000)
commit48b3717c2cdd9d09602aecea0bbd911b21292d86
tree8e192161181a8ee54694678c4fa7022f767c5d27
parentb873000807075b7e8b02733df19fce19f9fd8012
Use Symbol.species in the builtin TypedArray.prototype functions
https://bugs.webkit.org/show_bug.cgi?id=153384

Reviewed by Geoffrey Garen.

This patch adds the use of species constructors to the TypedArray.prototype map and filter
functions. It also adds a new private function typedArrayGetOriginalConstructor that
returns the TypedArray constructor used to originally create a TypedArray instance.

There are no ES6 tests to update for this patch as species creation for these functions is
not tested in the compatibility table.

* builtins/TypedArrayPrototype.js:
(map):
(filter):
* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
* bytecode/BytecodeIntrinsicRegistry.h:
* runtime/CommonIdentifiers.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::typedArrayConstructor):
* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::typedArrayViewPrivateFuncGetOriginalConstructor):
* runtime/JSTypedArrayViewPrototype.h:
* tests/stress/typedarray-filter.js:
(subclasses.typedArrays.map):
(prototype.accept):
(testSpecies):
(accept):
(forEach):
(subclasses.forEach):
(testSpeciesRemoveConstructor):
* tests/stress/typedarray-map.js:
(subclasses.typedArrays.map):
(prototype.id):
(testSpecies):
(id):
(forEach):
(subclasses.forEach):
(testSpeciesRemoveConstructor):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196950 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/builtins/TypedArrayPrototype.js
Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.cpp
Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.h
Source/JavaScriptCore/runtime/CommonIdentifiers.h
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp
Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.h
Source/JavaScriptCore/tests/stress/typedarray-filter.js
Source/JavaScriptCore/tests/stress/typedarray-map.js