From e3ddc7715970473614be9c555f2daa75e47876ef Mon Sep 17 00:00:00 2001 From: Owen Yamauchi Date: Wed, 12 Jun 2013 15:41:45 -0700 Subject: [PATCH] Kill InclOpLocal This one's an artifact of ReqMod and ReqSrc, which don't exist anymore. --- hphp/runtime/base/execution_context.h | 6 ++---- hphp/runtime/vm/bytecode.cpp | 28 ++++++++++----------------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/hphp/runtime/base/execution_context.h b/hphp/runtime/base/execution_context.h index c8a2ea4d4..6407d23f5 100644 --- a/hphp/runtime/base/execution_context.h +++ b/hphp/runtime/base/execution_context.h @@ -149,9 +149,8 @@ enum InclOpFlags { InclOpDefault = 0, InclOpFatal = 1, InclOpOnce = 2, - InclOpLocal = 4, InclOpDocRoot = 8, - InclOpRelative = 16 + InclOpRelative = 16, }; inline InclOpFlags @@ -628,8 +627,7 @@ public: HPHP::Eval::PhpFile* lookupIncludeRoot(StringData* path, InclOpFlags flags, bool* initial, HPHP::Unit* unit = 0); - bool evalUnit(HPHP::Unit* unit, bool local, - PC& pc, int funcType); + bool evalUnit(HPHP::Unit* unit, PC& pc, int funcType); void invokeUnit(TypedValue* retval, HPHP::Unit* unit); HPHP::Unit* compileEvalString(StringData* code); CStrRef createFunction(CStrRef args, CStrRef code); diff --git a/hphp/runtime/vm/bytecode.cpp b/hphp/runtime/vm/bytecode.cpp index 4c3224ff4..ff531fa84 100644 --- a/hphp/runtime/vm/bytecode.cpp +++ b/hphp/runtime/vm/bytecode.cpp @@ -2415,8 +2415,7 @@ HPHP::Eval::PhpFile* VMExecutionContext::lookupIncludeRoot(StringData* path, return true iff the pseudomain needs to be executed. */ -bool VMExecutionContext::evalUnit(Unit* unit, bool local, - PC& pc, int funcType) { +bool VMExecutionContext::evalUnit(Unit* unit, PC& pc, int funcType) { m_pc = pc; unit->merge(); if (unit->isMergeOnly()) { @@ -2430,10 +2429,7 @@ bool VMExecutionContext::evalUnit(Unit* unit, bool local, ActRec* ar = m_stack.allocA(); assert((uintptr_t)&ar->m_func < (uintptr_t)&ar->m_r); Class* cls = curClass(); - if (local) { - cls = nullptr; - ar->setThis(nullptr); - } else if (m_fp->hasThis()) { + if (m_fp->hasThis()) { ObjectData *this_ = m_fp->getThis(); this_->incRefCount(); ar->setThis(this_); @@ -2455,15 +2451,12 @@ bool VMExecutionContext::evalUnit(Unit* unit, bool local, ar->m_savedRip = (uintptr_t)tx64->getRetFromInterpretedFrame(); assert(isReturnHelper(ar->m_savedRip)); pushLocalsAndIterators(func); - if (local) { - ar->m_varEnv = 0; - } else { - if (!m_fp->hasVarEnv()) { - m_fp->m_varEnv = VarEnv::createLazyAttach(m_fp); - } - ar->m_varEnv = m_fp->m_varEnv; - ar->m_varEnv->attach(ar); + if (!m_fp->hasVarEnv()) { + m_fp->m_varEnv = VarEnv::createLazyAttach(m_fp); } + ar->m_varEnv = m_fp->m_varEnv; + ar->m_varEnv->attach(ar); + m_fp = ar; pc = func->getEntry(); SYNC(); @@ -6334,11 +6327,10 @@ inline void OPTBLD_INLINE inclOp(VMExecutionContext *ec, PC &pc, Cell* c1 = ec->m_stack.topC(); String path(prepareKey(c1)); bool initial; - TRACE(2, "inclOp %s %s %s %s %s \"%s\"\n", + TRACE(2, "inclOp %s %s %s %s \"%s\"\n", flags & InclOpOnce ? "Once" : "", flags & InclOpDocRoot ? "DocRoot" : "", flags & InclOpRelative ? "Relative" : "", - flags & InclOpLocal ? "Local" : "", flags & InclOpFatal ? "Fatal" : "", path->data()); @@ -6354,7 +6346,7 @@ inline void OPTBLD_INLINE inclOp(VMExecutionContext *ec, PC &pc, ec->m_stack.pushFalse(); } else { if (!(flags & InclOpOnce) || initial) { - ec->evalUnit(u, (flags & InclOpLocal), pc, EventHook::PseudoMain); + ec->evalUnit(u, pc, EventHook::PseudoMain); } else { Stats::inc(Stats::PseudoMain_Guarded); ec->m_stack.pushTrue(); @@ -6392,7 +6384,7 @@ inline void OPTBLD_INLINE VMExecutionContext::iopEval(PC& pc) { raise_error("Syntax error in eval()"); } m_stack.popC(); - evalUnit(unit, false, pc, EventHook::Eval); + evalUnit(unit, pc, EventHook::Eval); } inline void OPTBLD_INLINE VMExecutionContext::iopDefFunc(PC& pc) {