• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ AvmAssert函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中AvmAssert函数的典型用法代码示例。如果您正苦于以下问题:C++ AvmAssert函数的具体用法?C++ AvmAssert怎么用?C++ AvmAssert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了AvmAssert函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: AvmAssert

 /*static*/ NamespaceSet* NamespaceSet::_create(MMgc::GC* gc, uint32_t count)
 {
     AvmAssert(count <= 0x7fffffff); // should be impossible since ABC only allow U30...
     size_t extra = (count >= 1 ? count-1 : 0)*sizeof(Namespacep);
     NamespaceSet* nsset = new (gc, extra) NamespaceSet;
     nsset->_countAndFlags = count<<1;
     return nsset;
 }
开发者ID:changm,项目名称:tessa,代码行数:8,代码来源:NamespaceSet.cpp


示例2: AvmAssert

	void CallStackNode::exit()
	{
		// m_env might be null (for fake CallStackNode), be careful
		AvmAssert(m_core != NULL);
		m_core->callStack = m_next;
		m_next = NULL;
		m_core = NULL; // so the dtor doesn't call exit() again
	}
开发者ID:PushButtonLabs,项目名称:PBNetworking,代码行数:8,代码来源:StackTrace.cpp


示例3: AvmAssert

    // OSR is supported generally only in runmode RM_mixed.  We don't support
    // methods with try/catch blocks because of the complexity of establishing
    // a new ExceptionFrame and jmp_buf.  We also don't support methods for which
    // a previous compilation attempt failed, or for which failure can be predicted.
    //
    // We must only OSR methods that will execute with a BugCompatibility object
    // such that interpreter/compiler divergences are corrected.  Builtin methods
    // are invoked with bug compatibility inherited from the innermost non-builtin
    // function on the call chain, and thus may vary from call to call. Non-builtins
    // should always execute with bug compatibility taken from the AbcEnv to which
    // the method belongs, which will thus remain invariant. We can therefore only OSR
    // non-builtin methods.
    bool OSR::isSupported(const AbcEnv* abc_env, const MethodInfo* m, MethodSignaturep ms)
    {
        AvmCore* core = abc_env->core();

        AvmAssert(core == m->pool()->core);
        AvmAssert(abc_env->pool() == m->pool());
        AvmAssert(abc_env->codeContext() != NULL);
        AvmAssert(abc_env->codeContext()->bugCompatibility() != NULL);

        return (!m->hasExceptions() &&                // method does not have a try block
                core->config.runmode == RM_mixed &&   // mixed runmode, allowing both interpreter and JIT
                core->config.osr_threshold != 0 &&    // OSR is enabled (may be disabled by host)
                !m->hasFailedJit() &&                 // no previous attempt to compile the method has failed
                !CodegenLIR::jitWillFail(ms) &&       // fast-fail predictor says JIT success is possible
                !m->pool()->isBuiltin &&              // the method is not a builtin (ABC baked into application)
                abc_env->codeContext()->bugCompatibility()->bugzilla539094);  // bug compatibility permits OSR
    }
开发者ID:bsdf,项目名称:trx,代码行数:29,代码来源:exec-osr.cpp


示例4: AvmAssert

void BigInteger::setFromBigInteger(const BigInteger* from, int32 offset, int32 amount)
{
    numWords = amount;
    AvmAssert(numWords <= kMaxBigIntegerBufferSize);
    memcpy( (byte*)wordBuffer,
            (byte*)&(from->wordBuffer[offset]),
            amount*sizeof(uint32));
}
开发者ID:fokion,项目名称:PBNetworking,代码行数:8,代码来源:BigInteger.cpp


示例5: AvmAssert

	PoolObject* NativeInitializer::parseBuiltinABC(Domain* domain)
	{
		AvmAssert(domain != NULL);
		
		ScriptBuffer code = ScriptBuffer(new (core->GetGC()) ConstDataScriptBufferImpl(abcData, abcDataLen));

		return core->parseActionBlock(code, /*start*/0, /*toplevel*/NULL, domain, this, ApiUtils::getLargestAPI(core)/*active api*/);
	}
开发者ID:Jeffxz,项目名称:nodeas,代码行数:8,代码来源:NativeFunction.cpp


示例6: ClassClosure

	MathClass::MathClass(VTable* cvtable)
		: ClassClosure(cvtable)
	{
		AvmAssert(traits()->getSizeOfInstance() == sizeof(MathClass));
		MathUtils::initRandom(&seed);

        // todo does ES4 Math have a prototype object?
	}
开发者ID:hgl888,项目名称:nashtest,代码行数:8,代码来源:MathClass.cpp


示例7: AvmAssert

    /*static*/ CreateInstanceProc ClassClosure::calcCreateInstanceProc(VTable* cvtable)
    {
        VTable* ivtable = cvtable->ivtable;
        if (ivtable && ivtable->base)
        {
            ScopeChain* scope = cvtable->init->scope();
            if (scope->getSize())
            {
                Atom baseAtom = scope->getScope(scope->getSize()-1);
                if (!AvmCore::isObject(baseAtom))
                    cvtable->toplevel()->throwVerifyError(kCorruptABCError);

                ScriptObject* base = AvmCore::atomToScriptObject(baseAtom);
                // make sure scope object is base type's class object
                AvmAssert(base->traits()->itraits == cvtable->traits->itraits->base);
                if (base->traits()->itraits->isAbstractBase)
                {
                    // If we get here, it means that we descend from an abstract base class,
                    // but don't have a native createInstanceProc of our own; in that case, we
                    // should just create a plain old ScriptObject. (Note that this can
                    // happen for abstract and abstract-restricted; for the latter, we will do
                    // a second check in checkForRestrictedInheritance() and may reject it anyway.)
                    goto create_normal;
                }
                // ...otherwise, we're done.
                ClassClosure* base_cc = base->toClassClosure();
                AvmAssert(base_cc != NULL);
                CreateInstanceProc proc = base_cc->m_createInstanceProc;
                // If the proc is SemiSealedArrayObject, revert back to normal Array,
                // and let checkForRestrictedInheritance() choose the proper proc:
                // we might be a dynamic subclass of a non-dynamic subclass of Array.
                if (proc == SemiSealedArrayObject::createInstanceProc)
                    proc = ArrayClass::createInstanceProc;

                // Bugzilla 688486: don't use unsubclassed-specialized
                // instance creator to create subclassed instances.
                if (proc == ArrayClass::createUnsubclassedInstanceProc)
                    proc = ArrayClass::createInstanceProc;

                return proc;
            }
        }

create_normal:
        return ClassClosure::createScriptObjectProc;
    }
开发者ID:AdiKo,项目名称:avmplus,代码行数:46,代码来源:ClassClosure.cpp


示例8: AvmAssert

	void PoolObject::resolveQName(uint32_t index, Multiname &m, const Toplevel* toplevel) const
	{
		if (index == 0 || index >= constantMnCount)
		{
			if (toplevel)
				toplevel->throwVerifyError(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(constantMnCount));
			AvmAssert(!"unhandled verify error");
		}

		parseMultiname(cpool_mn[index], m);
		if (!m.isQName())
		{
			if (toplevel)
				toplevel->throwVerifyError(kCpoolEntryWrongTypeError, core->toErrorString(index));
			AvmAssert(!"unhandled verify error");
		}
	}
开发者ID:PushButtonLabs,项目名称:PBNetworking,代码行数:17,代码来源:PoolObject.cpp


示例9: AvmAssert

	void WordcodeEmitter::emitAbsJump(const uint8_t *new_pc)
	{
		code_start = new_pc;
		
		// When performing a jump:
		//  - require that backpatches and labels no longer reference the old
		//    code vector; those sets must both be empty.  (We could clear out
		//    labels, alternatively, but that appears not to be required.)
		//  - recompute all the exception information, and require that none of it
		//    has been consumed -- this is the only thing that makes sense, and appears
		//    to be the view the verifier sanctions.  (A full definition for the
		//    semantics of abs_jump is sorely needed.)
		
		AvmAssert(!exceptions_consumed);
		AvmAssert(backpatches == NULL);
		AvmAssert(labels == NULL);
		computeExceptionFixups();
	}
开发者ID:PushButtonLabs,项目名称:PBNetworking,代码行数:18,代码来源:WordcodeEmitter.cpp


示例10: AvmAssert

 Token Lexer::xmlName()
 {
     AvmAssert( isXmlNameStart(*idx) );
     mark = idx;
     while (isXmlNameSubsequent(*idx))
         idx++;
     val.s = compiler->intern(mark, uint32_t(idx-mark));
     return T_XmlName;
 }
开发者ID:AdiKo,项目名称:avmplus,代码行数:9,代码来源:eval-lex-xml.cpp


示例11: AvmAssert

    int ScriptObject::nextNameIndex(int index)
    {
        AvmAssert(index >= 0);

        if (!traits()->needsHashtable())
            return 0;

        return getTable()->next(index);
    }
开发者ID:bsdf,项目名称:trx,代码行数:9,代码来源:ScriptObject.cpp


示例12: AvmAssert

    Atom FASTCALL DictionaryObject::getKeyFromObject(Atom key) const
    {
        AvmAssert(AvmCore::isObject(key));
        ScriptObject* obj = AvmCore::atomToScriptObject(key);
        AvmAssert(Traits::getBuiltinType(obj->traits()) != BUILTIN_qName);
        AvmAssert(MMgc::GC::Size(obj) >= sizeof(ScriptObject));
        (void)obj;

        // This commented-out code probably pertains to Bugzilla 507699:
        // "Dictionary key of Xml type are not matching."
        //
        // FIXME: this doesn't work, need to convert back to an XMLObject
        // on the way out or intern XMLObject's somehow
        //if(AvmCore::isXML(key))
        //  key = AvmCore::genericObjectToAtom(AvmCore::atomToXML(key));

        return key;
    }
开发者ID:Adime,项目名称:redtamarin,代码行数:18,代码来源:DictionaryGlue.cpp


示例13: VMPI_system

int VMPI_system(const char *command)
{
    #ifdef UNDER_CE
        AvmAssert(0);
        return 0;
    #else
        return system( command );
    #endif
}
开发者ID:Corsaair,项目名称:redtamarin,代码行数:9,代码来源:WinPortUtils2.cpp


示例14: AvmAssert

 template<class T> T SeqBuilder<T>::dequeue()
 {
     AvmAssert(items != NULL);
     T v = items->hd;
     items = items->tl;
     if (items == NULL)
         last = NULL;
     return v;
 }
开发者ID:AdiKo,项目名称:avmplus,代码行数:9,代码来源:eval-util.cpp


示例15: ScriptObject

    ClassClosure::ClassClosure(VTable* cvtable)
        : ScriptObject(cvtable, NULL)
        , m_createInstanceProc(checkForRestrictedInheritance(cvtable->ivtable, cvtable->ivtable->createInstanceProc))
        // NB: prototype is null right now, but we expect our subclass to
        // initialize it in their ctor (or, at a minimum, before it attempts
        // to create any instances).
    {
        AvmAssert(traits()->getSizeOfInstance() >= sizeof(ClassClosure));

        // All callers of this ctor must have a non-null ivtable.
        AvmAssert(cvtable->ivtable != NULL);
        cvtable->ivtable->createInstanceProc = ClassClosure::reinitNullPrototypeCreateInstanceProc;
        AvmAssert(m_createInstanceProc != reinitNullPrototypeCreateInstanceProc);
        
        // don't assert here any more: MethodClosure descends
        //AvmAssert(cvtable->traits->itraits != NULL);
        //AvmAssert(ivtable() != NULL);
    }
开发者ID:AdiKo,项目名称:avmplus,代码行数:18,代码来源:ClassClosure.cpp


示例16: TessaAssert

	void ConsistencyChecker::checkPhiOperandsJumpToCurrentBlock() {
		List<BasicBlock*, LIST_GCObjects>* basicBlocks = _functionToCheck->getBasicBlocks();
		TessaAssert(basicBlocks != NULL);

		for (size_t i = 0; i < basicBlocks->size(); i++) {
			BasicBlock* currentBasicBlock = basicBlocks->get(i);

			if (currentBasicBlock->getPredecessors()->size() > 1) {
				List<PhiInstruction*, LIST_GCObjects>* phiInstructions = currentBasicBlock->getPhiInstructions();

				for (size_t j = 0; j < phiInstructions->size(); j++) {
					PhiInstruction* phiInstruction = phiInstructions->get(j);
					AvmAssert(allPhiOperandsArePredecessors(phiInstruction));
					AvmAssert(phiOperandsExistsInPredecessorBlock(phiInstruction));
				}
			}
		}
	}
开发者ID:changm,项目名称:tessa,代码行数:18,代码来源:ConsistencyChecker.cpp


示例17: ScriptObject

	ArrayObject::ArrayObject(VTable *vtable, ScriptObject* proto, uint32 capacity)
		: ScriptObject(vtable, proto, 0),
		m_denseArr(capacity)
	{
		SAMPLE_FRAME("Array", core());
		AvmAssert(traits()->getSizeOfInstance() >= sizeof(ArrayObject));
		m_length = 0;
		m_lowHTentry = NO_LOW_HTENTRY;
	}
开发者ID:weimingtom,项目名称:mod-actionscript,代码行数:9,代码来源:ArrayObject.cpp


示例18: AvmAssert

	void CallStackNode::init(AvmCore* core, uint64_t functionId, int32_t lineno)
	{
		AvmAssert(core != NULL);
		AvmAssert(functionId != 0);
		
		m_functionId	= functionId;
		m_info			= NULL;
		m_env			= NULL;
		m_fakename		= NULL;
		m_core          = core;
		m_next          = core->callStack; core->callStack = this;
		m_depth         = m_next ? (m_next->m_depth + 1) : 1;
		m_eip			= NULL;    
		m_filename		= NULL;
		m_framep		= NULL;
		m_traits		= NULL;
		m_linenum		= lineno;
	}
开发者ID:hgl888,项目名称:nashtest,代码行数:18,代码来源:StackTrace.cpp


示例19: AvmAssert

void DomainMgr::addNamedScriptEnvs(AbcEnv* abcEnv, const GCList<ScriptEnv>& envs)
{
    // If the MethodInfo for this ScriptEnv isn't in the Domain's or Pool's
    // map, then we must have filtered it out as unreachable: don't
    // bother adding the ScriptEnv, as we'll never need to look it up.
    // (Note that we don't need to bother checking the parent Domains
    // for this, since we want to check loaded, not cached.) We can't rely
    // on looking up by name, since scripts all tend to be named "global",
    // so instead we make a temporary map of all the entries in the relevant
    // Pool and Domain.

    PoolObject* pool = abcEnv->pool();
    DomainEnv* domainEnv = abcEnv->domainEnv();
    Domain* domain = domainEnv->domain();

    // we have no generic "set" type, so let's use a hashtable for the same purpose
    // (a bit more mem, but short-lived and better average lookup time than using List<>)
    HeapHashtable* ht = HeapHashtable::create(core->GetGC());
    for (StMNHTMethodInfoIterator iter(pool->m_loadedScripts); iter.next(); )
    {
        if (!iter.key()) continue;
        Atom const a = AvmCore::genericObjectToAtom(iter.value());
        ht->add(a, a);
    }
    for (StMNHTMethodInfoIterator iter(domain->m_loadedScripts); iter.next(); )
    {
        if (!iter.key()) continue;
        Atom const a = AvmCore::genericObjectToAtom(iter.value());
        ht->add(a, a);
    }

    for (uint32_t i = 0, n = envs.length(); i < n; ++i)
    {
        ScriptEnv* se = envs[i];
        AvmAssert(se->abcEnv() == abcEnv);
        MethodInfo* mi = se->method;
        AvmAssert(domainEnv->m_scriptEnvMap->get(mi) == NULL);
        if (ht->get(AvmCore::genericObjectToAtom(mi)) == undefinedAtom)
            continue;
        domainEnv->m_scriptEnvMap->add(mi, se);
    }

    delete ht;
}
开发者ID:Adime,项目名称:redtamarin,代码行数:44,代码来源:DomainMgr.cpp


示例20: while

	void NativeInitializer::fillInMethods(const NativeMethodInfo* _methodEntry)
	{
		while (_methodEntry->method_id != -1)
		{
			// if we overwrite a native method mapping, something is hosed
			AvmAssert(methods[_methodEntry->method_id] == NULL);
			methods[_methodEntry->method_id] = _methodEntry;
			_methodEntry++;
		}
	}
开发者ID:PushButtonLabs,项目名称:PBNetworking,代码行数:10,代码来源:NativeFunction.cpp



注:本文中的AvmAssert函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AxisClear函数代码示例发布时间:2022-05-30
下一篇:
C++ Available函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap