mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
Bug 903519 - Allocate strings in the nursery if enabled, r=jonco
This patch will have no effect unless MOZ_ENABLE_NURSERY_STRINGS is set or --enable-strings is passed. --HG-- extra : rebase_source : 1e8b41e699f2dfbef8ad97c0915ca89194819526
This commit is contained in:
parent
8e6a6ef6e5
commit
d2a1fc03d4
@ -9122,7 +9122,7 @@ main(int argc, char** argv, char** envp)
|
||||
|| !op.addBoolOption('\0', "non-writable-jitcode", "(NOP for fuzzers) Allocate JIT code as non-writable memory.")
|
||||
|| !op.addBoolOption('\0', "no-sse3", "Pretend CPU does not support SSE3 instructions and above "
|
||||
"to test JIT codegen (no-op on platforms other than x86 and x64).")
|
||||
|| !op.addBoolOption('\0', "no-sse4", "Pretend CPU does not support SSE4 instructions"
|
||||
|| !op.addBoolOption('\0', "no-sse4", "Pretend CPU does not support SSE4 instructions "
|
||||
"to test JIT codegen (no-op on platforms other than x86 and x64).")
|
||||
|| !op.addBoolOption('\0', "enable-avx", "AVX is disabled by default. Enable AVX. "
|
||||
"(no-op on platforms other than x86 and x64).")
|
||||
@ -9139,6 +9139,7 @@ main(int argc, char** argv, char** envp)
|
||||
|| !op.addBoolOption('\0', "no-ggc", "Disable Generational GC")
|
||||
|| !op.addBoolOption('\0', "no-cgc", "Disable Compacting GC")
|
||||
|| !op.addBoolOption('\0', "no-incremental-gc", "Disable Incremental GC")
|
||||
|| !op.addBoolOption('\0', "nursery-strings", "Allocate strings in the nursery")
|
||||
|| !op.addIntOption('\0', "available-memory", "SIZE",
|
||||
"Select GC settings based on available memory (MB)", 0)
|
||||
|| !op.addStringOption('\0', "arm-hwcap", "[features]",
|
||||
@ -9286,6 +9287,9 @@ main(int argc, char** argv, char** envp)
|
||||
|
||||
js::UseInternalJobQueues(cx);
|
||||
|
||||
if (op.getBoolOption("nursery-strings"))
|
||||
cx->runtime()->gc.nursery().enableStrings();
|
||||
|
||||
if (!JS::InitSelfHostedCode(cx))
|
||||
return 1;
|
||||
|
||||
|
@ -122,7 +122,7 @@ JSRope::new_(JSContext* cx,
|
||||
{
|
||||
if (!validateLength(cx, length))
|
||||
return nullptr;
|
||||
JSRope* str = js::Allocate<JSRope, allowGC>(cx, js::gc::TenuredHeap);
|
||||
JSRope* str = js::Allocate<JSRope, allowGC>(cx, js::gc::DefaultHeap);
|
||||
if (!str)
|
||||
return nullptr;
|
||||
str->init(cx, left, right, length);
|
||||
@ -182,7 +182,7 @@ JSDependentString::new_(JSContext* cx, JSLinearString* baseArg, size_t start,
|
||||
if (baseArg->isExternal() && !baseArg->ensureFlat(cx))
|
||||
return nullptr;
|
||||
|
||||
JSDependentString* str = js::Allocate<JSDependentString, js::NoGC>(cx, js::gc::TenuredHeap);
|
||||
JSDependentString* str = js::Allocate<JSDependentString, js::NoGC>(cx, js::gc::DefaultHeap);
|
||||
if (str) {
|
||||
str->init(cx, baseArg, start, length);
|
||||
return str;
|
||||
@ -190,7 +190,7 @@ JSDependentString::new_(JSContext* cx, JSLinearString* baseArg, size_t start,
|
||||
|
||||
js::RootedLinearString base(cx, baseArg);
|
||||
|
||||
str = js::Allocate<JSDependentString>(cx, js::gc::TenuredHeap);
|
||||
str = js::Allocate<JSDependentString>(cx, js::gc::DefaultHeap);
|
||||
if (!str)
|
||||
return nullptr;
|
||||
str->init(cx, base, start, length);
|
||||
@ -226,7 +226,7 @@ JSFlatString::new_(JSContext* cx, const CharT* chars, size_t length)
|
||||
if (cx->compartment()->isAtomsCompartment())
|
||||
str = js::Allocate<js::NormalAtom, allowGC>(cx);
|
||||
else
|
||||
str = js::Allocate<JSFlatString, allowGC>(cx, js::gc::TenuredHeap);
|
||||
str = js::Allocate<JSFlatString, allowGC>(cx, js::gc::DefaultHeap);
|
||||
if (!str)
|
||||
return nullptr;
|
||||
|
||||
@ -270,7 +270,7 @@ JSThinInlineString::new_(JSContext* cx)
|
||||
if (cx->compartment()->isAtomsCompartment())
|
||||
return (JSThinInlineString*)(js::Allocate<js::NormalAtom, allowGC>(cx));
|
||||
|
||||
return js::Allocate<JSThinInlineString, allowGC>(cx, js::gc::TenuredHeap);
|
||||
return js::Allocate<JSThinInlineString, allowGC>(cx, js::gc::DefaultHeap);
|
||||
}
|
||||
|
||||
template <js::AllowGC allowGC>
|
||||
@ -280,7 +280,7 @@ JSFatInlineString::new_(JSContext* cx)
|
||||
if (cx->compartment()->isAtomsCompartment())
|
||||
return (JSFatInlineString*)(js::Allocate<js::FatInlineAtom, allowGC>(cx));
|
||||
|
||||
return js::Allocate<JSFatInlineString, allowGC>(cx, js::gc::TenuredHeap);
|
||||
return js::Allocate<JSFatInlineString, allowGC>(cx, js::gc::DefaultHeap);
|
||||
}
|
||||
|
||||
template<>
|
||||
|
Loading…
Reference in New Issue
Block a user