diff options
Diffstat (limited to 'Source/JavaScriptCore/runtime/ClassInfo.h')
-rw-r--r-- | Source/JavaScriptCore/runtime/ClassInfo.h | 76 |
1 files changed, 40 insertions, 36 deletions
diff --git a/Source/JavaScriptCore/runtime/ClassInfo.h b/Source/JavaScriptCore/runtime/ClassInfo.h index af1d71e13..84fc11a3c 100644 --- a/Source/JavaScriptCore/runtime/ClassInfo.h +++ b/Source/JavaScriptCore/runtime/ClassInfo.h @@ -25,11 +25,12 @@ #include "CallFrame.h" #include "ConstructData.h" +#include "CopyToken.h" #include "JSCell.h" namespace JSC { -class HashEntry; +class JSArrayBufferView; struct HashTable; struct MethodTable { @@ -39,7 +40,7 @@ struct MethodTable { typedef void (*VisitChildrenFunctionPtr)(JSCell*, SlotVisitor&); VisitChildrenFunctionPtr visitChildren; - typedef void (*CopyBackingStoreFunctionPtr)(JSCell*, CopyVisitor&); + typedef void (*CopyBackingStoreFunctionPtr)(JSCell*, CopyVisitor&, CopyToken); CopyBackingStoreFunctionPtr copyBackingStore; typedef CallType (*GetCallDataFunctionPtr)(JSCell*, CallData&); @@ -60,14 +61,14 @@ struct MethodTable { typedef bool (*DeletePropertyByIndexFunctionPtr)(JSCell*, ExecState*, unsigned); DeletePropertyByIndexFunctionPtr deletePropertyByIndex; - typedef bool (*GetOwnPropertySlotFunctionPtr)(JSCell*, ExecState*, PropertyName, PropertySlot&); + typedef bool (*GetOwnPropertySlotFunctionPtr)(JSObject*, ExecState*, PropertyName, PropertySlot&); GetOwnPropertySlotFunctionPtr getOwnPropertySlot; - typedef bool (*GetOwnPropertySlotByIndexFunctionPtr)(JSCell*, ExecState*, unsigned, PropertySlot&); + typedef bool (*GetOwnPropertySlotByIndexFunctionPtr)(JSObject*, ExecState*, unsigned, PropertySlot&); GetOwnPropertySlotByIndexFunctionPtr getOwnPropertySlotByIndex; - typedef JSObject* (*ToThisObjectFunctionPtr)(JSCell*, ExecState*); - ToThisObjectFunctionPtr toThisObject; + typedef JSValue (*ToThisFunctionPtr)(JSCell*, ExecState*, ECMAMode); + ToThisFunctionPtr toThis; typedef JSValue (*DefaultValueFunctionPtr)(const JSObject*, ExecState*, PreferredPrimitiveType); DefaultValueFunctionPtr defaultValue; @@ -81,20 +82,32 @@ struct MethodTable { typedef void (*GetPropertyNamesFunctionPtr)(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); GetPropertyNamesFunctionPtr getPropertyNames; + typedef uint32_t (*GetEnumerableLengthFunctionPtr)(ExecState*, JSObject*); + GetEnumerableLengthFunctionPtr getEnumerableLength; + + GetPropertyNamesFunctionPtr getStructurePropertyNames; + GetPropertyNamesFunctionPtr getGenericPropertyNames; + typedef String (*ClassNameFunctionPtr)(const JSObject*); ClassNameFunctionPtr className; typedef bool (*CustomHasInstanceFunctionPtr)(JSObject*, ExecState*, JSValue); CustomHasInstanceFunctionPtr customHasInstance; - typedef void (*PutWithAttributesFunctionPtr)(JSObject*, ExecState*, PropertyName propertyName, JSValue, unsigned attributes); - PutWithAttributesFunctionPtr putDirectVirtual; - - typedef bool (*DefineOwnPropertyFunctionPtr)(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool); + typedef bool (*DefineOwnPropertyFunctionPtr)(JSObject*, ExecState*, PropertyName, const PropertyDescriptor&, bool); DefineOwnPropertyFunctionPtr defineOwnProperty; - typedef bool (*GetOwnPropertyDescriptorFunctionPtr)(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); - GetOwnPropertyDescriptorFunctionPtr getOwnPropertyDescriptor; + typedef ArrayBuffer* (*SlowDownAndWasteMemory)(JSArrayBufferView*); + SlowDownAndWasteMemory slowDownAndWasteMemory; + + typedef PassRefPtr<ArrayBufferView> (*GetTypedArrayImpl)(JSArrayBufferView*); + GetTypedArrayImpl getTypedArrayImpl; + + typedef void (*DumpToStreamFunctionPtr)(const JSCell*, PrintStream&); + DumpToStreamFunctionPtr dumpToStream; + + typedef size_t (*EstimatedSizeFunctionPtr)(JSCell*); + EstimatedSizeFunctionPtr estimatedSize; }; #define CREATE_MEMBER_CHECKER(member) \ @@ -128,41 +141,32 @@ struct MethodTable { &ClassName::deletePropertyByIndex, \ &ClassName::getOwnPropertySlot, \ &ClassName::getOwnPropertySlotByIndex, \ - &ClassName::toThisObject, \ + &ClassName::toThis, \ &ClassName::defaultValue, \ &ClassName::getOwnPropertyNames, \ &ClassName::getOwnNonIndexPropertyNames, \ &ClassName::getPropertyNames, \ + &ClassName::getEnumerableLength, \ + &ClassName::getStructurePropertyNames, \ + &ClassName::getGenericPropertyNames, \ &ClassName::className, \ &ClassName::customHasInstance, \ - &ClassName::putDirectVirtual, \ &ClassName::defineOwnProperty, \ - &ClassName::getOwnPropertyDescriptor, \ + &ClassName::slowDownAndWasteMemory, \ + &ClassName::getTypedArrayImpl, \ + &ClassName::dumpToStream, \ + &ClassName::estimatedSize \ }, \ ClassName::TypedArrayStorageType struct ClassInfo { - /** - * A string denoting the class name. Example: "Window". - */ + // A string denoting the class name. Example: "Window". const char* className; - /** - * Pointer to the class information of the base class. - * 0L if there is none. - */ + // Pointer to the class information of the base class. + // nullptrif there is none. const ClassInfo* parentClass; - /** - * Static hash-table of properties. - * For classes that can be used from multiple threads, it is accessed via a getter function that would typically return a pointer to thread-specific value. - */ - const HashTable* propHashTable(ExecState* exec) const - { - if (classPropHashTableGetterFunction) - return classPropHashTableGetterFunction(exec); - return staticPropHashTable; - } - + bool isSubClassOf(const ClassInfo* other) const { for (const ClassInfo* ci = this; ci; ci = ci->parentClass) { @@ -175,15 +179,15 @@ struct ClassInfo { bool hasStaticProperties() const { for (const ClassInfo* ci = this; ci; ci = ci->parentClass) { - if (ci->staticPropHashTable || ci->classPropHashTableGetterFunction) + if (ci->staticPropHashTable) return true; } return false; } + JS_EXPORT_PRIVATE bool hasStaticSetterOrReadonlyProperties() const; + const HashTable* staticPropHashTable; - typedef const HashTable* (*ClassPropHashTableGetterFunction)(ExecState*); - const ClassPropHashTableGetterFunction classPropHashTableGetterFunction; MethodTable methodTable; |