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.

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

mercurial