diff options
author | Konstantin Tokarev <annulen@yandex.ru> | 2016-08-25 19:20:41 +0300 |
---|---|---|
committer | Konstantin Tokarev <annulen@yandex.ru> | 2017-02-02 12:30:55 +0000 |
commit | 6882a04fb36642862b11efe514251d32070c3d65 (patch) | |
tree | b7959826000b061fd5ccc7512035c7478742f7b0 /Source/JavaScriptCore/runtime/StructureRareData.h | |
parent | ab6df191029eeeb0b0f16f127d553265659f739e (diff) | |
download | qtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz |
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/JavaScriptCore/runtime/StructureRareData.h')
-rw-r--r-- | Source/JavaScriptCore/runtime/StructureRareData.h | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/Source/JavaScriptCore/runtime/StructureRareData.h b/Source/JavaScriptCore/runtime/StructureRareData.h index e5db9e5f4..0310b18c3 100644 --- a/Source/JavaScriptCore/runtime/StructureRareData.h +++ b/Source/JavaScriptCore/runtime/StructureRareData.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,46 +29,60 @@ #include "ClassInfo.h" #include "JSCell.h" #include "JSTypeInfo.h" +#include "PropertyOffset.h" +#include "PropertySlot.h" namespace JSC { -class JSPropertyNameIterator; +class JSPropertyNameEnumerator; class Structure; +class ObjectToStringAdaptiveStructureWatchpoint; +class ObjectToStringAdaptiveInferredPropertyValueWatchpoint; -class StructureRareData : public JSCell { - friend class Structure; +class StructureRareData final : public JSCell { public: + typedef JSCell Base; + static const unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal; + static StructureRareData* create(VM&, Structure*); - static StructureRareData* clone(VM&, const StructureRareData* other); + + static const bool needsDestruction = true; + static void destroy(JSCell*); static void visitChildren(JSCell*, SlotVisitor&); static Structure* createStructure(VM&, JSGlobalObject*, JSValue prototype); - // Returns true if this StructureRareData should also be cloned when cloning the owner Structure. - bool needsCloning() const { return false; } - Structure* previousID() const; - void setPreviousID(VM&, Structure* transition, Structure*); + void setPreviousID(VM&, Structure*); void clearPreviousID(); JSString* objectToStringValue() const; - void setObjectToStringValue(VM&, const JSCell* owner, JSString* value); + void setObjectToStringValue(ExecState*, VM&, Structure* baseStructure, JSString* value, PropertySlot toStringTagSymbolSlot); - JSPropertyNameIterator* enumerationCache(); - void setEnumerationCache(VM&, const Structure* owner, JSPropertyNameIterator* value); + JSPropertyNameEnumerator* cachedPropertyNameEnumerator() const; + void setCachedPropertyNameEnumerator(VM&, JSPropertyNameEnumerator*); - static JS_EXPORTDATA const ClassInfo s_info; + DECLARE_EXPORT_INFO; private: - StructureRareData(VM&, Structure*); - StructureRareData(VM&, const StructureRareData*); + friend class Structure; + friend class ObjectToStringAdaptiveStructureWatchpoint; + friend class ObjectToStringAdaptiveInferredPropertyValueWatchpoint; - static const unsigned StructureFlags = OverridesVisitChildren | JSCell::StructureFlags; + void clearObjectToStringValue(); + + StructureRareData(VM&, Structure*); WriteBarrier<Structure> m_previous; WriteBarrier<JSString> m_objectToStringValue; - WriteBarrier<JSPropertyNameIterator> m_enumerationCache; + WriteBarrier<JSPropertyNameEnumerator> m_cachedPropertyNameEnumerator; + + typedef HashMap<PropertyOffset, RefPtr<WatchpointSet>, WTF::IntHash<PropertyOffset>, WTF::UnsignedWithZeroKeyHashTraits<PropertyOffset>> PropertyWatchpointMap; + std::unique_ptr<PropertyWatchpointMap> m_replacementWatchpointSets; + Bag<ObjectToStringAdaptiveStructureWatchpoint> m_objectToStringAdaptiveWatchpointSet; + std::unique_ptr<ObjectToStringAdaptiveInferredPropertyValueWatchpoint> m_objectToStringAdaptiveInferredValueWatchpoint; + bool m_giveUpOnObjectToStringValueCache; }; } // namespace JSC |