X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/81345200c95645a1b0d2635520f96ad55dfde63f..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/runtime/StructureRareData.h diff --git a/runtime/StructureRareData.h b/runtime/StructureRareData.h index 1808b6a..2b11ab8 100644 --- a/runtime/StructureRareData.h +++ b/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,25 +29,27 @@ #include "ClassInfo.h" #include "JSCell.h" #include "JSTypeInfo.h" +#include "PropertyOffset.h" namespace JSC { -class JSPropertyNameIterator; +class JSPropertyNameEnumerator; class Structure; -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*); void clearPreviousID(); @@ -55,20 +57,23 @@ public: JSString* objectToStringValue() const; void setObjectToStringValue(VM&, JSString* value); - JSPropertyNameIterator* enumerationCache(); - void setEnumerationCache(VM&, JSPropertyNameIterator* value); + JSPropertyNameEnumerator* cachedPropertyNameEnumerator() const; + void setCachedPropertyNameEnumerator(VM&, JSPropertyNameEnumerator*); DECLARE_EXPORT_INFO; private: + friend class Structure; + StructureRareData(VM&, Structure*); - StructureRareData(VM&, const StructureRareData*); - - static const unsigned StructureFlags = OverridesVisitChildren | JSCell::StructureFlags; WriteBarrier m_previous; WriteBarrier m_objectToStringValue; - WriteBarrier m_enumerationCache; + WriteBarrier m_cachedPropertyNameEnumerator; + WriteBarrier m_cachedGenericPropertyNameEnumerator; + + typedef HashMap, WTF::IntHash, WTF::UnsignedWithZeroKeyHashTraits> PropertyWatchpointMap; + std::unique_ptr m_replacementWatchpointSets; }; } // namespace JSC