Bug 1167883 - Avoid huge stack frames and stack overflow issues with MSVC PGO builds. r=nbp

This commit is contained in:
Jan de Mooij 2015-07-09 11:12:04 +02:00
Родитель 7066396ea2
Коммит 0a1f1ddc9c
1 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

@ -614,6 +614,12 @@ struct AutoStopwatch final
}
// MSVC with PGO inlines a lot of functions in RunScript, resulting in large
// stack frames and stack overflow issues, see bug 1167883. Turn off PGO to
// avoid this.
#ifdef _MSC_VER
# pragma optimize("g", off)
#endif
bool
js::RunScript(JSContext* cx, RunState& state)
{
@ -654,6 +660,9 @@ js::RunScript(JSContext* cx, RunState& state)
return Interpret(cx, state);
}
#ifdef _MSC_VER
# pragma optimize("", on)
#endif
struct AutoGCIfRequested
{
@ -719,10 +728,8 @@ js::Invoke(JSContext* cx, CallArgs args, MaybeConstruct construct)
// Check to see if createSingleton flag should be set for this frame.
if (construct) {
FrameIter iter(cx);
if (!iter.done() && iter.hasScript()) {
JSScript* script = iter.script();
jsbytecode* pc = iter.pc();
jsbytecode* pc;
if (JSScript* script = cx->currentScript(&pc)) {
if (ObjectGroup::useSingletonForNewObject(cx, script, pc))
state.setCreateSingleton();
}