Ignore:
Timestamp:
Feb 22, 2016, 12:07:50 PM (9 years ago)
Author:
[email protected]
Message:

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):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r196722 r196950  
    294294    struct TypedArrayData {
    295295        WriteBarrier<JSObject> prototype;
     296        WriteBarrier<InternalFunction> constructor;
    296297        WriteBarrier<Structure> structure;
    297298    };
     
    582583    }
    583584
     585    JSObject* typedArrayConstructor(TypedArrayType type) const
     586    {
     587        return m_typedArrays[toIndex(type)].constructor.get();
     588    }
     589
    584590    JSCell* actualPointerFor(Special::Pointer pointer)
    585591    {
Note: See TracChangeset for help on using the changeset viewer.