From 1b282006e06bb91a3e3cc7e543d7e06087794d3a Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Thu, 10 Sep 2009 16:05:47 -0700 Subject: [PATCH] Bug 516567 - Remove unused error codes from Assembler, r=gal. --- js/src/jsregexp.cpp | 7 ++----- js/src/jstracer.cpp | 6 +++--- js/src/nanojit/Assembler.h | 6 ------ 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/js/src/jsregexp.cpp b/js/src/jsregexp.cpp index 4f5ae6d6e25..26dfa351833 100644 --- a/js/src/jsregexp.cpp +++ b/js/src/jsregexp.cpp @@ -3098,7 +3098,6 @@ class RegExpNativeCompiler { { GuardRecord* guard = NULL; LIns* pos; - bool oom = false; const jschar* re_chars; size_t re_length; JSTraceMonitor* tm = &JS_TRACE_MONITOR(cx); @@ -3176,10 +3175,8 @@ class RegExpNativeCompiler { if (alloc.outOfMemory()) goto fail; ::compile(assm, fragment, alloc verbose_only(, tm->labels)); - if (assm->error() != nanojit::None) { - oom = assm->error() == nanojit::OutOMem; + if (assm->error() != nanojit::None) goto fail; - } delete lirBufWriter; #ifdef DEBUG @@ -3191,7 +3188,7 @@ class RegExpNativeCompiler { #endif return JS_TRUE; fail: - if (alloc.outOfMemory() || oom || js_OverfullJITCache(tm)) { + if (alloc.outOfMemory() || js_OverfullJITCache(tm)) { delete lirBufWriter; js_ResetJIT(cx); } else { diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 510ff45e178..2730b95aa81 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -3676,7 +3676,7 @@ TraceRecorder::compile(JSTraceMonitor* tm) Assembler *assm = tm->assembler; ::compile(assm, fragment, *tm->allocator verbose_only(, tm->labels)); - if (assm->error() == nanojit::OutOMem) + if (tm->allocator->outOfMemory()) return; if (assm->error() != nanojit::None) { @@ -4566,8 +4566,8 @@ DeleteRecorder(JSContext* cx) tm->recorder = NULL; /* If we ran out of memory, flush the code cache. */ - Assembler *assm = JS_TRACE_MONITOR(cx).assembler; - if (assm->error() == OutOMem || js_OverfullJITCache(tm)) { + if (tm->allocator->outOfMemory() || + js_OverfullJITCache(tm)) { ResetJIT(cx, FR_OOM); return false; } diff --git a/js/src/nanojit/Assembler.h b/js/src/nanojit/Assembler.h index 9cfa206dcfc..7f2bf3907a6 100644 --- a/js/src/nanojit/Assembler.h +++ b/js/src/nanojit/Assembler.h @@ -100,13 +100,7 @@ namespace nanojit enum AssmError { None = 0 - ,OutOMem ,StackFull - ,RegionFull - ,MaxLength - ,MaxExit - ,MaxXJump - ,UnknownPrim ,UnknownBranch };