bug 465030 - Support terminating long-running scripts without using extra threads or signals. r=gal,sayrer

This commit is contained in:
Igor Bukanov 2009-01-07 18:45:13 +01:00
Родитель 6e5a11f661
Коммит 8d042c46dd
1 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -1062,14 +1062,13 @@ TraceRecorder::TraceRecorder(JSContext* cx, VMSideExit* _anchor, Fragment* _frag
/* read into registers all values on the stack and all globals we know so far */
import(treeInfo, lirbuf->sp, ngslots, callDepth, globalTypeMap, stackTypeMap);
#if defined(JS_HAS_OPERATION_COUNT) && !JS_HAS_OPERATION_COUNT
if (fragment == fragment->root) {
guard(false,
lir->ins_eq0(lir->insLoadi(cx_ins,
offsetof(JSContext, operationCount))),
snapshot(TIMEOUT_EXIT));
LIns* counter = lir->insLoadi(cx_ins,
offsetof(JSContext, operationCount));
LIns* updated = lir->ins2i(LIR_sub, counter, JSOW_SCRIPT_JUMP);
lir->insStorei(updated, cx_ins, offsetof(JSContext, operationCount));
guard(false, lir->ins2i(LIR_le, updated, 0), snapshot(TIMEOUT_EXIT));
}
#endif
/* If we are attached to a tree call guard, make sure the guard the inner tree exited from
is what we expect it to be. */