From 76e73d8022036deb9a1e472af2c32656b4f54f12 Mon Sep 17 00:00:00 2001 From: Edwin Smith Date: Tue, 4 Aug 2009 15:03:34 -0400 Subject: [PATCH] Bug 510095 - allocate LirBuffer with Allocator instead of GC, don't extend GCFinalizedObject, r=gal. --HG-- extra : rebase_source : 42aa431e0d795351860f0794ea0392e1f663132b --- js/src/jstracer.cpp | 4 ++-- js/src/nanojit/Fragmento.h | 7 ++++--- js/src/nanojit/LIR.cpp | 5 ----- js/src/nanojit/LIR.h | 5 ++--- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 9abab6485646..15b05f6f8063 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -6428,7 +6428,7 @@ js_InitJIT(JSTraceMonitor *tm) Fragmento* fragmento = new (&gc) Fragmento(core, &js_LogController, 32, tm->codeAlloc); verbose_only(fragmento->labels = new (alloc) LabelMap(alloc, &js_LogController);) tm->fragmento = fragmento; - tm->lirbuf = new (&gc) LirBuffer(alloc); + tm->lirbuf = new LirBuffer(alloc); #ifdef DEBUG tm->lirbuf->names = new (alloc) LirNameMap(alloc, tm->fragmento->labels); #endif @@ -6457,7 +6457,7 @@ js_InitJIT(JSTraceMonitor *tm) Fragmento* fragmento = new (&gc) Fragmento(core, &js_LogController, 32, tm->reCodeAlloc); verbose_only(fragmento->labels = new (reAlloc) LabelMap(reAlloc, &js_LogController);) tm->reFragmento = fragmento; - tm->reLirBuf = new (&gc) LirBuffer(reAlloc); + tm->reLirBuf = new LirBuffer(reAlloc); #ifdef DEBUG tm->reLirBuf->names = new (reAlloc) LirNameMap(reAlloc, fragmento->labels); #endif diff --git a/js/src/nanojit/Fragmento.h b/js/src/nanojit/Fragmento.h index f738d11a18e7..5f6ac89c6a63 100644 --- a/js/src/nanojit/Fragmento.h +++ b/js/src/nanojit/Fragmento.h @@ -166,9 +166,10 @@ namespace nanojit DWB(Fragment*) parent; DWB(Fragment*) first; DWB(Fragment*) peer; - DWB(LirBuffer*) lirbuf; - LIns* lastIns; - SideExit* spawnedFrom; + LirBuffer* lirbuf; + LIns* lastIns; + SideExit* spawnedFrom; + GuardRecord* outbound; TraceKind kind; const void* ip; diff --git a/js/src/nanojit/LIR.cpp b/js/src/nanojit/LIR.cpp index a756e59ffbf8..eb0bfed51f62 100644 --- a/js/src/nanojit/LIR.cpp +++ b/js/src/nanojit/LIR.cpp @@ -120,11 +120,6 @@ namespace nanojit clear(); } - LirBuffer::~LirBuffer() - { - clear(); - } - void LirBuffer::clear() { // clear the stats, etc diff --git a/js/src/nanojit/LIR.h b/js/src/nanojit/LIR.h index 7c6595ccbf35..0380fef58a11 100644 --- a/js/src/nanojit/LIR.h +++ b/js/src/nanojit/LIR.h @@ -1081,11 +1081,10 @@ namespace nanojit LIns* insGuard(LOpcode op, LInsp cond, LIns *x); }; - class LirBuffer : public GCFinalizedObject + class LirBuffer { public: LirBuffer(Allocator&); - ~LirBuffer(); void clear(); uintptr_t makeRoom(size_t szB); // make room for an instruction @@ -1137,7 +1136,7 @@ namespace nanojit class LirBufWriter : public LirWriter { - DWB(LirBuffer*) _buf; // underlying buffer housing the instructions + LirBuffer* _buf; // underlying buffer housing the instructions public: LirBufWriter(LirBuffer* buf)