mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 471602 part 1: make regexp compiler use one shared LIR buffer, r=gal
This commit is contained in:
parent
67cd92d2ce
commit
90baccb99f
@ -97,6 +97,7 @@ typedef struct JSGSNCache {
|
||||
namespace nanojit {
|
||||
class Fragment;
|
||||
class Fragmento;
|
||||
class LirBuffer;
|
||||
}
|
||||
class TraceRecorder;
|
||||
extern "C++" { template<typename T> class Queue; }
|
||||
@ -132,6 +133,7 @@ typedef struct JSTraceMonitor {
|
||||
/* Fragmento for the regular expression compiler. This is logically
|
||||
* a distinct compiler but needs to be managed in exactly the same
|
||||
* way as the real tracing Fragmento. */
|
||||
CLS(nanojit::LirBuffer) reLirBuf;
|
||||
CLS(nanojit::Fragmento) reFragmento;
|
||||
|
||||
/* Keep a list of recorders we need to abort on cache flush. */
|
||||
|
@ -2053,6 +2053,7 @@ class RegExpNativeCompiler {
|
||||
JSRegExp* re;
|
||||
CompilerState* cs; /* RegExp to compile */
|
||||
Fragment* fragment;
|
||||
LirBuffer* lirbuf;
|
||||
LirWriter* lir;
|
||||
LirBufWriter* lirBufWriter; /* for skip */
|
||||
|
||||
@ -2424,8 +2425,7 @@ GetNativeRegExp(JSContext* cx, JSRegExp* re)
|
||||
return NULL;
|
||||
} else {
|
||||
fragment = fragmento->getAnchor(hash);
|
||||
fragment->lirbuf = new (&gc) LirBuffer(fragmento, NULL);
|
||||
/* required to have the onDestroy method delete the lirbuf. */
|
||||
fragment->lirbuf = JS_TRACE_MONITOR(cx).reLirBuf;
|
||||
fragment->root = fragment;
|
||||
}
|
||||
|
||||
|
@ -2699,7 +2699,7 @@ nanojit::LirNameMap::formatGuard(LIns *i, char *out)
|
||||
void
|
||||
nanojit::Fragment::onDestroy()
|
||||
{
|
||||
if (root == this) {
|
||||
if (root == this && lirbuf && !lirbuf->shared) {
|
||||
delete lirbuf;
|
||||
}
|
||||
delete (TreeInfo *)vmprivate;
|
||||
@ -4034,6 +4034,8 @@ js_InitJIT(JSTraceMonitor *tm)
|
||||
Fragmento* fragmento = new (&gc) Fragmento(core, 20);
|
||||
verbose_only(fragmento->labels = new (&gc) LabelMap(core, NULL);)
|
||||
tm->reFragmento = fragmento;
|
||||
tm->reLirBuf = new (&gc) LirBuffer(fragmento, NULL);
|
||||
tm->reLirBuf->shared = true;
|
||||
}
|
||||
InitIMacroCode();
|
||||
#if !defined XP_WIN
|
||||
@ -4071,6 +4073,7 @@ js_FinishJIT(JSTraceMonitor *tm)
|
||||
tm->recoveryDoublePool = tm->recoveryDoublePoolPtr = NULL;
|
||||
}
|
||||
if (tm->reFragmento != NULL) {
|
||||
delete tm->reLirBuf;
|
||||
verbose_only(delete tm->reFragmento->labels;)
|
||||
delete tm->reFragmento;
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ namespace nanojit
|
||||
|
||||
// LCompressedBuffer
|
||||
LirBuffer::LirBuffer(Fragmento* frago, const CallInfo* functions)
|
||||
: _frago(frago), _pages(frago->core()->GetGC()), _functions(functions), abi(ABI_FASTCALL)
|
||||
: _frago(frago), _pages(frago->core()->GetGC()), _functions(functions), abi(ABI_FASTCALL), shared(false)
|
||||
{
|
||||
clear();
|
||||
Page* start = pageAlloc();
|
||||
|
@ -715,6 +715,8 @@ namespace nanojit
|
||||
LInsp savedRegs[NumSavedRegs];
|
||||
bool explicitSavedRegs;
|
||||
|
||||
bool shared;
|
||||
|
||||
protected:
|
||||
friend class LirBufWriter;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user