Bug 604756 first try: restrict ropes optimization to main-thread content JS, r=lw, a=b7-blocker

This commit is contained in:
David Mandelin 2010-10-25 17:28:18 -07:00
parent 3926178ef7
commit af0066b448
4 changed files with 8 additions and 1 deletions

View File

@ -1232,6 +1232,9 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
}
}
if (!chromeWindow)
newDefaultJSOptions |= JSOPTION_ROPES;
if (useTraceJIT)
newDefaultJSOptions |= JSOPTION_JIT;
else

View File

@ -915,6 +915,8 @@ JS_StringToVersion(const char *string);
embedding. */
#define JSOPTION_METHODJIT JS_BIT(14) /* Whole-method JIT. */
#define JSOPTION_ROPES JS_BIT(16) /* Enable rope optimization for
* string concat. */
extern JS_PUBLIC_API(uint32)
JS_GetOptions(JSContext *cx);

View File

@ -268,6 +268,8 @@ FinishConcat(JSContext *cx, bool usingLeft, bool usingRight,
left->convertToInteriorNode(res);
if (usingRight)
right->convertToInteriorNode(res);
if (!JS_HAS_OPTION(cx, JSOPTION_ROPES))
res->flatten();
return res;
}

View File

@ -5386,7 +5386,7 @@ main(int argc, char **argv, char **envp)
if (!cx)
return 1;
JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_ANONFUNFIX);
JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_ANONFUNFIX | JSOPTION_ROPES);
JS_SetGCParameterForThread(cx, JSGC_MAX_CODE_CACHE_BYTES, 16 * 1024 * 1024);
result = Shell(cx, argc, argv, envp);