Changeset 60967 in webkit


Ignore:
Timestamp:
Jun 10, 2010 11:53:20 AM (14 years ago)
Author:
kbr@google.com
Message:

2010-06-09 Kenneth Russell <kbr@google.com>

Reviewed by Dimitri Glazkov.

Implement TypedArray BYTES_PER_ELEMENT
https://bugs.webkit.org/show_bug.cgi?id=39100

Implemented BYTES_PER_ELEMENT on all ArrayBufferView subclasses.
Required bug fixes to JSC bindings' custom constructors. Updated
fast/canvas/webgl/array-unit-tests.html to verify. Ran all WebGL
layout tests in Safari and Chromium.

  • bindings/js/JSFloat32ArrayConstructor.cpp: (WebCore::JSFloat32ArrayConstructor::JSFloat32ArrayConstructor): (WebCore::JSFloat32ArrayConstructor::getOwnPropertySlot): (WebCore::JSFloat32ArrayConstructor::getOwnPropertyDescriptor):
  • bindings/js/JSFloat32ArrayConstructor.h: (WebCore::JSFloat32ArrayConstructor::createStructure):
  • bindings/js/JSInt16ArrayConstructor.cpp: (WebCore::JSInt16ArrayConstructor::JSInt16ArrayConstructor): (WebCore::JSInt16ArrayConstructor::getOwnPropertySlot): (WebCore::JSInt16ArrayConstructor::getOwnPropertyDescriptor):
  • bindings/js/JSInt16ArrayConstructor.h: (WebCore::JSInt16ArrayConstructor::createStructure):
  • bindings/js/JSInt32ArrayConstructor.cpp: (WebCore::JSInt32ArrayConstructor::JSInt32ArrayConstructor): (WebCore::JSInt32ArrayConstructor::getOwnPropertySlot): (WebCore::JSInt32ArrayConstructor::getOwnPropertyDescriptor):
  • bindings/js/JSInt32ArrayConstructor.h: (WebCore::JSInt32ArrayConstructor::createStructure):
  • bindings/js/JSInt8ArrayConstructor.cpp: (WebCore::JSInt8ArrayConstructor::JSInt8ArrayConstructor): (WebCore::JSInt8ArrayConstructor::getOwnPropertySlot): (WebCore::JSInt8ArrayConstructor::getOwnPropertyDescriptor):
  • bindings/js/JSInt8ArrayConstructor.h: (WebCore::JSInt8ArrayConstructor::createStructure):
  • bindings/js/JSUint16ArrayConstructor.cpp: (WebCore::JSUint16ArrayConstructor::JSUint16ArrayConstructor): (WebCore::JSUint16ArrayConstructor::getOwnPropertySlot): (WebCore::JSUint16ArrayConstructor::getOwnPropertyDescriptor):
  • bindings/js/JSUint16ArrayConstructor.h: (WebCore::JSUint16ArrayConstructor::createStructure):
  • bindings/js/JSUint32ArrayConstructor.cpp: (WebCore::JSUint32ArrayConstructor::JSUint32ArrayConstructor): (WebCore::JSUint32ArrayConstructor::getOwnPropertySlot): (WebCore::JSUint32ArrayConstructor::getOwnPropertyDescriptor):
  • bindings/js/JSUint32ArrayConstructor.h: (WebCore::JSUint32ArrayConstructor::createStructure):
  • bindings/js/JSUint8ArrayConstructor.cpp: (WebCore::JSUint8ArrayConstructor::JSUint8ArrayConstructor): (WebCore::JSUint8ArrayConstructor::getOwnPropertySlot): (WebCore::JSUint8ArrayConstructor::getOwnPropertyDescriptor):
  • bindings/js/JSUint8ArrayConstructor.h: (WebCore::JSUint8ArrayConstructor::createStructure):
  • html/canvas/Float32Array.idl:
  • html/canvas/Int16Array.idl:
  • html/canvas/Int32Array.idl:
  • html/canvas/Int8Array.idl:
  • html/canvas/Uint16Array.idl:
  • html/canvas/Uint32Array.idl:
  • html/canvas/Uint8Array.idl:

2010-06-09 Kenneth Russell <kbr@google.com>

Reviewed by Dimitri Glazkov.

Implement TypedArray BYTES_PER_ELEMENT
https://bugs.webkit.org/show_bug.cgi?id=39100

Implemented BYTES_PER_ELEMENT on all ArrayBufferView subclasses.
Required bug fixes to JSC bindings' custom constructors. Updated
fast/canvas/webgl/array-unit-tests.html to verify. Ran all WebGL
layout tests in Safari and Chromium.

  • fast/canvas/webgl/array-unit-tests.html:
Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r60966 r60967  
     12010-06-09  Kenneth Russell  <kbr@google.com>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        Implement TypedArray BYTES_PER_ELEMENT
     6        https://bugs.webkit.org/show_bug.cgi?id=39100
     7
     8        Implemented BYTES_PER_ELEMENT on all ArrayBufferView subclasses.
     9        Required bug fixes to JSC bindings' custom constructors. Updated
     10        fast/canvas/webgl/array-unit-tests.html to verify. Ran all WebGL
     11        layout tests in Safari and Chromium.
     12
     13        * fast/canvas/webgl/array-unit-tests.html:
     14
    1152010-06-10  Eric Seidel  <eric@webkit.org>
    216
  • trunk/LayoutTests/fast/canvas/webgl/array-unit-tests.html

    r60902 r60967  
    174174  try {
    175175    var len = 10;
     176    assertEq('type.BYTES_PER_ELEMENT', elementSizeInBytes, type.BYTES_PER_ELEMENT);
    176177    var array = new type(len);
    177178    assert('array.buffer', array.buffer);
    178     assertEq('array.byteOffset', array.byteOffset, 0);
    179     assertEq('array.length', array.length, len);
    180     assertEq('array.byteLength', array.byteLength, len * elementSizeInBytes);
     179    assertEq('array.byteOffset', 0, array.byteOffset);
     180    assertEq('array.length', len, array.length);
     181    assertEq('array.byteLength', len * elementSizeInBytes, array.byteLength);
    181182    array = new type(array.buffer, elementSizeInBytes, len - 1);
    182183    assert('array.buffer', array.buffer);
    183     assertEq('array.byteOffset', array.byteOffset, elementSizeInBytes);
    184     assertEq('array.length', array.length, len - 1);
    185     assertEq('array.byteLength', array.byteLength, (len - 1) * elementSizeInBytes);
     184    assertEq('array.byteOffset', elementSizeInBytes, array.byteOffset);
     185    assertEq('array.length', len - 1, array.length);
     186    assertEq('array.byteLength', (len - 1) * elementSizeInBytes, array.byteLength);
    186187    pass();
    187188  } catch (e) {
  • trunk/WebCore/ChangeLog

    r60966 r60967  
     12010-06-09  Kenneth Russell  <kbr@google.com>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        Implement TypedArray BYTES_PER_ELEMENT
     6        https://bugs.webkit.org/show_bug.cgi?id=39100
     7
     8        Implemented BYTES_PER_ELEMENT on all ArrayBufferView subclasses.
     9        Required bug fixes to JSC bindings' custom constructors. Updated
     10        fast/canvas/webgl/array-unit-tests.html to verify. Ran all WebGL
     11        layout tests in Safari and Chromium.
     12
     13        * bindings/js/JSFloat32ArrayConstructor.cpp:
     14        (WebCore::JSFloat32ArrayConstructor::JSFloat32ArrayConstructor):
     15        (WebCore::JSFloat32ArrayConstructor::getOwnPropertySlot):
     16        (WebCore::JSFloat32ArrayConstructor::getOwnPropertyDescriptor):
     17        * bindings/js/JSFloat32ArrayConstructor.h:
     18        (WebCore::JSFloat32ArrayConstructor::createStructure):
     19        * bindings/js/JSInt16ArrayConstructor.cpp:
     20        (WebCore::JSInt16ArrayConstructor::JSInt16ArrayConstructor):
     21        (WebCore::JSInt16ArrayConstructor::getOwnPropertySlot):
     22        (WebCore::JSInt16ArrayConstructor::getOwnPropertyDescriptor):
     23        * bindings/js/JSInt16ArrayConstructor.h:
     24        (WebCore::JSInt16ArrayConstructor::createStructure):
     25        * bindings/js/JSInt32ArrayConstructor.cpp:
     26        (WebCore::JSInt32ArrayConstructor::JSInt32ArrayConstructor):
     27        (WebCore::JSInt32ArrayConstructor::getOwnPropertySlot):
     28        (WebCore::JSInt32ArrayConstructor::getOwnPropertyDescriptor):
     29        * bindings/js/JSInt32ArrayConstructor.h:
     30        (WebCore::JSInt32ArrayConstructor::createStructure):
     31        * bindings/js/JSInt8ArrayConstructor.cpp:
     32        (WebCore::JSInt8ArrayConstructor::JSInt8ArrayConstructor):
     33        (WebCore::JSInt8ArrayConstructor::getOwnPropertySlot):
     34        (WebCore::JSInt8ArrayConstructor::getOwnPropertyDescriptor):
     35        * bindings/js/JSInt8ArrayConstructor.h:
     36        (WebCore::JSInt8ArrayConstructor::createStructure):
     37        * bindings/js/JSUint16ArrayConstructor.cpp:
     38        (WebCore::JSUint16ArrayConstructor::JSUint16ArrayConstructor):
     39        (WebCore::JSUint16ArrayConstructor::getOwnPropertySlot):
     40        (WebCore::JSUint16ArrayConstructor::getOwnPropertyDescriptor):
     41        * bindings/js/JSUint16ArrayConstructor.h:
     42        (WebCore::JSUint16ArrayConstructor::createStructure):
     43        * bindings/js/JSUint32ArrayConstructor.cpp:
     44        (WebCore::JSUint32ArrayConstructor::JSUint32ArrayConstructor):
     45        (WebCore::JSUint32ArrayConstructor::getOwnPropertySlot):
     46        (WebCore::JSUint32ArrayConstructor::getOwnPropertyDescriptor):
     47        * bindings/js/JSUint32ArrayConstructor.h:
     48        (WebCore::JSUint32ArrayConstructor::createStructure):
     49        * bindings/js/JSUint8ArrayConstructor.cpp:
     50        (WebCore::JSUint8ArrayConstructor::JSUint8ArrayConstructor):
     51        (WebCore::JSUint8ArrayConstructor::getOwnPropertySlot):
     52        (WebCore::JSUint8ArrayConstructor::getOwnPropertyDescriptor):
     53        * bindings/js/JSUint8ArrayConstructor.h:
     54        (WebCore::JSUint8ArrayConstructor::createStructure):
     55        * html/canvas/Float32Array.idl:
     56        * html/canvas/Int16Array.idl:
     57        * html/canvas/Int32Array.idl:
     58        * html/canvas/Int8Array.idl:
     59        * html/canvas/Uint16Array.idl:
     60        * html/canvas/Uint32Array.idl:
     61        * html/canvas/Uint8Array.idl:
     62
    1632010-06-10  Eric Seidel  <eric@webkit.org>
    264
  • trunk/WebCore/bindings/js/JSFloat32ArrayConstructor.cpp

    r60902 r60967  
    4646    : DOMConstructorObject(JSFloat32ArrayConstructor::createStructure(globalObject->objectPrototype()), globalObject)
    4747{
    48     putDirect(exec->propertyNames().prototype, JSFloat32ArrayPrototype::self(exec, globalObject), None);
    49     putDirect(exec->propertyNames().length, jsNumber(exec, 2), ReadOnly|DontDelete|DontEnum);
     48    putDirect(exec->propertyNames().prototype, JSFloat32ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
     49}
     50
     51JSObject* JSFloat32ArrayConstructor::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
     52{
     53    return new (exec) JSFloat32ArrayPrototype(globalObject, JSFloat32ArrayPrototype::createStructure(globalObject->objectPrototype()));
     54}
     55
     56bool JSFloat32ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     57{
     58    return getStaticValueSlot<JSFloat32ArrayConstructor, DOMObject>(exec, JSFloat32ArrayPrototype::s_info.staticPropHashTable, this, propertyName, slot);
     59}
     60
     61bool JSFloat32ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     62{
     63    return getStaticValueDescriptor<JSFloat32ArrayConstructor, DOMObject>(exec, JSFloat32ArrayPrototype::s_info.staticPropHashTable, this, propertyName, descriptor);
    5064}
    5165
  • trunk/WebCore/bindings/js/JSFloat32ArrayConstructor.h

    r60902 r60967  
    3333
    3434    class JSFloat32ArrayConstructor : public DOMConstructorObject {
     35        typedef DOMConstructorObject Base;
    3536    public:
    3637        JSFloat32ArrayConstructor(JSC::ExecState*, JSDOMGlobalObject*);
     38        static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
     39        virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
     40        virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
    3741        static const JSC::ClassInfo s_info;
     42
     43        static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
     44        {
     45            return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
     46        }
    3847
    3948    private:
    4049        virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
    4150        virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
     51    protected:
     52        static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
    4253    };
    4354
  • trunk/WebCore/bindings/js/JSInt16ArrayConstructor.cpp

    r60708 r60967  
    4747    : DOMConstructorObject(JSInt16ArrayConstructor::createStructure(globalObject->objectPrototype()), globalObject)
    4848{
    49     putDirect(exec->propertyNames().prototype, JSInt16ArrayPrototype::self(exec, globalObject), None);
    50     putDirect(exec->propertyNames().length, jsNumber(exec, 2), ReadOnly|DontDelete|DontEnum);
     49    putDirect(exec->propertyNames().prototype, JSInt16ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
     50}
     51
     52JSObject* JSInt16ArrayConstructor::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
     53{
     54    return new (exec) JSInt16ArrayPrototype(globalObject, JSInt16ArrayPrototype::createStructure(globalObject->objectPrototype()));
     55}
     56
     57bool JSInt16ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     58{
     59    return getStaticValueSlot<JSInt16ArrayConstructor, DOMObject>(exec, JSInt16ArrayPrototype::s_info.staticPropHashTable, this, propertyName, slot);
     60}
     61
     62bool JSInt16ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     63{
     64    return getStaticValueDescriptor<JSInt16ArrayConstructor, DOMObject>(exec, JSInt16ArrayPrototype::s_info.staticPropHashTable, this, propertyName, descriptor);
    5165}
    5266
  • trunk/WebCore/bindings/js/JSInt16ArrayConstructor.h

    r59499 r60967  
    3333
    3434    class JSInt16ArrayConstructor : public DOMConstructorObject {
     35        typedef DOMConstructorObject Base;
    3536    public:
    3637        JSInt16ArrayConstructor(JSC::ExecState*, JSDOMGlobalObject*);
     38        static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
     39        virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
     40        virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
    3741        static const JSC::ClassInfo s_info;
     42
     43        static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
     44        {
     45            return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
     46        }
    3847
    3948    private:
    4049        virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
    4150        virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
     51    protected:
     52        static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
    4253    };
    4354
  • trunk/WebCore/bindings/js/JSInt32ArrayConstructor.cpp

    r60708 r60967  
    4646    : DOMConstructorObject(JSInt32ArrayConstructor::createStructure(globalObject->objectPrototype()), globalObject)
    4747{
    48     putDirect(exec->propertyNames().prototype, JSInt32ArrayPrototype::self(exec, globalObject), None);
    49     putDirect(exec->propertyNames().length, jsNumber(exec, 2), ReadOnly|DontDelete|DontEnum);
     48    putDirect(exec->propertyNames().prototype, JSInt32ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
     49}
     50
     51JSObject* JSInt32ArrayConstructor::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
     52{
     53    return new (exec) JSInt32ArrayPrototype(globalObject, JSInt32ArrayPrototype::createStructure(globalObject->objectPrototype()));
     54}
     55
     56bool JSInt32ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     57{
     58    return getStaticValueSlot<JSInt32ArrayConstructor, DOMObject>(exec, JSInt32ArrayPrototype::s_info.staticPropHashTable, this, propertyName, slot);
     59}
     60
     61bool JSInt32ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     62{
     63    return getStaticValueDescriptor<JSInt32ArrayConstructor, DOMObject>(exec, JSInt32ArrayPrototype::s_info.staticPropHashTable, this, propertyName, descriptor);
    5064}
    5165
  • trunk/WebCore/bindings/js/JSInt32ArrayConstructor.h

    r59499 r60967  
    3333
    3434    class JSInt32ArrayConstructor : public DOMConstructorObject {
     35        typedef DOMConstructorObject Base;
    3536    public:
    3637        JSInt32ArrayConstructor(JSC::ExecState*, JSDOMGlobalObject*);
     38        static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
     39        virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
     40        virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
    3741        static const JSC::ClassInfo s_info;
     42
     43        static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
     44        {
     45            return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
     46        }
    3847
    3948    private:
    4049        virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
    4150        virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
     51    protected:
     52        static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
    4253    };
    4354
  • trunk/WebCore/bindings/js/JSInt8ArrayConstructor.cpp

    r60708 r60967  
    4646    : DOMConstructorObject(JSInt8ArrayConstructor::createStructure(globalObject->objectPrototype()), globalObject)
    4747{
    48     putDirect(exec->propertyNames().prototype, JSInt8ArrayPrototype::self(exec, globalObject), None);
    49     putDirect(exec->propertyNames().length, jsNumber(exec, 2), ReadOnly|DontDelete|DontEnum);
     48    putDirect(exec->propertyNames().prototype, JSInt8ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
     49}
     50
     51JSObject* JSInt8ArrayConstructor::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
     52{
     53    return new (exec) JSInt8ArrayPrototype(globalObject, JSInt8ArrayPrototype::createStructure(globalObject->objectPrototype()));
     54}
     55
     56bool JSInt8ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     57{
     58    return getStaticValueSlot<JSInt8ArrayConstructor, DOMObject>(exec, JSInt8ArrayPrototype::s_info.staticPropHashTable, this, propertyName, slot);
     59}
     60
     61bool JSInt8ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     62{
     63    return getStaticValueDescriptor<JSInt8ArrayConstructor, DOMObject>(exec, JSInt8ArrayPrototype::s_info.staticPropHashTable, this, propertyName, descriptor);
    5064}
    5165
  • trunk/WebCore/bindings/js/JSInt8ArrayConstructor.h

    r59499 r60967  
    3333
    3434    class JSInt8ArrayConstructor : public DOMConstructorObject {
     35        typedef DOMConstructorObject Base;
    3536    public:
    3637        JSInt8ArrayConstructor(JSC::ExecState*, JSDOMGlobalObject*);
     38        static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
     39        virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
     40        virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
    3741        static const JSC::ClassInfo s_info;
     42
     43        static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
     44        {
     45            return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
     46        }
    3847
    3948    private:
    4049        virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
    4150        virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
     51    protected:
     52        static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
    4253    };
    4354
  • trunk/WebCore/bindings/js/JSUint16ArrayConstructor.cpp

    r60708 r60967  
    4646    : DOMConstructorObject(JSUint16ArrayConstructor::createStructure(globalObject->objectPrototype()), globalObject)
    4747{
    48     putDirect(exec->propertyNames().prototype, JSUint16ArrayPrototype::self(exec, globalObject), None);
    49     putDirect(exec->propertyNames().length, jsNumber(exec, 2), ReadOnly|DontDelete|DontEnum);
     48    putDirect(exec->propertyNames().prototype, JSUint16ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
     49}
     50
     51JSObject* JSUint16ArrayConstructor::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
     52{
     53    return new (exec) JSUint16ArrayPrototype(globalObject, JSUint16ArrayPrototype::createStructure(globalObject->objectPrototype()));
     54}
     55
     56bool JSUint16ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     57{
     58    return getStaticValueSlot<JSUint16ArrayConstructor, DOMObject>(exec, JSUint16ArrayPrototype::s_info.staticPropHashTable, this, propertyName, slot);
     59}
     60
     61bool JSUint16ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     62{
     63    return getStaticValueDescriptor<JSUint16ArrayConstructor, DOMObject>(exec, JSUint16ArrayPrototype::s_info.staticPropHashTable, this, propertyName, descriptor);
    5064}
    5165
  • trunk/WebCore/bindings/js/JSUint16ArrayConstructor.h

    r59499 r60967  
    3333
    3434    class JSUint16ArrayConstructor : public DOMConstructorObject {
     35        typedef DOMConstructorObject Base;
    3536    public:
    3637        JSUint16ArrayConstructor(JSC::ExecState*, JSDOMGlobalObject*);
     38        static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
     39        virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
     40        virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
    3741        static const JSC::ClassInfo s_info;
     42
     43        static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
     44        {
     45            return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
     46        }
    3847
    3948    private:
    4049        virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
    4150        virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
     51    protected:
     52        static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
    4253    };
    4354
  • trunk/WebCore/bindings/js/JSUint32ArrayConstructor.cpp

    r60708 r60967  
    4646    : DOMConstructorObject(JSUint32ArrayConstructor::createStructure(globalObject->objectPrototype()), globalObject)
    4747{
    48     putDirect(exec->propertyNames().prototype, JSUint32ArrayPrototype::self(exec, globalObject), None);
    49     putDirect(exec->propertyNames().length, jsNumber(exec, 2), ReadOnly|DontDelete|DontEnum);
     48    putDirect(exec->propertyNames().prototype, JSUint32ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
     49}
     50
     51JSObject* JSUint32ArrayConstructor::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
     52{
     53    return new (exec) JSUint32ArrayPrototype(globalObject, JSUint32ArrayPrototype::createStructure(globalObject->objectPrototype()));
     54}
     55
     56bool JSUint32ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     57{
     58    return getStaticValueSlot<JSUint32ArrayConstructor, DOMObject>(exec, JSUint32ArrayPrototype::s_info.staticPropHashTable, this, propertyName, slot);
     59}
     60
     61bool JSUint32ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     62{
     63    return getStaticValueDescriptor<JSUint32ArrayConstructor, DOMObject>(exec, JSUint32ArrayPrototype::s_info.staticPropHashTable, this, propertyName, descriptor);
    5064}
    5165
  • trunk/WebCore/bindings/js/JSUint32ArrayConstructor.h

    r59499 r60967  
    3333
    3434    class JSUint32ArrayConstructor : public DOMConstructorObject {
     35        typedef DOMConstructorObject Base;
    3536    public:
    3637        JSUint32ArrayConstructor(JSC::ExecState*, JSDOMGlobalObject*);
     38        static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
     39        virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
     40        virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
    3741        static const JSC::ClassInfo s_info;
     42
     43        static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
     44        {
     45            return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
     46        }
    3847
    3948    private:
    4049        virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
    4150        virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
     51    protected:
     52        static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
    4253    };
    4354
  • trunk/WebCore/bindings/js/JSUint8ArrayConstructor.cpp

    r60708 r60967  
    4747    : DOMConstructorObject(JSUint8ArrayConstructor::createStructure(globalObject->objectPrototype()), globalObject)
    4848{
    49     putDirect(exec->propertyNames().prototype, JSUint8ArrayPrototype::self(exec, globalObject), None);
    50     putDirect(exec->propertyNames().length, jsNumber(exec, 2), ReadOnly|DontDelete|DontEnum);
     49    putDirect(exec->propertyNames().prototype, JSUint8ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
     50}
     51
     52JSObject* JSUint8ArrayConstructor::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
     53{
     54    return new (exec) JSUint8ArrayPrototype(globalObject, JSUint8ArrayPrototype::createStructure(globalObject->objectPrototype()));
     55}
     56
     57bool JSUint8ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     58{
     59    return getStaticValueSlot<JSUint8ArrayConstructor, DOMObject>(exec, JSUint8ArrayPrototype::s_info.staticPropHashTable, this, propertyName, slot);
     60}
     61
     62bool JSUint8ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     63{
     64    return getStaticValueDescriptor<JSUint8ArrayConstructor, DOMObject>(exec, JSUint8ArrayPrototype::s_info.staticPropHashTable, this, propertyName, descriptor);
    5165}
    5266
  • trunk/WebCore/bindings/js/JSUint8ArrayConstructor.h

    r59499 r60967  
    3333
    3434    class JSUint8ArrayConstructor : public DOMConstructorObject {
     35        typedef DOMConstructorObject Base;
    3536    public:
    3637        JSUint8ArrayConstructor(JSC::ExecState*, JSDOMGlobalObject*);
     38        static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
     39        virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
     40        virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
    3741        static const JSC::ClassInfo s_info;
     42
     43        static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
     44        {
     45            return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
     46        }
    3847
    3948    private:
    4049        virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
    4150        virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
     51    protected:
     52        static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
    4253    };
    4354
  • trunk/WebCore/html/canvas/Float32Array.idl

    r60902 r60967  
    3434        CustomToJS
    3535    ] Float32Array : ArrayBufferView {
     36        const unsigned int BYTES_PER_ELEMENT = 4;
     37
    3638        // void set(in Float32Array array, [Optional] in unsigned long offset);
    3739        // void set(in sequence<long> array, [Optional] in unsigned long offset);
  • trunk/WebCore/html/canvas/Int16Array.idl

    r59499 r60967  
    3333        CustomToJS
    3434    ] Int16Array : ArrayBufferView {
     35        const unsigned int BYTES_PER_ELEMENT = 2;
     36
    3537        // void set(in Int16Array array, [Optional] in unsigned long offset);
    3638        // void set(in sequence<long> array, [Optional] in unsigned long offset);
  • trunk/WebCore/html/canvas/Int32Array.idl

    r59499 r60967  
    3434        CustomToJS
    3535    ] Int32Array : ArrayBufferView {
     36        const unsigned int BYTES_PER_ELEMENT = 4;
     37
    3638        // void set(in Int32Array array, [Optional] in unsigned long offset);
    3739        // void set(in sequence<long> array, [Optional] in unsigned long offset);
  • trunk/WebCore/html/canvas/Int8Array.idl

    r59499 r60967  
    3434        CustomToJS
    3535    ] Int8Array : ArrayBufferView {
     36        const unsigned int BYTES_PER_ELEMENT = 1;
     37
    3638        // void set(in Int8Array array, [Optional] in unsigned long offset);
    3739        // void set(in sequence<long> array, [Optional] in unsigned long offset);
  • trunk/WebCore/html/canvas/Uint16Array.idl

    r59499 r60967  
    3434        CustomToJS
    3535    ] Uint16Array : ArrayBufferView {
     36        const unsigned int BYTES_PER_ELEMENT = 2;
     37
    3638        // void set(in Uint16Array array, [Optional] in unsigned long offset);
    3739        // void set(in sequence<long> array, [Optional] in unsigned long offset);
  • trunk/WebCore/html/canvas/Uint32Array.idl

    r59499 r60967  
    3434        CustomToJS
    3535    ] Uint32Array : ArrayBufferView {
     36        const unsigned int BYTES_PER_ELEMENT = 4;
     37
    3638        // void set(in Uint32Array array, [Optional] in unsigned long offset);
    3739        // void set(in sequence<long> array, [Optional] in unsigned long offset);
  • trunk/WebCore/html/canvas/Uint8Array.idl

    r59499 r60967  
    3434        CustomToJS
    3535    ] Uint8Array : ArrayBufferView {
     36        const unsigned int BYTES_PER_ELEMENT = 1;
     37
    3638        // void set(in Uint8Array array, [Optional] in unsigned long offset);
    3739        // void set(in sequence<long> array, [Optional] in unsigned long offset);
Note: See TracChangeset for help on using the changeset viewer.