]>
git.saurik.com Git - apple/javascriptcore.git/blob - runtime/JSDestructibleObject.h
1 #ifndef JSDestructibleObject_h
2 #define JSDestructibleObject_h
10 class JSDestructibleObject
: public JSNonFinalObject
{
12 typedef JSNonFinalObject Base
;
14 static const bool needsDestruction
= true;
16 const ClassInfo
* classInfo() const { return m_classInfo
; }
18 static ptrdiff_t classInfoOffset() { return OBJECT_OFFSETOF(JSDestructibleObject
, m_classInfo
); }
21 JSDestructibleObject(VM
& vm
, Structure
* structure
, Butterfly
* butterfly
= 0)
22 : JSNonFinalObject(vm
, structure
, butterfly
)
23 , m_classInfo(structure
->classInfo())
29 const ClassInfo
* m_classInfo
;
32 inline const ClassInfo
* JSCell::classInfo() const
34 MarkedBlock
* block
= MarkedBlock::blockFor(this);
35 if (block
->destructorType() == MarkedBlock::Normal
)
36 return static_cast<const JSDestructibleObject
*>(this)->classInfo();
37 return structure(*block
->vm())->classInfo();