Skip to content

Commit 03f5e79

Browse files
committed
Fixed up all Array types to use GlobalDataHelper.h; removed missing WebCore references
1 parent d24a0d9 commit 03f5e79

24 files changed

+201
-185
lines changed

JavaScriptCore/runtime/TypedArrays/JSFloat64Array.cpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
#include "config.h"
2222
#include "JSFloat64Array.h"
2323

24-
#include "ExceptionCode.h"
25-
#include "JSDOMBinding.h"
24+
#include "Lookup.h"
25+
#include "GlobalDataHelper.h"
26+
2627
#include "JSFloat64Array.h"
2728
#include <runtime/Error.h>
2829
#include <runtime/PropertyNameArray.h>
@@ -55,27 +56,28 @@ static const HashTableValue JSFloat64ArrayConstructorTableValues[] =
5556
static const HashTable JSFloat64ArrayConstructorTable = { 2, 1, JSFloat64ArrayConstructorTableValues, 0 };
5657
const ClassInfo JSFloat64ArrayConstructor::s_info = { "Float64ArrayConstructor", &Base::s_info, &JSFloat64ArrayConstructorTable, 0, CREATE_METHOD_TABLE(JSFloat64ArrayConstructor) };
5758

58-
JSFloat64ArrayConstructor::JSFloat64ArrayConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
59-
: DOMConstructorObject(structure, globalObject)
59+
JSFloat64ArrayConstructor::JSFloat64ArrayConstructor(Structure* structure, JSC::JSGlobalObject* globalObject)
60+
: InternalFunction(globalObject, structure)
6061
{
6162
}
6263

63-
void JSFloat64ArrayConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
64+
void JSFloat64ArrayConstructor::finishCreation(ExecState* exec, JSC::JSGlobalObject* globalObject)
6465
{
65-
Base::finishCreation(exec->globalData());
66+
JSC::JSObject * proto = JSFloat64ArrayPrototype::self(exec, globalObject);
67+
Base::finishCreation(exec->globalData(), Identifier(exec, proto->classInfo()->className));
6668
ASSERT(inherits(&s_info));
67-
putDirect(exec->globalData(), exec->propertyNames().prototype, JSFloat64ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
69+
putDirect(exec->globalData(), exec->propertyNames().prototype, proto, DontDelete | ReadOnly);
6870
putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum);
6971
}
7072

7173
bool JSFloat64ArrayConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
7274
{
73-
return getStaticValueSlot<JSFloat64ArrayConstructor, JSDOMWrapper>(exec, &JSFloat64ArrayConstructorTable, jsCast<JSFloat64ArrayConstructor*>(cell), propertyName, slot);
75+
return getStaticFunctionSlot<InternalFunction>(exec, &JSFloat64ArrayConstructorTable, jsCast<JSFloat64ArrayConstructor*>(cell), propertyName, slot);
7476
}
7577

7678
bool JSFloat64ArrayConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
7779
{
78-
return getStaticValueDescriptor<JSFloat64ArrayConstructor, JSDOMWrapper>(exec, &JSFloat64ArrayConstructorTable, jsCast<JSFloat64ArrayConstructor*>(object), propertyName, descriptor);
80+
return getStaticFunctionDescriptor<InternalFunction>(exec, &JSFloat64ArrayConstructorTable, jsCast<JSFloat64ArrayConstructor*>(object), propertyName, descriptor);
7981
}
8082

8183
ConstructType JSFloat64ArrayConstructor::getConstructData(JSCell*, ConstructData& constructData)
@@ -104,7 +106,7 @@ const ClassInfo JSFloat64ArrayPrototype::s_info = { "Float64ArrayPrototype", &Ba
104106

105107
JSObject* JSFloat64ArrayPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
106108
{
107-
return getDOMPrototype<JSFloat64Array>(exec, globalObject);
109+
return getDOMPrototype<JSFloat64ArrayPrototype>(exec, globalObject);
108110
}
109111

110112
bool JSFloat64ArrayPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
@@ -126,7 +128,7 @@ static const HashTable* getJSFloat64ArrayTable(ExecState* exec)
126128

127129
const ClassInfo JSFloat64Array::s_info = { "Float64Array", &Base::s_info, 0, getJSFloat64ArrayTable , CREATE_METHOD_TABLE(JSFloat64Array) };
128130

129-
JSFloat64Array::JSFloat64Array(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<Float64Array> impl)
131+
JSFloat64Array::JSFloat64Array(Structure* structure, JSGlobalObject* globalObject, PassRefPtr<Float64Array> impl)
130132
: JSArrayBufferView(structure, globalObject, impl)
131133
{
132134
}
@@ -231,7 +233,7 @@ void JSFloat64Array::getOwnPropertyNames(JSObject* object, ExecState* exec, Prop
231233

232234
JSValue JSFloat64Array::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
233235
{
234-
return getDOMConstructor<JSFloat64ArrayConstructor>(exec, jsCast<JSDOMGlobalObject*>(globalObject));
236+
return getDOMConstructor<JSFloat64ArrayConstructor>(exec, jsCast<JSGlobalObject*>(globalObject));
235237
}
236238

237239
EncodedJSValue JSC_HOST_CALL jsFloat64ArrayPrototypeFunctionSubarray(ExecState* exec)

JavaScriptCore/runtime/TypedArrays/JSFloat64Array.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#define JSFloat64Array_h
2323

2424
#include "JSArrayBufferView.h"
25-
#include "JSDOMBinding.h"
25+
#include "InternalFunction.h"
2626
#include <runtime/JSObject.h>
2727
#include <wtf/Float64Array.h>
2828

@@ -31,7 +31,7 @@ namespace WebCore {
3131
class JSFloat64Array : public JSArrayBufferView {
3232
public:
3333
typedef JSArrayBufferView Base;
34-
static JSFloat64Array* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<Float64Array> impl)
34+
static JSFloat64Array* create(JSC::Structure* structure, JSC::JSGlobalObject* globalObject, PassRefPtr<Float64Array> impl)
3535
{
3636
JSFloat64Array* ptr = new (NotNull, JSC::allocateCell<JSFloat64Array>(globalObject->globalData().heap)) JSFloat64Array(structure, globalObject, impl);
3737
ptr->finishCreation(globalObject->globalData());
@@ -64,14 +64,14 @@ class JSFloat64Array : public JSArrayBufferView {
6464
intptr_t m_storageLength;
6565
void* m_storage;
6666
protected:
67-
JSFloat64Array(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<Float64Array>);
67+
JSFloat64Array(JSC::Structure*, JSC::JSGlobalObject*, PassRefPtr<Float64Array>);
6868
void finishCreation(JSC::JSGlobalData&);
6969
static const unsigned StructureFlags = JSC::OverridesGetPropertyNames | JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
7070
JSC::JSValue getByIndex(JSC::ExecState*, unsigned index);
7171
void indexSetter(JSC::ExecState*, unsigned index, JSC::JSValue);
7272
};
7373

74-
JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, Float64Array*);
74+
JSC::JSValue toJS(JSC::ExecState*, JSC::JSGlobalObject*, Float64Array*);
7575
Float64Array* toFloat64Array(JSC::JSValue);
7676

7777
class JSFloat64ArrayPrototype : public JSC::JSNonFinalObject {
@@ -99,14 +99,14 @@ class JSFloat64ArrayPrototype : public JSC::JSNonFinalObject {
9999
static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
100100
};
101101

102-
class JSFloat64ArrayConstructor : public DOMConstructorObject {
102+
class JSFloat64ArrayConstructor : public JSC::InternalFunction {
103103
private:
104-
JSFloat64ArrayConstructor(JSC::Structure*, JSDOMGlobalObject*);
105-
void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
104+
JSFloat64ArrayConstructor(JSC::Structure*, JSC::JSGlobalObject*);
105+
void finishCreation(JSC::ExecState*, JSC::JSGlobalObject*);
106106

107107
public:
108-
typedef DOMConstructorObject Base;
109-
static JSFloat64ArrayConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
108+
typedef JSC::InternalFunction Base;
109+
static JSFloat64ArrayConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSC::JSGlobalObject* globalObject)
110110
{
111111
JSFloat64ArrayConstructor* ptr = new (NotNull, JSC::allocateCell<JSFloat64ArrayConstructor>(*exec->heap())) JSFloat64ArrayConstructor(structure, globalObject);
112112
ptr->finishCreation(exec, globalObject);
@@ -121,7 +121,7 @@ class JSFloat64ArrayConstructor : public DOMConstructorObject {
121121
return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
122122
}
123123
protected:
124-
static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
124+
static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | JSC::InternalFunction::StructureFlags;
125125
static JSC::EncodedJSValue JSC_HOST_CALL constructJSFloat64Array(JSC::ExecState*);
126126
static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
127127
};

JavaScriptCore/runtime/TypedArrays/JSFloat64ArrayCustom.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void JSFloat64Array::indexSetter(JSC::ExecState* exec, unsigned index, JSC::JSVa
3838
impl()->set(index, value.toNumber(exec));
3939
}
4040

41-
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Float64Array* object)
41+
JSC::JSValue toJS(JSC::ExecState* exec, JSGlobalObject* globalObject, Float64Array* object)
4242
{
4343
return toJSArrayBufferView<JSFloat64Array>(exec, globalObject, object);
4444
}

JavaScriptCore/runtime/TypedArrays/JSInt16Array.cpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
#include "config.h"
2222
#include "JSInt16Array.h"
2323

24-
#include "ExceptionCode.h"
25-
#include "JSDOMBinding.h"
24+
#include "Lookup.h"
25+
#include "GlobalDataHelper.h"
26+
2627
#include "JSInt16Array.h"
2728
#include <runtime/Error.h>
2829
#include <runtime/PropertyNameArray.h>
@@ -55,27 +56,28 @@ static const HashTableValue JSInt16ArrayConstructorTableValues[] =
5556
static const HashTable JSInt16ArrayConstructorTable = { 2, 1, JSInt16ArrayConstructorTableValues, 0 };
5657
const ClassInfo JSInt16ArrayConstructor::s_info = { "Int16ArrayConstructor", &Base::s_info, &JSInt16ArrayConstructorTable, 0, CREATE_METHOD_TABLE(JSInt16ArrayConstructor) };
5758

58-
JSInt16ArrayConstructor::JSInt16ArrayConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
59-
: DOMConstructorObject(structure, globalObject)
59+
JSInt16ArrayConstructor::JSInt16ArrayConstructor(Structure* structure, JSGlobalObject* globalObject)
60+
: InternalFunction(globalObject, structure)
6061
{
6162
}
6263

63-
void JSInt16ArrayConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
64+
void JSInt16ArrayConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject)
6465
{
65-
Base::finishCreation(exec->globalData());
66+
JSC::JSObject * proto = JSInt16ArrayPrototype::self(exec, globalObject);
67+
Base::finishCreation(exec->globalData(), Identifier(exec, proto->classInfo()->className));
6668
ASSERT(inherits(&s_info));
67-
putDirect(exec->globalData(), exec->propertyNames().prototype, JSInt16ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
69+
putDirect(exec->globalData(), exec->propertyNames().prototype, proto, DontDelete | ReadOnly);
6870
putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum);
6971
}
7072

7173
bool JSInt16ArrayConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
7274
{
73-
return getStaticValueSlot<JSInt16ArrayConstructor, JSDOMWrapper>(exec, &JSInt16ArrayConstructorTable, jsCast<JSInt16ArrayConstructor*>(cell), propertyName, slot);
75+
return getStaticFunctionSlot<InternalFunction>(exec, &JSInt16ArrayConstructorTable, jsCast<JSInt16ArrayConstructor*>(cell), propertyName, slot);
7476
}
7577

7678
bool JSInt16ArrayConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
7779
{
78-
return getStaticValueDescriptor<JSInt16ArrayConstructor, JSDOMWrapper>(exec, &JSInt16ArrayConstructorTable, jsCast<JSInt16ArrayConstructor*>(object), propertyName, descriptor);
80+
return getStaticFunctionDescriptor<InternalFunction>(exec, &JSInt16ArrayConstructorTable, jsCast<JSInt16ArrayConstructor*>(object), propertyName, descriptor);
7981
}
8082

8183
ConstructType JSInt16ArrayConstructor::getConstructData(JSCell*, ConstructData& constructData)
@@ -104,7 +106,7 @@ const ClassInfo JSInt16ArrayPrototype::s_info = { "Int16ArrayPrototype", &Base::
104106

105107
JSObject* JSInt16ArrayPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
106108
{
107-
return getDOMPrototype<JSInt16Array>(exec, globalObject);
109+
return getDOMPrototype<JSInt16ArrayPrototype>(exec, globalObject);
108110
}
109111

110112
bool JSInt16ArrayPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
@@ -126,7 +128,7 @@ static const HashTable* getJSInt16ArrayTable(ExecState* exec)
126128

127129
const ClassInfo JSInt16Array::s_info = { "Int16Array", &Base::s_info, 0, getJSInt16ArrayTable , CREATE_METHOD_TABLE(JSInt16Array) };
128130

129-
JSInt16Array::JSInt16Array(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<Int16Array> impl)
131+
JSInt16Array::JSInt16Array(Structure* structure, JSGlobalObject* globalObject, PassRefPtr<Int16Array> impl)
130132
: JSArrayBufferView(structure, globalObject, impl)
131133
{
132134
}
@@ -231,7 +233,7 @@ void JSInt16Array::getOwnPropertyNames(JSObject* object, ExecState* exec, Proper
231233

232234
JSValue JSInt16Array::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
233235
{
234-
return getDOMConstructor<JSInt16ArrayConstructor>(exec, jsCast<JSDOMGlobalObject*>(globalObject));
236+
return getDOMConstructor<JSInt16ArrayConstructor>(exec, jsCast<JSGlobalObject*>(globalObject));
235237
}
236238

237239
EncodedJSValue JSC_HOST_CALL jsInt16ArrayPrototypeFunctionSubarray(ExecState* exec)

JavaScriptCore/runtime/TypedArrays/JSInt16Array.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#define JSInt16Array_h
2323

2424
#include "JSArrayBufferView.h"
25-
#include "JSDOMBinding.h"
25+
#include "InternalFunction.h"
2626
#include <runtime/JSObject.h>
2727
#include <wtf/Int16Array.h>
2828

@@ -31,7 +31,7 @@ namespace WebCore {
3131
class JSInt16Array : public JSArrayBufferView {
3232
public:
3333
typedef JSArrayBufferView Base;
34-
static JSInt16Array* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<Int16Array> impl)
34+
static JSInt16Array* create(JSC::Structure* structure, JSC::JSGlobalObject* globalObject, PassRefPtr<Int16Array> impl)
3535
{
3636
JSInt16Array* ptr = new (NotNull, JSC::allocateCell<JSInt16Array>(globalObject->globalData().heap)) JSInt16Array(structure, globalObject, impl);
3737
ptr->finishCreation(globalObject->globalData());
@@ -64,14 +64,14 @@ class JSInt16Array : public JSArrayBufferView {
6464
intptr_t m_storageLength;
6565
void* m_storage;
6666
protected:
67-
JSInt16Array(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<Int16Array>);
67+
JSInt16Array(JSC::Structure*, JSC::JSGlobalObject*, PassRefPtr<Int16Array>);
6868
void finishCreation(JSC::JSGlobalData&);
6969
static const unsigned StructureFlags = JSC::OverridesGetPropertyNames | JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
7070
JSC::JSValue getByIndex(JSC::ExecState*, unsigned index);
7171
void indexSetter(JSC::ExecState*, unsigned index, JSC::JSValue);
7272
};
7373

74-
JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, Int16Array*);
74+
JSC::JSValue toJS(JSC::ExecState*, JSC::JSGlobalObject*, Int16Array*);
7575
Int16Array* toInt16Array(JSC::JSValue);
7676

7777
class JSInt16ArrayPrototype : public JSC::JSNonFinalObject {
@@ -99,14 +99,14 @@ class JSInt16ArrayPrototype : public JSC::JSNonFinalObject {
9999
static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
100100
};
101101

102-
class JSInt16ArrayConstructor : public DOMConstructorObject {
102+
class JSInt16ArrayConstructor : public JSC::InternalFunction {
103103
private:
104-
JSInt16ArrayConstructor(JSC::Structure*, JSDOMGlobalObject*);
105-
void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
104+
JSInt16ArrayConstructor(JSC::Structure*, JSC::JSGlobalObject*);
105+
void finishCreation(JSC::ExecState*, JSC::JSGlobalObject*);
106106

107107
public:
108-
typedef DOMConstructorObject Base;
109-
static JSInt16ArrayConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
108+
typedef JSC::InternalFunction Base;
109+
static JSInt16ArrayConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSC::JSGlobalObject* globalObject)
110110
{
111111
JSInt16ArrayConstructor* ptr = new (NotNull, JSC::allocateCell<JSInt16ArrayConstructor>(*exec->heap())) JSInt16ArrayConstructor(structure, globalObject);
112112
ptr->finishCreation(exec, globalObject);
@@ -121,7 +121,7 @@ class JSInt16ArrayConstructor : public DOMConstructorObject {
121121
return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
122122
}
123123
protected:
124-
static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
124+
static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | JSC::InternalFunction::StructureFlags;
125125
static JSC::EncodedJSValue JSC_HOST_CALL constructJSInt16Array(JSC::ExecState*);
126126
static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
127127
};

JavaScriptCore/runtime/TypedArrays/JSInt16ArrayCustom.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void JSInt16Array::indexSetter(JSC::ExecState* exec, unsigned index, JSC::JSValu
3838
impl()->set(index, static_cast<signed short>(value.toInt32(exec)));
3939
}
4040

41-
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Int16Array* object)
41+
JSC::JSValue toJS(JSC::ExecState* exec, JSGlobalObject* globalObject, Int16Array* object)
4242
{
4343
return toJSArrayBufferView<JSInt16Array>(exec, globalObject, object);
4444
}

0 commit comments

Comments
 (0)