From a111aaa518a002726edf2bfa46992ee7f82a9112 Mon Sep 17 00:00:00 2001 From: Guilherme Ottoni Date: Fri, 3 May 2013 18:19:50 -0700 Subject: [PATCH] Streamline exits from HHIR to Interp when Tx64 is off If Tx64 is disabled, change slow exits to call the interpreter directly. --- hphp/runtime/vm/translator/hopt/codegen.cpp | 28 +++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/hphp/runtime/vm/translator/hopt/codegen.cpp b/hphp/runtime/vm/translator/hopt/codegen.cpp index c30f41b74..3d856e834 100644 --- a/hphp/runtime/vm/translator/hopt/codegen.cpp +++ b/hphp/runtime/vm/translator/hopt/codegen.cpp @@ -2444,13 +2444,13 @@ void CodeGenerator::cgExitTrace(IRInstruction* inst) { uint64_t notTaken = notTakenPC->getValInt(); m_astubs.setcc(cc, rbyte(serviceReqArgRegs[4])); - m_tx64-> emitServiceReq(TranslatorX64::SRFlags::SRInline, - REQ_BIND_JMPCC_FIRST, - 4ull, - smashAddr, - taken, - notTaken, - uint64_t(cc)); + m_tx64->emitServiceReq(TranslatorX64::SRFlags::SRInline, + REQ_BIND_JMPCC_FIRST, + 4ull, + smashAddr, + taken, + notTaken, + uint64_t(cc)); } else { // NormalCc exit but not optimized to jcc directly to destination m_tx64->emitBindJmp(a, destSK, REQ_BIND_JMP); @@ -2496,10 +2496,18 @@ void CodeGenerator::cgExitTrace(IRInstruction* inst) { VM::opcodeToName(op)).str(); m_tx64->emitRecordPunt(a, name); } - if (exitType == TraceExitType::Slow) { - m_tx64->emitBindJmp(a, destSK, REQ_BIND_JMP_NO_IR); + if (RuntimeOption::EvalHHIRDisableTx64) { + // Emit a service request to interpret a single instruction before + // creating a new translation + m_tx64->emitServiceReq(TranslatorX64::SRFlags::SRInline, + REQ_INTERPRET, + 2ull, uint64_t(destSK.offset()), 1); } else { - m_tx64->emitReqRetransNoIR(a, destSK); + if (exitType == TraceExitType::Slow) { + m_tx64->emitBindJmp(a, destSK, REQ_BIND_JMP_NO_IR); + } else { // SlowNoProgress + m_tx64->emitReqRetransNoIR(a, destSK); + } } break; case TraceExitType::GuardFailure: