diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/JavaScriptCore/runtime/ClassInfo.h | |
parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/JavaScriptCore/runtime/ClassInfo.h')
-rw-r--r-- | Source/JavaScriptCore/runtime/ClassInfo.h | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/Source/JavaScriptCore/runtime/ClassInfo.h b/Source/JavaScriptCore/runtime/ClassInfo.h index 84fc11a3c..8ff75f4eb 100644 --- a/Source/JavaScriptCore/runtime/ClassInfo.h +++ b/Source/JavaScriptCore/runtime/ClassInfo.h @@ -30,6 +30,7 @@ namespace JSC { +class HashEntry; class JSArrayBufferView; struct HashTable; @@ -82,12 +83,6 @@ 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; @@ -102,12 +97,6 @@ struct MethodTable { 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) \ @@ -146,16 +135,11 @@ struct MethodTable { &ClassName::getOwnPropertyNames, \ &ClassName::getOwnNonIndexPropertyNames, \ &ClassName::getPropertyNames, \ - &ClassName::getEnumerableLength, \ - &ClassName::getStructurePropertyNames, \ - &ClassName::getGenericPropertyNames, \ &ClassName::className, \ &ClassName::customHasInstance, \ &ClassName::defineOwnProperty, \ &ClassName::slowDownAndWasteMemory, \ - &ClassName::getTypedArrayImpl, \ - &ClassName::dumpToStream, \ - &ClassName::estimatedSize \ + &ClassName::getTypedArrayImpl \ }, \ ClassName::TypedArrayStorageType @@ -167,6 +151,25 @@ struct ClassInfo { // 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 a thread-specific value. + const HashTable* propHashTable(ExecState* exec) const + { + if (classPropHashTableGetterFunction) + return &classPropHashTableGetterFunction(exec->vm()); + + return staticPropHashTable; + } + + const HashTable* propHashTable(VM& vm) const + { + if (classPropHashTableGetterFunction) + return &classPropHashTableGetterFunction(vm); + + return staticPropHashTable; + } + bool isSubClassOf(const ClassInfo* other) const { for (const ClassInfo* ci = this; ci; ci = ci->parentClass) { @@ -179,15 +182,17 @@ struct ClassInfo { bool hasStaticProperties() const { for (const ClassInfo* ci = this; ci; ci = ci->parentClass) { - if (ci->staticPropHashTable) + if (ci->staticPropHashTable || ci->classPropHashTableGetterFunction) return true; } return false; } - JS_EXPORT_PRIVATE bool hasStaticSetterOrReadonlyProperties() const; + bool hasStaticSetterOrReadonlyProperties(VM&) const; const HashTable* staticPropHashTable; + typedef const HashTable& (*ClassPropHashTableGetterFunction)(VM&); + const ClassPropHashTableGetterFunction classPropHashTableGetterFunction; MethodTable methodTable; |