зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1167883 - Avoid huge stack frames and stack overflow issues with MSVC PGO builds. r=nbp
This commit is contained in:
Родитель
7066396ea2
Коммит
0a1f1ddc9c
|
@ -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();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче