예제 #1
0
파일: DomainEnv.cpp 프로젝트: bsdf/trx
DomainEnv::DomainEnv(AvmCore* core, Domain* domain, DomainEnv* base, uint32_t baseCount)
    : m_scriptEnvMap(ScriptEnvMap::create(core->GetGC()))
    , m_domain(domain)
    , m_globalMemoryScratch(mmfx_new0(Scratch))
    , m_globalMemoryBase(m_globalMemoryScratch->scratch)
    , m_globalMemorySize(GLOBAL_MEMORY_MIN_SIZE)
    , m_baseCount(baseCount)
{
    WB(core->GetGC(), this, &this->m_bases[0], this);
    for (uint32_t i = 1; i < baseCount; ++i)
    {
        WB(core->GetGC(), this, &this->m_bases[i], base->m_bases[i-1]);
    }

#ifdef _DEBUG
    GCList<Domain> dl(core->GetGC(), 0);
    for (Domain* di = m_domain; di != NULL; di = di->base())
        dl.add(di);

    GCList<DomainEnv> el(core->GetGC(), 0);
    for (DomainEnv* di = this; di != NULL; di = di->base())
        el.add(di);

    AvmAssert(dl.length() == el.length());
    for (uint32_t i = 0, n = el.length(); i < n; ++i)
    {
        Domain* d = dl[i];
        DomainEnv* e = el[i];
        AvmAssert(e->domain() == d);
    }
#endif
}
예제 #2
0
파일: Domain.cpp 프로젝트: hgl888/nashtest
	Domain::Domain(AvmCore* core, Domain* base) : 
            m_base(base),
		    m_core(core),
            m_namedTraits(new (core->GetGC()) MultinameHashtable()),
            m_namedScripts(new (core->GetGC()) MultinameHashtable()),
	        m_globalMemoryScratch(mmfx_new0(Scratch)),
            m_globalMemoryBase(m_globalMemoryScratch->scratch),
		    m_globalMemorySize(GLOBAL_MEMORY_MIN_SIZE)
			,m_bOverWrite(false)
	{
	}