Sat, 03 Jan 2015 20:18:00 +0100
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 // |jit-test| slow
3 var nlocals = 50;
4 var localstr = "";
5 for (var i = 0; i < nlocals; ++i)
6 localstr += "var x" + i + "; ";
8 /*
9 * Attempt to test, in a stack-parameter-independent manner, ComileFunction
10 * hitting a stack-commit boundary (which is not an OOM, but requires checking
11 * and updating the stack limit).
12 */
13 var arr = [function() {return 0}, function() {return 1}, function() {return 2}];
14 var arg = "x";
15 var body = localstr +
16 "if (x == 0) return; " +
17 "arr[3] = (new Function(arg, body));" +
18 "for (var i = 0; i < 4; ++i) arr[i](x-1);";
20 // XXX interpreter bailouts during recursion below can cause us to hit the limit quickly.
21 try { (new Function(arg, body))(1000); } catch (e) {}
23 /*
24 * Also check for OOM in CompileFunction. To avoid taking 5 seconds, use a
25 * monster apply to chew up most the stack.
26 */
27 var gotIn = false;
28 var threwOut = false;
29 try {
30 (function() {
31 gotIn = true;
32 (new Function(arg, body))(10000000);
33 }).apply(null, new Array(getMaxArgs()));
34 } catch(e) {
35 assertEq(""+e, "InternalError: too much recursion");
36 threwOut = true;
37 }
38 assertEq(threwOut, true);
39 /* If tweaking some stack parameter makes this fail, shrink monster apply. */
40 assertEq(gotIn, true);