Empty loops need to check surprise flags

We didnt count a brach to itself as a backward branch.
Also, there seemed to be a signed vs unsigned issue with IterBreak.
Esse commit está contido em:
mwilliams
2013-07-17 15:11:27 -07:00
commit de Sara Golemon
commit 76aed9f150
2 arquivos alterados com 3 adições e 3 exclusões
+1 -1
Ver Arquivo
@@ -3948,7 +3948,7 @@ inline void OPTBLD_INLINE VMExecutionContext::iopFatal(PC& pc) {
}
inline void OPTBLD_INLINE VMExecutionContext::jmpSurpriseCheck(Offset offset) {
if (offset < 0 && UNLIKELY(Transl::TargetCache::loadConditionFlags())) {
if (offset <= 0 && UNLIKELY(Transl::TargetCache::loadConditionFlags())) {
EventHook::CheckSurprise();
}
}
+2 -2
Ver Arquivo
@@ -1107,7 +1107,7 @@ void HhbcTranslator::emitIterBreak(const ImmVector& iv,
uint32_t offset,
bool breakTracelet,
bool noSurprise) {
bool backward = (offset - (int32_t)bcOff()) < 0;
bool backward = offset <= bcOff();
if (backward && !noSurprise) {
gen(ExitWhenSurprised, getExitSlowTrace());
}
@@ -1615,7 +1615,7 @@ void HhbcTranslator::emitJmp(int32_t offset,
bool breakTracelet,
bool noSurprise) {
// If surprise flags are set, exit trace and handle surprise
bool backward = (offset - (int32_t)bcOff()) < 0;
bool backward = (uint32_t)offset <= bcOff();
if (backward && !noSurprise) {
gen(ExitWhenSurprised, getExitSlowTrace());
}