js/src/jit-test/tests/debug/Frame-implementation-01.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 // Debugger.Frames of all implementations.
michael@0 2
michael@0 3 load(libdir + "jitopts.js");
michael@0 4
michael@0 5 function testFrameImpl(jitopts, assertFrameImpl) {
michael@0 6 if (!jitTogglesMatch(jitopts))
michael@0 7 return;
michael@0 8
michael@0 9 withJitOptions(jitopts, function () {
michael@0 10 var g = newGlobal();
michael@0 11 var dbg = new Debugger;
michael@0 12
michael@0 13 g.toggle = function toggle(d) {
michael@0 14 if (d) {
michael@0 15 dbg.addDebuggee(g);
michael@0 16 var frame = dbg.getNewestFrame();
michael@0 17 // We only care about the f and g frames.
michael@0 18 for (var i = 0; i < 2; i++) {
michael@0 19 assertFrameImpl(frame);
michael@0 20 frame = frame.older;
michael@0 21 }
michael@0 22 }
michael@0 23 };
michael@0 24
michael@0 25 g.eval("" + function f(d) { g(d); });
michael@0 26 g.eval("" + function g(d) { toggle(d); });
michael@0 27
michael@0 28 g.eval("(" + function test() {
michael@0 29 for (var i = 0; i < 5; i++)
michael@0 30 f(false);
michael@0 31 f(true);
michael@0 32 } + ")();");
michael@0 33 });
michael@0 34 }
michael@0 35
michael@0 36 [[Opts_BaselineEager,
michael@0 37 function (f) { assertEq(f.implementation, "baseline"); }],
michael@0 38 // Note that the Ion case *depends* on CCW scripted functions being opaque to
michael@0 39 // Ion optimization and not deoptimizing the frames below the call to toggle.
michael@0 40 [Opts_Ion2NoParallelCompilation,
michael@0 41 function (f) { assertEq(f.implementation, "ion"); }],
michael@0 42 [Opts_NoJits,
michael@0 43 function (f) { assertEq(f.implementation, "interpreter"); }]].forEach(function ([opts, fn]) {
michael@0 44 testFrameImpl(opts, fn);
michael@0 45 });

mercurial