Exemple #1
0
	// entry point when the first call to the method is late bound.
	/*static*/ Atom MethodInfo::verifyCoerceEnter(MethodEnv* env, int argc, Atom* args)
	{
		MethodInfo* f = env->method;

		#ifdef AVMPLUS_VERIFYALL
		// never verify late in verifyall mode
		AvmAssert(!f->pool()->core->config.verifyall);
		#endif

		f->verify(env->toplevel(), env->abcEnv());

#if VMCFG_METHODENV_IMPL32
		// we got here by calling env->_implGPR, which now is pointing to verifyEnter(),
		// but next time we want to call the real code, not verifyEnter again.
		// All other MethodEnv's in their default state will call the target method
		// directly and never go through verifyEnter().
		env->_implGPR = f->implGPR();
#endif

        AvmAssert(f->_invoker != MethodInfo::verifyCoerceEnter);
		return f->invoke(env, argc, args);
	}
Exemple #2
0
    // increment the invocation counter, return true once method is compiled
    REALLY_INLINE bool OSR::countInvoke(MethodEnv* env)
    {
        MethodInfo* m = env->method;
        if (--m->_abc.countdown)
            return false;
        if (m->isInterpreted()) {
#ifdef AVMPLUS_VERBOSE
            if (m->pool()->isVerbose(VB_execpolicy))
                env->core()->console <<
                    "execpolicy jit hot-call " << env->method << "\n";
#endif
            AvmAssert(!m->hasFailedJit());
            BaseExecMgr* exec = BaseExecMgr::exec(env);
            exec->verifyJit(m, m->getMethodSignature(),
                            env->toplevel(), env->abcEnv(), NULL);
            if (m->hasFailedJit())
                return false;
        }
        // Method was already compiled; we got here because env->_implGPR
        // was not updated.  Update it now.
        env->_implGPR = env->method->_implGPR;
        return true;
    }