Bug 868684 - OdinMonkey: sequential compilation allocates LIR in the tempLifoAlloc (r=sstangl)

This commit is contained in:
Luke Wagner 2013-05-06 16:05:19 -07:00
parent e90f668307
commit 3432ad7751
4 changed files with 10 additions and 3 deletions

View File

@ -1059,7 +1059,6 @@ class ModuleCompiler
typedef Vector<AsmJSGlobalAccess> GlobalAccessVector;
JSContext * cx_;
IonContext ictx_;
MacroAssembler masm_;
ScopedJSDeletePtr<AsmJSModule> module_;
@ -1091,7 +1090,6 @@ class ModuleCompiler
public:
ModuleCompiler(JSContext *cx, TokenStream &ts)
: cx_(cx),
ictx_(cx->runtime),
masm_(cx),
moduleFunctionName_(NULL),
globals_(cx),
@ -4521,6 +4519,8 @@ CheckFunctionBodiesSequential(ModuleCompiler &m)
IonSpewNewFunction(&mirGen->graph(), NullPtr());
IonContext icx(m.cx()->compartment, &mirGen->temp());
if (!OptimizeMIR(mirGen))
return m.fail("Internal compiler failure (probably out of memory)", func.fn());

View File

@ -103,6 +103,12 @@ ion::GetIonContext()
return CurrentIonContext();
}
IonContext *
ion::MaybeGetIonContext()
{
return CurrentIonContext();
}
IonContext::IonContext(JSContext *cx, TempAllocator *temp)
: runtime(cx->runtime),
cx(cx),

View File

@ -272,6 +272,7 @@ bool InitializeIon();
// Get and set the current Ion context.
IonContext *GetIonContext();
IonContext *MaybeGetIonContext();
bool SetIonContext(IonContext *ctx);

View File

@ -261,7 +261,7 @@ class Label : public LabelBase
// Note: the condition is a hack to silence this assert when OOM testing,
// see bug 756614.
if (!js_IonOptions.parallelCompilation)
JS_ASSERT_IF(!GetIonContext()->runtime->hadOutOfMemory, !used());
JS_ASSERT_IF(MaybeGetIonContext() && !GetIonContext()->runtime->hadOutOfMemory, !used());
#endif
}
};