From 6882a04fb36642862b11efe514251d32070c3d65 Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Thu, 25 Aug 2016 19:20:41 +0300 Subject: Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443) Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f Reviewed-by: Konstantin Tokarev --- Source/JavaScriptCore/runtime/StructureRareData.h | 48 +++++++++++++++-------- 1 file changed, 31 insertions(+), 17 deletions(-) (limited to 'Source/JavaScriptCore/runtime/StructureRareData.h') 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 m_previous; WriteBarrier m_objectToStringValue; - WriteBarrier m_enumerationCache; + WriteBarrier m_cachedPropertyNameEnumerator; + + typedef HashMap, WTF::IntHash, WTF::UnsignedWithZeroKeyHashTraits> PropertyWatchpointMap; + std::unique_ptr m_replacementWatchpointSets; + Bag m_objectToStringAdaptiveWatchpointSet; + std::unique_ptr m_objectToStringAdaptiveInferredValueWatchpoint; + bool m_giveUpOnObjectToStringValueCache; }; } // namespace JSC -- cgit v1.2.1