diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-30 12:48:17 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-30 12:48:17 +0200 |
commit | 881da28418d380042aa95a97f0cbd42560a64f7c (patch) | |
tree | a794dff3274695e99c651902dde93d934ea7a5af /Source/JavaScriptCore/runtime/StructureRareData.h | |
parent | 7e104c57a70fdf551bb3d22a5d637cdcbc69dbea (diff) | |
parent | 0fcedcd17cc00d3dd44c718b3cb36c1033319671 (diff) | |
download | qtwebkit-881da28418d380042aa95a97f0cbd42560a64f7c.tar.gz |
Merge 'wip/next' into dev
Change-Id: Iff9ee5e23bb326c4371ec8ed81d56f2f05d680e9
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 |