Remove useless interpreting flag from execution context
We were maintaining a flag that said if we were interpreting on the EC. It was only used in the implementation of hphp_break(), for pretty minimal benefit. I yanked it… it seems fine to me to throw the switch exception if someone steps out of the hard break even if we're already interpreting. Also yank out a vestige of the previous stepping and breakpoint logic from the dispatch loop I noticed today. I'd previously missed it, but I made a change a while ago to put the state of the last location filter into the hands of the flow control commands. This was unnecessary and should have been removed then.
Esse commit está contido em:
@@ -79,8 +79,7 @@ VMExecutionContext::VMExecutionContext() :
|
||||
m_preg_recursion_limit(RuntimeOption::PregRecursionLimit),
|
||||
m_lambdaCounter(0), m_nesting(0),
|
||||
m_breakPointFilter(nullptr), m_lastLocFilter(nullptr),
|
||||
m_interpreting(false), m_dbgNoBreak(false),
|
||||
m_coverPrevLine(-1), m_coverPrevUnit(nullptr),
|
||||
m_dbgNoBreak(false), m_coverPrevLine(-1), m_coverPrevUnit(nullptr),
|
||||
m_executingSetprofileCallback(false) {
|
||||
|
||||
// Make sure any fields accessed from the TC are within a byte of
|
||||
|
||||
@@ -668,7 +668,6 @@ public:
|
||||
Array getLocalDefinedVariables(int frame);
|
||||
HPHP::PCFilter* m_breakPointFilter;
|
||||
HPHP::PCFilter* m_lastLocFilter;
|
||||
bool m_interpreting;
|
||||
bool m_dbgNoBreak;
|
||||
bool doFCall(HPHP::ActRec* ar, PC& pc);
|
||||
bool doFCallArray(PC& pc);
|
||||
|
||||
@@ -76,8 +76,7 @@ void f_hphpd_break(bool condition /* = true */) {
|
||||
}
|
||||
CallerFrame cf;
|
||||
Debugger::InterruptVMHook(HardBreakPoint);
|
||||
if (RuntimeOption::EvalJit && !g_vmContext->m_interpreting &&
|
||||
DEBUGGER_FORCE_INTR) {
|
||||
if (RuntimeOption::EvalJit && DEBUGGER_FORCE_INTR) {
|
||||
TRACE(5, "switch mode\n");
|
||||
throw VMSwitchModeBuiltin();
|
||||
}
|
||||
|
||||
@@ -7134,8 +7134,6 @@ inline void VMExecutionContext::dispatchImpl(int numInstrs) {
|
||||
ONTRACE(1, \
|
||||
Trace::trace("dispatch: Halt ExecutionContext::dispatch(%p)\n", \
|
||||
m_fp)); \
|
||||
delete g_vmContext->m_lastLocFilter; \
|
||||
g_vmContext->m_lastLocFilter = nullptr; \
|
||||
return; \
|
||||
} \
|
||||
Op op = (Op)*pc; \
|
||||
@@ -7179,21 +7177,7 @@ inline void VMExecutionContext::dispatchImpl(int numInstrs) {
|
||||
#undef DISPATCH
|
||||
}
|
||||
|
||||
class InterpretingFlagGuard {
|
||||
private:
|
||||
bool m_oldFlag;
|
||||
public:
|
||||
InterpretingFlagGuard() {
|
||||
m_oldFlag = g_vmContext->m_interpreting;
|
||||
g_vmContext->m_interpreting = true;
|
||||
}
|
||||
~InterpretingFlagGuard() {
|
||||
g_vmContext->m_interpreting = m_oldFlag;
|
||||
}
|
||||
};
|
||||
|
||||
void VMExecutionContext::dispatch() {
|
||||
InterpretingFlagGuard ifg;
|
||||
if (shouldProfile()) {
|
||||
dispatchImpl<Profile>(0);
|
||||
} else {
|
||||
@@ -7202,7 +7186,6 @@ void VMExecutionContext::dispatch() {
|
||||
}
|
||||
|
||||
void VMExecutionContext::dispatchN(int numInstrs) {
|
||||
InterpretingFlagGuard ifg;
|
||||
dispatchImpl<LimitInstrs | BreakOnCtlFlow>(numInstrs);
|
||||
// We are about to go back to Jit, check whether we should
|
||||
// stick with interpreter
|
||||
@@ -7212,7 +7195,6 @@ void VMExecutionContext::dispatchN(int numInstrs) {
|
||||
}
|
||||
|
||||
void VMExecutionContext::dispatchBB() {
|
||||
InterpretingFlagGuard ifg;
|
||||
dispatchImpl<BreakOnCtlFlow>(0);
|
||||
// We are about to go back to Jit, check whether we should
|
||||
// stick with interpreter
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário