]> git.saurik.com Git - apple/javascriptcore.git/blame - runtime/JSDestructibleObject.h
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / runtime / JSDestructibleObject.h
CommitLineData
93a37866
A
1#ifndef JSDestructibleObject_h
2#define JSDestructibleObject_h
3
4#include "JSObject.h"
5
6namespace JSC {
7
8struct ClassInfo;
9
10class JSDestructibleObject : public JSNonFinalObject {
11public:
12 typedef JSNonFinalObject Base;
13
14 static const bool needsDestruction = true;
15
16 const ClassInfo* classInfo() const { return m_classInfo; }
17
18 static ptrdiff_t classInfoOffset() { return OBJECT_OFFSETOF(JSDestructibleObject, m_classInfo); }
19
20protected:
21 JSDestructibleObject(VM& vm, Structure* structure, Butterfly* butterfly = 0)
22 : JSNonFinalObject(vm, structure, butterfly)
23 , m_classInfo(structure->classInfo())
24 {
25 ASSERT(m_classInfo);
26 }
27
28private:
29 const ClassInfo* m_classInfo;
30};
31
93a37866
A
32} // namespace JSC
33
34#endif