MMgc::GCRoot Class Reference

#include <GC.h>

Inheritance diagram for MMgc::GCRoot:

avmplus::AvmCore axtam::CActiveScriptError axtam::IDispatchProvider avmshell::Shell axtam::AXTam List of all members.

Public Member Functions

 GCRoot (GC *gc)
 GCRoot (GC *gc, const void *object, size_t size)
virtual ~GCRoot ()
void * operator new (size_t size)
void operator delete (void *object)
const void * Get () const
void Set (const void *object, size_t size)
GCGetGC () const
void Destroy ()

Private Member Functions

 GCRoot ()
void init (GC *gc, const void *object, size_t size)
GCWorkItem GetWorkItem () const

Private Attributes

GCgc
GCRootnext
GCRootprev
const void * object
size_t size

Friends

class GC

Detailed Description

GCRoot is root in the reachability graph, it contains a pointer a size and will be searched for things.

Definition at line 275 of file GC.h.


Constructor & Destructor Documentation

MMgc::GCRoot::GCRoot  )  [private]
 

MMgc::GCRoot::GCRoot GC gc  ) 
 

subclassing constructor

Definition at line 1371 of file GC.cpp.

References MMgc::FixedMalloc::GetInstance(), and init().

01372     {
01373         init(_gc, this, FixedMalloc::GetInstance()->Size(this));
01374     }

MMgc::GCRoot::GCRoot GC gc,
const void *  object,
size_t  size
 

general constructor

Definition at line 1376 of file GC.cpp.

References init().

01377     {
01378         init(_gc, _object, _size);
01379     }

MMgc::GCRoot::~GCRoot  )  [virtual]
 

Definition at line 1381 of file GC.cpp.

References gc, and MMgc::GC::RemoveRoot().

01382     {
01383         if(gc) {
01384             gc->RemoveRoot(this);
01385         }
01386     }


Member Function Documentation

void MMgc::GCRoot::Destroy  ) 
 

if your object goes away after the GC is deleted this can be useful

Definition at line 1394 of file GC.cpp.

References gc, NULL, MMgc::GC::RemoveRoot(), and Set().

01395     {
01396         Set(NULL, 0);
01397         if(gc) {
01398             gc->RemoveRoot(this);
01399         }
01400         gc = NULL;
01401     }

const void* MMgc::GCRoot::Get  )  const [inline]
 

Definition at line 298 of file GC.h.

00298 { return object; }

GC* MMgc::GCRoot::GetGC  )  const [inline]
 

Definition at line 301 of file GC.h.

Referenced by avmplus::XMLListObject::__toXMLString(), avmplus::XMLListObject::_append(), avmplus::XMLObject::_deepCopy(), avmplus::XMLListObject::_deepCopy(), avmplus::E4XNode::_deepCopy(), avmplus::ElementE4XNode::_insert(), avmplus::ElementE4XNode::_replace(), avmplus::Traits::addInterface(), avmplus::AvmCore::allocDouble(), avmplus::ArrayClass::ArrayClass(), avmplus::ArraySort::ArraySort(), avmplus::XMLObject::child(), avmplus::XMLListObject::child(), avmplus::XMLObject::childChanges(), avmplus::XMLObject::comments(), avmplus::XMLListObject::comments(), avmplus::XMLListClass::construct(), avmplus::QNameClass::construct(), avmplus::RegExpClass::construct(), avmplus::DateClass::construct(), avmshell::DomainObject::constructFromDomain(), axtam::DomainObject::constructFromDomain(), avmplus::NumberClass::convert(), avmplus::MathUtils::convertDoubleToStringRadix(), avmplus::MethodClosureClass::create(), axtam::MSIDispatchConsumerClass::create(), axtam::MSIUnknownConsumerClass::create(), axtam::IUnknownConsumerClass::create(), axtam::IDispatchConsumerClass::create(), axtam::EXCEPINFOClass::create(), avmplus::DictionaryClass::createInstance(), avmplus::ObjectVectorClass::createInstance(), avmplus::DoubleVectorClass::createInstance(), avmplus::UIntVectorClass::createInstance(), avmplus::IntVectorClass::createInstance(), avmplus::ArrayClass::createInstance(), avmplus::AvmCore::createToplevel(), avmplus::Toplevel::decode(), avmplus::MethodEnv::delegateInvoke(), avmplus::XMLListObject::delUintProperty(), avmplus::Domain::Domain(), avmplus::DomainEnv::DomainEnv(), avmplus::AvmCore::doubleToString(), avmplus::XMLObject::elements(), avmplus::XMLListObject::elements(), avmplus::StringClass::fromCharCode(), avmplus::VTable::gc(), avmplus::ScriptObject::gc(), avmplus::XMLObject::getDescendants(), avmplus::XMLListObject::getDescendants(), avmplus::Verifier::getFrameState(), avmshell::SystemClass::getFreeMemory(), avmplus::MethodEnv::getMethodClosureTable(), avmplus::XMLObject::getNamespace(), avmplus::XMLParser::getNext(), avmshell::SystemClass::getTotalMemory(), avmplus::AvmCore::handleActionBlock(), avmplus::AvmCore::initBuiltinPool(), avmplus::AbstractFunction::initDefaultValues(), avmplus::Traits::initMetadataTable(), avmplus::AbstractFunction::initParamTypes(), avmplus::Traits::initTables(), avmplus::XMLObject::inScopeNamespaces(), avmplus::AvmCore::internAlloc(), avmplus::AvmCore::internAllocUtf8(), avmplus::AvmCore::internInt(), avmplus::interp(), avmplus::AvmCore::intToString(), avmplus::XMLObject::issueNotifications(), avmshell::DomainObject::loadBytes(), axtam::DomainObject::loadBytes(), avmplus::VTable::makeMethodEnv(), avmplus::XMLObject::name(), avmplus::XMLObject::namespaceDeclarations(), avmplus::MethodEnv::newActivation(), avmplus::ArrayClass::newArray(), avmplus::MethodEnv::newclass(), avmplus::Verifier::newFrameState(), avmplus::MethodEnv::newfunction(), avmplus::AvmCore::newNamespace(), avmplus::AvmCore::newNamespaceSet(), avmplus::AvmCore::newObject(), avmplus::AvmCore::newRegExp(), avmplus::AvmCore::newScriptBuffer(), avmplus::AvmCore::newString(), avmplus::AvmCore::newTraits(), avmplus::ObjectVectorClass::newVector(), avmplus::DoubleVectorClass::newVector(), avmplus::UIntVectorClass::newVector(), avmplus::IntVectorClass::newVector(), avmplus::AvmCore::newVTable(), avmplus::XMLObject::nonChildChanges(), avmplus::XMLObject::normalize(), avmplus::MethodEnv::op_newobject(), avmplus::AbcParser::parseCpool(), avmplus::Verifier::parseExceptionHandlers(), avmplus::AbcParser::parseInstanceInfos(), avmplus::AbcParser::parseMetadataInfos(), avmplus::AbcParser::parseScriptInfos(), avmplus::PoolObject::PoolObject(), avmplus::AvmCore::prepareActionPool(), avmplus::AvmCore::presweep(), avmplus::XMLObject::processingInstructions(), avmplus::XMLListObject::processingInstructions(), avmplus::RegExpClass::RegExpClass(), avmplus::AvmCore::registerNatives(), avmplus::VTable::resolveSignatures(), avmplus::PoolObject::resolveTraits(), avmplus::Traits::setMethod(), avmplus::AbcEnv::setMethod(), avmplus::ElementE4XNode::setNotification(), avmplus::E4XNode::setQName(), avmplus::ScriptObject::setSlotAtom(), avmplus::FrameState::setType(), avmplus::NativeID::shell_toplevel_a2a_oii_opti2_thunkc(), avmshell::ShellToplevel::ShellToplevel(), avmplus::ArrayClass::sortOn(), avmplus::XMLListObject::text(), avmplus::AvmCore::throwAtom(), avmplus::Toplevel::ToAttributeName(), avmplus::XMLObject::toString(), avmplus::AvmCore::uintToString(), avmplus::Toplevel::unescape(), avmplus::MethodInfo::verifyEnter(), avmplus::XMLObject::XMLObject(), avmplus::XMLParser::XMLParser(), avmplus::AbcParser::~AbcParser(), avmplus::ArraySort::~ArraySort(), and avmplus::Verifier::~Verifier().

00301 { return gc; }

GCWorkItem MMgc::GCRoot::GetWorkItem  )  const [inline, private]
 

Definition at line 315 of file GC.h.

Referenced by MMgc::GC::FinishIncrementalMark().

00315 { return GCWorkItem(object, (uint32)size, false); }

void MMgc::GCRoot::init GC gc,
const void *  object,
size_t  size
[private]
 

Definition at line 1355 of file GC.cpp.

References MMgc::GC::AddRoot(), gc, MMgc::FixedMalloc::GetInstance(), object, size, and MMgc::FixedMalloc::Size().

Referenced by GCRoot().

01356     {
01357 #ifndef _DEBUG
01358         // only do the memset on GCRoot subclasses
01359         if(_object == this) {
01360             size_t s = FixedMalloc::GetInstance()->Size(this);
01361             // being a GCRoot its important we are clean
01362             memset(this, 0, s);
01363         }
01364 #endif
01365         gc = _gc;
01366         object = _object;
01367         size = _size;
01368         gc->AddRoot(this);
01369     }

void MMgc::GCRoot::operator delete void *  object  )  [inline]
 

Definition at line 293 of file GC.h.

References MMgc::FixedMalloc::Free(), and MMgc::FixedMalloc::GetInstance().

00294         {
00295             FixedMalloc::GetInstance()->Free(object);
00296         }

void* MMgc::GCRoot::operator new size_t  size  )  [inline]
 

Definition at line 288 of file GC.h.

References MMgc::FixedMalloc::Alloc(), and MMgc::FixedMalloc::GetInstance().

00289         {
00290             return FixedMalloc::GetInstance()->Alloc(size);
00291         }

void MMgc::GCRoot::Set const void *  object,
size_t  size
 

Definition at line 1388 of file GC.cpp.

References object, and size.

Referenced by Destroy().

01389     {
01390         this->object = _object;
01391         this->size = _size;
01392     }


Friends And Related Function Documentation

friend class GC [friend]
 

Definition at line 277 of file GC.h.


Member Data Documentation

GC* MMgc::GCRoot::gc [private]
 

Reimplemented in avmplus::AvmCore.

Definition at line 306 of file GC.h.

Referenced by Destroy(), init(), and ~GCRoot().

GCRoot* MMgc::GCRoot::next [private]
 

Requires(gc->m_rootListLock)

Definition at line 309 of file GC.h.

Referenced by MMgc::GC::AddRoot(), MMgc::GC::FinishIncrementalMark(), and MMgc::GC::RemoveRoot().

const void* MMgc::GCRoot::object [private]
 

Definition at line 312 of file GC.h.

Referenced by init(), and Set().

GCRoot* MMgc::GCRoot::prev [private]
 

Requires(gc->m_rootListLock)

Definition at line 311 of file GC.h.

Referenced by MMgc::GC::AddRoot(), and MMgc::GC::RemoveRoot().

size_t MMgc::GCRoot::size [private]
 

Definition at line 313 of file GC.h.

Referenced by init(), avmplus::AvmCore::initBuiltinPool(), and Set().


The documentation for this class was generated from the following files:
Generated on Sun Oct 12 18:51:35 2008 for Tamarin by  doxygen 1.4.6