Bug 895144 - Treat asm.js Functions as long-lived by default; r=luke

--HG--
extra : rebase_source : 6e08bf3d0575d26de3ac6ba41d703168a1f4a429
This commit is contained in:
Terrence Cole 2013-07-17 16:25:42 -07:00
Родитель 1995e8146e
Коммит c706f52dfe
2 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -471,6 +471,9 @@ FunctionBox::FunctionBox(ExclusiveContext *cx, ObjectBox* traceListHead, JSFunct
usesApply(false), usesApply(false),
funCxFlags() funCxFlags()
{ {
// Functions created at parse time may be set singleton after parsing and
// baked into JIT code, so they must be allocated tenured. They are held by
// the JSScript so cannot be collected during a minor GC anyway.
JS_ASSERT(fun->isTenured()); JS_ASSERT(fun->isTenured());
if (!outerpc) { if (!outerpc) {

Просмотреть файл

@ -4664,9 +4664,10 @@ ParseFunction(ModuleCompiler &m, ParseNode **fnOut)
if (!fn) if (!fn)
return false; return false;
// This flows into FunctionBox, so must be tenured.
RootedFunction fun(m.cx(), NewFunction(m.cx(), NullPtr(), NULL, 0, JSFunction::INTERPRETED, RootedFunction fun(m.cx(), NewFunction(m.cx(), NullPtr(), NULL, 0, JSFunction::INTERPRETED,
m.cx()->global(), name, JSFunction::FinalizeKind, m.cx()->global(), name, JSFunction::FinalizeKind,
GenericObject)); TenuredObject));
if (!fun) if (!fun)
return false; return false;