Ignore:
Timestamp:
Sep 5, 2013, 10:50:33 PM (12 years ago)
Author:
[email protected]
Message:

Make it simpler to introduce new data types to the global object
https://bugs.webkit.org/show_bug.cgi?id=120801

Reviewed by Gavin Barraclough.

Add an iterator macro that lists all the "simple" ES types (e.g. type
consists of instance, constructor, and prototype classes). So that
we don't need to have every new type litter JSGlobalObject.{cpp,h} with
members, accessors, and manual GC visiting.

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::visitChildren):

  • runtime/JSGlobalObject.h:
Location:
trunk/Source/JavaScriptCore/runtime
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp

    r154127 r155177  
    5454}
    5555
    56 JSArrayBufferConstructor* JSArrayBufferConstructor::create(
    57     JSGlobalObject* globalObject, Structure* structure, JSArrayBufferPrototype* prototype)
     56JSArrayBufferConstructor* JSArrayBufferConstructor::create(CallFrame* callFrame, JSGlobalObject* globalObject, Structure* structure, JSArrayBufferPrototype* prototype)
    5857{
    59     VM& vm = globalObject->vm();
     58    VM& vm = callFrame->vm();
    6059    JSArrayBufferConstructor* result =
    6160        new (NotNull, allocateCell<JSArrayBufferConstructor>(vm.heap))
  • trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.h

    r154127 r155177  
    4242
    4343public:
    44     static JSArrayBufferConstructor* create(JSGlobalObject*, Structure*, JSArrayBufferPrototype*);
     44    static JSArrayBufferConstructor* create(CallFrame*, JSGlobalObject*, Structure*, JSArrayBufferPrototype*);
    4545   
    4646    DECLARE_INFO;
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r154916 r155177  
    242242    m_functionPrototype->structure()->setPrototypeWithoutTransition(exec->vm(), m_objectPrototype.get());
    243243   
    244     m_arrayBufferPrototype.set(exec->vm(), this, JSArrayBufferPrototype::create(exec, this, JSArrayBufferPrototype::createStructure(exec->vm(), this, m_objectPrototype.get())));
    245244    m_typedArrays[toIndex(TypeInt8)].prototype.set(exec->vm(), this, JSInt8ArrayPrototype::create(exec, this, JSInt8ArrayPrototype::createStructure(exec->vm(), this, m_objectPrototype.get())));
    246245    m_typedArrays[toIndex(TypeInt16)].prototype.set(exec->vm(), this, JSInt16ArrayPrototype::create(exec, this, JSInt16ArrayPrototype::createStructure(exec->vm(), this, m_objectPrototype.get())));
     
    254253    m_typedArrays[toIndex(TypeDataView)].prototype.set(exec->vm(), this, JSDataViewPrototype::create(exec->vm(), JSDataViewPrototype::createStructure(exec->vm(), this, m_objectPrototype.get())));
    255254   
    256     m_arrayBufferStructure.set(exec->vm(), this, JSArrayBuffer::createStructure(exec->vm(), this, m_arrayBufferPrototype.get()));
    257255    m_typedArrays[toIndex(TypeInt8)].structure.set(exec->vm(), this, JSInt8Array::createStructure(exec->vm(), this, m_typedArrays[toIndex(TypeInt8)].prototype.get()));
    258256    m_typedArrays[toIndex(TypeInt16)].structure.set(exec->vm(), this, JSInt16Array::createStructure(exec->vm(), this, m_typedArrays[toIndex(TypeInt16)].prototype.get()));
     
    295293    m_regExpMatchesArrayStructure.set(exec->vm(), this, RegExpMatchesArray::createStructure(exec->vm(), this, m_arrayPrototype.get()));
    296294
    297     m_stringPrototype.set(exec->vm(), this, StringPrototype::create(exec, this, StringPrototype::createStructure(exec->vm(), this, m_objectPrototype.get())));
    298     m_stringObjectStructure.set(exec->vm(), this, StringObject::createStructure(exec->vm(), this, m_stringPrototype.get()));
    299 
    300     m_booleanPrototype.set(exec->vm(), this, BooleanPrototype::create(exec, this, BooleanPrototype::createStructure(exec->vm(), this, m_objectPrototype.get())));
    301     m_booleanObjectStructure.set(exec->vm(), this, BooleanObject::createStructure(exec->vm(), this, m_booleanPrototype.get()));
    302 
    303     m_numberPrototype.set(exec->vm(), this, NumberPrototype::create(exec, this, NumberPrototype::createStructure(exec->vm(), this, m_objectPrototype.get())));
    304     m_numberObjectStructure.set(exec->vm(), this, NumberObject::createStructure(exec->vm(), this, m_numberPrototype.get()));
    305 
    306     m_datePrototype.set(exec->vm(), this, DatePrototype::create(exec, this, DatePrototype::createStructure(exec->vm(), this, m_objectPrototype.get())));
    307     m_dateStructure.set(exec->vm(), this, DateInstance::createStructure(exec->vm(), this, m_datePrototype.get()));
    308 
    309295    RegExp* emptyRegex = RegExp::create(exec->vm(), "", NoFlags);
    310296   
    311297    m_regExpPrototype.set(exec->vm(), this, RegExpPrototype::create(exec, this, RegExpPrototype::createStructure(exec->vm(), this, m_objectPrototype.get()), emptyRegex));
    312298    m_regExpStructure.set(exec->vm(), this, RegExpObject::createStructure(exec->vm(), this, m_regExpPrototype.get()));
    313 
    314     m_errorPrototype.set(exec->vm(), this, ErrorPrototype::create(exec, this, ErrorPrototype::createStructure(exec->vm(), this, m_objectPrototype.get())));
    315     m_errorStructure.set(exec->vm(), this, ErrorInstance::createStructure(exec->vm(), this, m_errorPrototype.get()));
    316299
    317300#if ENABLE(PROMISES)
     
    327310
    328311    m_mapDataStructure.set(exec->vm(), this, MapData::createStructure(exec->vm(), this, jsNull()));
    329     m_mapPrototype.set(exec->vm(), this, MapPrototype::create(exec, this, MapPrototype::createStructure(exec->vm(), this, m_objectPrototype.get())));
    330     m_mapStructure.set(exec->vm(), this, JSMap::createStructure(exec->vm(), this, m_mapPrototype.get()));
    331 
    332     m_setPrototype.set(exec->vm(), this, SetPrototype::create(exec, this, SetPrototype::createStructure(exec->vm(), this, m_objectPrototype.get())));
    333     m_setStructure.set(exec->vm(), this, JSSet::createStructure(exec->vm(), this, m_setPrototype.get()));
     312
     313#define CREATE_PROTOTYPE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
     314    m_ ## lowerName ## Prototype.set(exec->vm(), this, capitalName##Prototype::create(exec, this, capitalName##Prototype::createStructure(exec->vm(), this, m_objectPrototype.get()))); \
     315    m_ ## properName ## Structure.set(exec->vm(), this, instanceType::createStructure(exec->vm(), this, m_ ## lowerName ## Prototype.get()));
     316
     317    FOR_EACH_SIMPLE_BUILTIN_TYPE(CREATE_PROTOTYPE_FOR_SIMPLE_TYPE)
     318
     319#undef CREATE_PROTOTYPE_FOR_SIMPLE_TYPE
    334320
    335321    // Constructors
     
    338324    JSCell* functionConstructor = FunctionConstructor::create(exec, this, FunctionConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_functionPrototype.get());
    339325    JSCell* arrayConstructor = ArrayConstructor::create(exec, this, ArrayConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_arrayPrototype.get());
    340     JSCell* stringConstructor = StringConstructor::create(exec, this, StringConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_stringPrototype.get());
    341     JSCell* booleanConstructor = BooleanConstructor::create(exec, this, BooleanConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_booleanPrototype.get());
    342     JSCell* numberConstructor = NumberConstructor::create(exec, this, NumberConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_numberPrototype.get());
    343     JSCell* dateConstructor = DateConstructor::create(exec, this, DateConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_datePrototype.get());
    344326
    345327#if ENABLE(PROMISES)
     
    347329    JSCell* promiseResolverConstructor = JSPromiseResolverConstructor::create(exec, this, JSPromiseResolverConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_promiseResolverPrototype.get());
    348330#endif // ENABLE(PROMISES)
    349     JSCell* mapConstructor = MapConstructor::create(exec, this, MapConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_mapPrototype.get());
    350     JSCell* setConstructor = SetConstructor::create(exec, this, SetConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_setPrototype.get());
    351331
    352332    m_regExpConstructor.set(exec->vm(), this, RegExpConstructor::create(exec, this, RegExpConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_regExpPrototype.get()));
    353333
    354     m_errorConstructor.set(exec->vm(), this, ErrorConstructor::create(exec, this, ErrorConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_errorPrototype.get()));
     334#define CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
     335    capitalName ## Constructor* lowerName ## Constructor = capitalName ## Constructor::create(exec, this, capitalName ## Constructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_ ## lowerName ## Prototype.get()); \
     336    m_ ## lowerName ## Prototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, lowerName ## Constructor, DontEnum); \
     337
     338    FOR_EACH_SIMPLE_BUILTIN_TYPE(CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE)
     339
     340#undef CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE
     341
     342    m_errorConstructor.set(exec->vm(), this, errorConstructor);
    355343
    356344    Structure* nativeErrorPrototypeStructure = NativeErrorPrototype::createStructure(exec->vm(), this, m_errorPrototype.get());
     
    366354    m_functionPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, functionConstructor, DontEnum);
    367355    m_arrayPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, arrayConstructor, DontEnum);
    368     m_booleanPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, booleanConstructor, DontEnum);
    369     m_stringPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, stringConstructor, DontEnum);
    370     m_numberPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, numberConstructor, DontEnum);
    371     m_datePrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, dateConstructor, DontEnum);
    372356    m_regExpPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, m_regExpConstructor.get(), DontEnum);
    373     m_errorPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, m_errorConstructor.get(), DontEnum);
    374357#if ENABLE(PROMISES)
    375358    m_promisePrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, promiseConstructor, DontEnum);
    376359    m_promiseResolverPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, promiseResolverConstructor, DontEnum);
    377360#endif
    378     m_mapPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, mapConstructor, DontEnum);
    379     m_setPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, setConstructor, DontEnum);
    380361
    381362    putDirectWithoutTransition(exec->vm(), exec->propertyNames().Object, objectConstructor, DontEnum);
    382363    putDirectWithoutTransition(exec->vm(), exec->propertyNames().Function, functionConstructor, DontEnum);
    383364    putDirectWithoutTransition(exec->vm(), exec->propertyNames().Array, arrayConstructor, DontEnum);
    384     putDirectWithoutTransition(exec->vm(), exec->propertyNames().Boolean, booleanConstructor, DontEnum);
    385     putDirectWithoutTransition(exec->vm(), exec->propertyNames().String, stringConstructor, DontEnum);
    386     putDirectWithoutTransition(exec->vm(), exec->propertyNames().Number, numberConstructor, DontEnum);
    387     putDirectWithoutTransition(exec->vm(), exec->propertyNames().Date, dateConstructor, DontEnum);
    388365    putDirectWithoutTransition(exec->vm(), exec->propertyNames().RegExp, m_regExpConstructor.get(), DontEnum);
    389     putDirectWithoutTransition(exec->vm(), exec->propertyNames().Error, m_errorConstructor.get(), DontEnum);
    390366    putDirectWithoutTransition(exec->vm(), exec->propertyNames().EvalError, m_evalErrorConstructor.get(), DontEnum);
    391367    putDirectWithoutTransition(exec->vm(), exec->propertyNames().RangeError, m_rangeErrorConstructor.get(), DontEnum);
     
    398374    putDirectWithoutTransition(exec->vm(), exec->propertyNames().PromiseResolver, promiseResolverConstructor, DontEnum);
    399375#endif
    400     putDirectWithoutTransition(exec->vm(), exec->propertyNames().Map, mapConstructor, DontEnum);
    401     putDirectWithoutTransition(exec->vm(), exec->propertyNames().Set, setConstructor, DontEnum);
     376
     377
     378#define PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
     379    putDirectWithoutTransition(exec->vm(), exec->propertyNames(). jsName, lowerName ## Constructor, DontEnum); \
     380
     381    FOR_EACH_SIMPLE_BUILTIN_TYPE(PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE)
     382
     383#undef PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE
     384
    402385
    403386    m_evalFunction.set(exec->vm(), this, JSFunction::create(exec, this, 1, exec->propertyNames().eval.string(), globalFuncEval));
     
    407390    putDirectWithoutTransition(exec->vm(), exec->propertyNames().Math, MathObject::create(exec, this, MathObject::createStructure(exec->vm(), this, m_objectPrototype.get())), DontEnum);
    408391   
    409     JSArrayBufferConstructor* arrayBufferConstructor = JSArrayBufferConstructor::create(this, JSArrayBufferConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_arrayBufferPrototype.get());
    410392    FixedArray<InternalFunction*, NUMBER_OF_TYPED_ARRAY_TYPES> typedArrayConstructors;
    411393    typedArrayConstructors[toIndex(TypeInt8)] = JSInt8ArrayConstructor::create(this, JSInt8ArrayConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt8)].prototype.get(), "Int8Array");
     
    419401    typedArrayConstructors[toIndex(TypeFloat64)] = JSFloat64ArrayConstructor::create(this, JSFloat64ArrayConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeFloat64)].prototype.get(), "Float64Array");
    420402    typedArrayConstructors[toIndex(TypeDataView)] = JSDataViewConstructor::create(this, JSDataViewConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeDataView)].prototype.get(), "DataView");
    421    
    422     m_arrayBufferPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, arrayBufferConstructor, DontEnum);
    423     putDirectWithoutTransition(exec->vm(), exec->propertyNames().ArrayBuffer, arrayBufferConstructor, DontEnum);
    424    
     403
    425404    for (unsigned typedArrayIndex = NUMBER_OF_TYPED_ARRAY_TYPES; typedArrayIndex--;) {
    426405        m_typedArrays[typedArrayIndex].prototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, typedArrayConstructors[typedArrayIndex], DontEnum);
     
    613592    visitor.append(&thisObject->m_functionPrototype);
    614593    visitor.append(&thisObject->m_arrayPrototype);
    615     visitor.append(&thisObject->m_booleanPrototype);
    616     visitor.append(&thisObject->m_stringPrototype);
    617     visitor.append(&thisObject->m_numberPrototype);
    618     visitor.append(&thisObject->m_datePrototype);
    619     visitor.append(&thisObject->m_regExpPrototype);
    620594    visitor.append(&thisObject->m_errorPrototype);
    621595#if ENABLE(PROMISES)
     
    641615    visitor.append(&thisObject->m_objcWrapperObjectStructure);
    642616#endif
    643     visitor.append(&thisObject->m_dateStructure);
    644617    visitor.append(&thisObject->m_nullPrototypeObjectStructure);
    645618    visitor.append(&thisObject->m_errorStructure);
     
    647620    visitor.append(&thisObject->m_boundFunctionStructure);
    648621    visitor.append(&thisObject->m_namedFunctionStructure);
    649     visitor.append(&thisObject->m_numberObjectStructure);
    650622    visitor.append(&thisObject->m_privateNameStructure);
    651623    visitor.append(&thisObject->m_regExpMatchesArrayStructure);
    652624    visitor.append(&thisObject->m_regExpStructure);
    653     visitor.append(&thisObject->m_stringObjectStructure);
    654625    visitor.append(&thisObject->m_internalFunctionStructure);
    655626
     
    660631    visitor.append(&thisObject->m_promiseWrapperCallbackStructure);
    661632#endif // ENABLE(PROMISES)
    662     visitor.append(&thisObject->m_mapPrototype);
     633
     634#define VISIT_SIMPLE_TYPE(CapitalName, lowerName, properName, instanceType, jsName) \
     635    visitor.append(&thisObject->m_ ## lowerName ## Prototype); \
     636    visitor.append(&thisObject->m_ ## properName ## Structure); \
     637
     638    FOR_EACH_SIMPLE_BUILTIN_TYPE(VISIT_SIMPLE_TYPE)
     639
     640#undef VISIT_SIMPLE_TYPE
     641
    663642    visitor.append(&thisObject->m_mapDataStructure);
    664     visitor.append(&thisObject->m_mapStructure);
    665     visitor.append(&thisObject->m_setPrototype);
    666     visitor.append(&thisObject->m_setStructure);
    667 
    668     visitor.append(&thisObject->m_arrayBufferPrototype);
    669     visitor.append(&thisObject->m_arrayBufferStructure);
    670    
     643
    671644    for (unsigned i = NUMBER_OF_TYPED_ARRAY_TYPES; i--;) {
    672645        visitor.append(&thisObject->m_typedArrays[i].prototype);
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r154916 r155177  
    4949class ArrayPrototype;
    5050class BooleanPrototype;
    51 class DatePrototype;
    5251class Debugger;
    5352class ErrorConstructor;
     
    6463class JSStack;
    6564class LLIntOffsetsExtractor;
    66 class MapPrototype;
    6765class NativeErrorConstructor;
    6866class ProgramCodeBlock;
     
    7068class RegExpConstructor;
    7169class RegExpPrototype;
    72 class SetPrototype;
    7370class SourceCode;
    7471struct ActivationStackNode;
    7572struct HashTable;
     73
     74#define FOR_EACH_SIMPLE_BUILTIN_TYPE(macro) \
     75    macro(Set, set, set, JSSet, Set) \
     76    macro(Map, map, map, JSMap, Map) \
     77    macro(Date, date, date, DateInstance, Date) \
     78    macro(String, string, stringObject, StringObject, String) \
     79    macro(Boolean, boolean, booleanObject, BooleanObject, Boolean) \
     80    macro(Number, number, numberObject, NumberObject, Number) \
     81    macro(Error, error, error, ErrorInstance, Error) \
     82    macro(JSArrayBuffer, arrayBuffer, arrayBuffer, JSArrayBuffer, ArrayBuffer) \
     83
     84#define DECLARE_SIMPLE_BUILTIN_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
     85    class JS ## capitalName; \
     86    class capitalName ## Prototype; \
     87    class capitalName ## Constructor;
     88
     89FOR_EACH_SIMPLE_BUILTIN_TYPE(DECLARE_SIMPLE_BUILTIN_TYPE)
     90
     91#undef DECLARE_SIMPLE_BUILTIN_TYPE
    7692
    7793typedef Vector<ExecState*, 16> ExecStateStack;
     
    145161    WriteBarrier<FunctionPrototype> m_functionPrototype;
    146162    WriteBarrier<ArrayPrototype> m_arrayPrototype;
    147     WriteBarrier<BooleanPrototype> m_booleanPrototype;
    148     WriteBarrier<StringPrototype> m_stringPrototype;
    149     WriteBarrier<NumberPrototype> m_numberPrototype;
    150     WriteBarrier<DatePrototype> m_datePrototype;
    151163    WriteBarrier<RegExpPrototype> m_regExpPrototype;
    152     WriteBarrier<ErrorPrototype> m_errorPrototype;
    153164    WriteBarrier<JSPromisePrototype> m_promisePrototype;
    154165    WriteBarrier<JSPromiseResolverPrototype> m_promiseResolverPrototype;
    155     WriteBarrier<MapPrototype> m_mapPrototype;
    156     WriteBarrier<SetPrototype> m_setPrototype;
    157166
    158167    WriteBarrier<Structure> m_withScopeStructure;
     
    166175    // Lists the structures we should use during allocation for these particular indexing shapes.
    167176    WriteBarrier<Structure> m_arrayStructureForIndexingShapeDuringAllocation[NumberOfIndexingShapes];
    168        
    169     WriteBarrier<Structure> m_booleanObjectStructure;
     177
    170178    WriteBarrier<Structure> m_callbackConstructorStructure;
    171179    WriteBarrier<Structure> m_callbackFunctionStructure;
     
    175183    WriteBarrier<Structure> m_objcWrapperObjectStructure;
    176184#endif
    177     WriteBarrier<Structure> m_dateStructure;
    178185    WriteBarrier<Structure> m_nullPrototypeObjectStructure;
    179     WriteBarrier<Structure> m_errorStructure;
    180186    WriteBarrier<Structure> m_functionStructure;
    181187    WriteBarrier<Structure> m_boundFunctionStructure;
    182188    WriteBarrier<Structure> m_namedFunctionStructure;
    183189    PropertyOffset m_functionNameOffset;
    184     WriteBarrier<Structure> m_numberObjectStructure;
    185190    WriteBarrier<Structure> m_privateNameStructure;
    186191    WriteBarrier<Structure> m_regExpMatchesArrayStructure;
    187192    WriteBarrier<Structure> m_regExpStructure;
    188     WriteBarrier<Structure> m_stringObjectStructure;
    189193    WriteBarrier<Structure> m_internalFunctionStructure;
    190194
     
    197201
    198202    WriteBarrier<Structure> m_mapDataStructure;
    199     WriteBarrier<Structure> m_mapStructure;
    200     WriteBarrier<Structure> m_setStructure;
    201    
    202     WriteBarrier<JSArrayBufferPrototype> m_arrayBufferPrototype;
    203     WriteBarrier<Structure> m_arrayBufferStructure;
    204    
     203
     204#define DEFINE_STORAGE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
     205    WriteBarrier<capitalName ## Prototype> m_ ## lowerName ## Prototype; \
     206    WriteBarrier<Structure> m_ ## properName ## Structure;
     207
     208    FOR_EACH_SIMPLE_BUILTIN_TYPE(DEFINE_STORAGE_FOR_SIMPLE_TYPE)
     209
     210#undef DEFINE_STORAGE_FOR_SIMPLE_TYPE
     211
    205212    struct TypedArrayData {
    206213        WriteBarrier<JSObject> prototype;
     
    405412
    406413    JSArrayBufferPrototype* arrayBufferPrototype() const { return m_arrayBufferPrototype.get(); }
    407     Structure* arrayBufferStructure() const { return m_arrayBufferStructure.get(); }
    408    
     414
     415#define DEFINE_ACCESSORS_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
     416    Structure* properName ## Structure() { return m_ ## properName ## Structure.get(); }
     417
     418    FOR_EACH_SIMPLE_BUILTIN_TYPE(DEFINE_ACCESSORS_FOR_SIMPLE_TYPE)
     419
     420#undef DEFINE_ACCESSORS_FOR_SIMPLE_TYPE
     421
    409422    Structure* typedArrayStructure(TypedArrayType type) const
    410423    {
Note: See TracChangeset for help on using the changeset viewer.