Bug 674843 - Censor pushed-but-not-active InvokeSessionGuard frames from the debugger's view (r=waldo)

--HG--
extra : rebase_source : 1003735f0bce7b0de41c794702e0840cc6452edf
This commit is contained in:
Luke Wagner 2011-08-02 09:21:51 -07:00
Родитель bedee819a3
Коммит 5aebc4671c
3 изменённых файлов: 12 добавлений и 8 удалений

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

@ -1,11 +1,6 @@
// |jit-test| debug;mjit
/*
* NOTE: this evalInFrame is explicitly exposing an optimization artifact that
* InvokeSessionGuard leaves the callee frame on the stack between invocations.
* If this ever gets fixed or InvokeSessionGuard gets removed, this test will
* fail and it can be removed.
*/
o = { toString:function() { return evalInFrame(1, "arguments; x") } }
o = { toString:function() { return evalInFrame(1, "x") } }
var x = 'C';
var s = "aaaaaaaaaa".replace(/a/g, function() { var x = 'B'; return o });
assertEq(s, "BBBBBBBBBB");
assertEq(s, "CCCCCCCCCC");

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

@ -709,6 +709,9 @@ InvokeSessionGuard::start(JSContext *cx, const Value &calleev, const Value &this
savedCallee_ = args_.calleev() = calleev;
savedThis_ = args_.thisv() = thisv;
/* If anyone (through jsdbgapi) finds this frame, make it safe. */
MakeRangeGCSafe(args_.argv(), args_.argc());
do {
/* Hoist dynamic checks from scripted Invoke. */
if (!calleev.isObject())

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

@ -963,6 +963,12 @@ StackIter::settleOnNewState()
continue;
}
/* Censor pushed-but-not-active frames from InvokeSessionGuard. */
if (containsCall && !calls_->active() && calls_->argv() == fp_->actualArgs()) {
popFrame();
continue;
}
/*
* As an optimization, there is no CallArgsList element pushed for
* natives called directly by a script (compiled or interpreted).