Bug 958882 - Add script size limit for TI new-script analysis. r=djvj

This commit is contained in:
Jan de Mooij 2014-01-14 10:26:46 +01:00
parent 0e05b3a258
commit 496ed98f03

View File

@ -2150,6 +2150,10 @@ jit::AnalyzeNewScriptProperties(JSContext *cx, JSFunction *fun,
if (!script->compileAndGo() || !script->canBaselineCompile())
return true;
static const uint32_t MAX_SCRIPT_SIZE = 2000;
if (script->length() > MAX_SCRIPT_SIZE)
return true;
Vector<PropertyName *> accessedProperties(cx);
LifoAlloc alloc(types::TypeZone::TYPE_LIFO_ALLOC_PRIMARY_CHUNK_SIZE);