Use unit->isInterpretOnly() inside JIT, not VM, so that debugger eval can invoke JITted code

The units that result from Eval code injected by the debugger should always be interpreted because they are used once only, however, any code invoked by these units should be JITtable. This diff moves the test for disabling the JIT from VMExecutionContext to Translator::isSrcKeyInB. It also fixes a cut&paste error that inverted the logic for Unit::isInterpretOnly().

Differential Revision: D913723

Blame Revision: D904873
Esse commit está contido em:
Herman Venter
2013-08-02 22:28:11 -07:00
commit de Sara Golemon
commit 205ec4913f
3 arquivos alterados com 4 adições e 8 exclusões
+2 -7
Ver Arquivo
@@ -1508,15 +1508,10 @@ void VMExecutionContext::syncGdbState() {
}
}
static bool jitIsEnabled(const Unit* unit) {
if (!ThreadInfo::s_threadInfo->m_reqInjectionData.getJit()) return false;
return unit == nullptr || !unit->isInterpretOnly();
}
void VMExecutionContext::enterVMPrologue(ActRec* enterFnAr) {
assert(enterFnAr);
Stats::inc(Stats::VMEnter);
if (jitIsEnabled(enterFnAr->m_func->unit())) {
if (ThreadInfo::s_threadInfo->m_reqInjectionData.getJit()) {
int np = enterFnAr->m_func->numParams();
int na = enterFnAr->numArgs();
if (na > np) na = np + 1;
@@ -1537,7 +1532,7 @@ void VMExecutionContext::enterVMWork(ActRec* enterFnAr) {
start = enterFnAr->m_func->getFuncBody();
}
Stats::inc(Stats::VMEnter);
if (jitIsEnabled(m_fp->unit())) {
if (ThreadInfo::s_threadInfo->m_reqInjectionData.getJit()) {
(void) m_fp->unit()->offsetOf(m_pc); /* assert */
if (enterFnAr) {
assert(start);