From b5097e03aacec8439a596be055985547f746414d Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Wed, 23 Sep 2009 18:46:34 -0700 Subject: [PATCH] Bug 497009 - Deallocate LIR after recording, r=gal. --HG-- extra : rebase_source : 5fc9d76620f83d3bbf6ba7a4656c296654bb6323 --- js/src/jsregexp.cpp | 1 + js/src/jstracer.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/js/src/jsregexp.cpp b/js/src/jsregexp.cpp index ea618ad46e2..31dc17d2d38 100755 --- a/js/src/jsregexp.cpp +++ b/js/src/jsregexp.cpp @@ -3109,6 +3109,7 @@ class RegExpNativeCompiler { ~RegExpNativeCompiler() { /* Purge the tempAlloc used during recording. */ tempAlloc.reset(); + JS_TRACE_MONITOR(cx).reLirBuf->clear(); } JSBool compile() diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 7af896eeced..7b671af6748 100755 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -2290,6 +2290,7 @@ TraceRecorder::~TraceRecorder() /* Purge the tempAlloc used during recording. */ tempAlloc.reset(); + traceMonitor->lirbuf->clear(); #ifdef DEBUG debug_only_stmt( delete verbose_filter; ) @@ -2598,8 +2599,8 @@ JSTraceMonitor::flush() } assembler = new (alloc) Assembler(*codeAlloc, alloc, core, &js_LogController); - lirbuf = new (alloc) LirBuffer(alloc); - reLirBuf = new (alloc) LirBuffer(alloc); + lirbuf = new (alloc) LirBuffer(*tempAlloc); + reLirBuf = new (alloc) LirBuffer(*reTempAlloc); verbose_only( branches = NULL; ) #ifdef DEBUG