mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 1326301. Put the global allocated by SimpleGlobalObject in the system zone, so we don't create tons of zones when we're converting JSON to dictionaries many times over. r=mccr8
This commit is contained in:
parent
a0b925e4e6
commit
6d6f2704fc
@ -104,7 +104,13 @@ SimpleGlobalObject::Create(GlobalType globalType, JS::Handle<JS::Value> proto)
|
||||
JSContext* cx = jsapi.cx();
|
||||
|
||||
JS::CompartmentOptions options;
|
||||
options.creationOptions().setInvisibleToDebugger(true);
|
||||
options.creationOptions()
|
||||
.setInvisibleToDebugger(true)
|
||||
// Put our SimpleGlobalObjects in the system zone, so we won't create
|
||||
// lots of zones for what are probably very short-lived
|
||||
// compartments. This should help them be GCed quicker and take up
|
||||
// less memory before they're GCed.
|
||||
.setZone(JS::SystemZone);
|
||||
|
||||
if (NS_IsMainThread()) {
|
||||
nsCOMPtr<nsIPrincipal> principal = nsNullPrincipal::Create();
|
||||
|
Loading…
Reference in New Issue
Block a user