mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 604756 first try: restrict ropes optimization to main-thread content JS, r=lw, a=b7-blocker
This commit is contained in:
parent
3926178ef7
commit
af0066b448
@ -1232,6 +1232,9 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
|
||||
}
|
||||
}
|
||||
|
||||
if (!chromeWindow)
|
||||
newDefaultJSOptions |= JSOPTION_ROPES;
|
||||
|
||||
if (useTraceJIT)
|
||||
newDefaultJSOptions |= JSOPTION_JIT;
|
||||
else
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user