当前位置: 首页>>代码示例>>C++>>正文


C++ AvmAssert函数代码示例

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


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


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