diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-01-09 09:47:50 +0100 |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-01-09 09:48:18 +0100 |
commit | 061addcfbbedeeb93079502220c15184d1da130e (patch) | |
tree | 8ea9d94e44988bdf77db3f64f5fb6563520b1ae3 /Source/JavaScriptCore/runtime/JSObject.h | |
parent | 15b42dc09e6e4c2957b86fb36b6dae2ef60a7698 (diff) | |
parent | 9b144019dd99d696f1a9eb9cde6afa0f04d7dc05 (diff) | |
download | qtwebkit-061addcfbbedeeb93079502220c15184d1da130e.tar.gz |
Merge branch 'stable' into release
Change-Id: Ifdbfff78833ca658ad6d10dd829289fc0a430e6d
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSObject.h')
-rw-r--r-- | Source/JavaScriptCore/runtime/JSObject.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/runtime/JSObject.h b/Source/JavaScriptCore/runtime/JSObject.h index 4f7f4700b..957ba8227 100644 --- a/Source/JavaScriptCore/runtime/JSObject.h +++ b/Source/JavaScriptCore/runtime/JSObject.h @@ -1560,6 +1560,37 @@ inline int offsetRelativeToBase(PropertyOffset offset) COMPILE_ASSERT(!(sizeof(JSObject) % sizeof(WriteBarrierBase<Unknown>)), JSObject_inline_storage_has_correct_alignment); +class JSDestructibleObject : public JSNonFinalObject { +public: + typedef JSNonFinalObject Base; + + static const bool needsDestruction = true; + + const ClassInfo* classInfo() const { return m_classInfo; } + +protected: + JSDestructibleObject(JSGlobalData& globalData, Structure* structure, Butterfly* butterfly = 0) + : JSNonFinalObject(globalData, structure, butterfly) + , m_classInfo(structure->classInfo()) + { + ASSERT(m_classInfo); + } + +private: + const ClassInfo* m_classInfo; +}; + +inline const ClassInfo* JSCell::classInfo() const +{ + if (MarkedBlock::blockFor(this)->destructorType() == MarkedBlock::Normal) + return static_cast<const JSDestructibleObject*>(this)->classInfo(); +#if ENABLE(GC_VALIDATION) + return m_structure.unvalidatedGet()->classInfo(); +#else + return m_structure->classInfo(); +#endif +} + } // namespace JSC #endif // JSObject_h |