Bug 989414 - Always allocate lambda objects in the nursery; r=jonco
authorTerrence Cole <terrence@mozilla.com>
Mon, 05 May 2014 17:10:29 -0700
changeset 183175 8c234572141a2593807d8ff5960f6c7789305da7
parent 183174 32a8e28507e635790e7fbbb044b10fc96ec02643
child 183227 01c062964d208e9e431bc3b984d4c16d669c4a1b
push id43495
push usertcole@mozilla.com
push dateWed, 14 May 2014 23:24:36 +0000
treeherdermozilla-inbound@8c234572141a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs989414
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 989414 - Always allocate lambda objects in the nursery; r=jonco
js/src/jit-test/tests/basic/testBug756919.js
js/src/jit-test/tests/basic/testBug840012.js
js/src/jit-test/tests/bug793385.js
js/src/tests/lib/jittests.py
js/src/vm/Interpreter.cpp
--- a/js/src/jit-test/tests/basic/testBug756919.js
+++ b/js/src/jit-test/tests/basic/testBug756919.js
@@ -1,9 +1,9 @@
-// |jit-test| allow-oom
+// |jit-test| allow-oom; allow-overrecursed
 
 gcparam("maxBytes", gcparam("gcBytes") + 1024);
 test();
 function test() {
   var upvar = "";
   function f() { upvar += ""; }
   test();
   eval('');
--- a/js/src/jit-test/tests/basic/testBug840012.js
+++ b/js/src/jit-test/tests/basic/testBug840012.js
@@ -1,9 +1,9 @@
-// |jit-test| error:out of memory
+// |jit-test| allow-oom; allow-overrecursed
 
 gcPreserveCode();
 evaluate("gcparam(\"maxBytes\", gcparam(\"gcBytes\") + 4*1024);");
 evaluate("\
 function testDontEnum(F) { \
   function test() {\
     var upvar = \"\";\
     function f() { upvar += \"\"; }\
--- a/js/src/jit-test/tests/bug793385.js
+++ b/js/src/jit-test/tests/bug793385.js
@@ -1,9 +1,10 @@
-// |jit-test| error: out of memory
+// |jit-test| allow-oom; allow-overrecursed
+
 gcparam("maxBytes", gcparam("gcBytes") + 4*1024);
 function f() {
     var upvar = "";
     function g() { upvar += ""; }
     var inner4 = f("get"),
 	x1,x2,x3,x4,x5,x11,x12,x13,x14,x15,x16,x17,x18,
         otherGlobalSameCompartment = newGlobal("same-compartment");
     eval('');
--- a/js/src/tests/lib/jittests.py
+++ b/js/src/tests/lib/jittests.py
@@ -79,26 +79,29 @@ class Test:
         self.relpath_top = os.path.relpath(path, TOP_SRC_DIR)
 
         # Path relative to mozilla/js/src/jit-test/tests/.
         self.relpath_tests = os.path.relpath(path, TEST_DIR)
 
         self.jitflags = []     # jit flags to enable
         self.slow = False      # True means the test is slow-running
         self.allow_oom = False # True means that OOM is not considered a failure
+        self.allow_overrecursed = False # True means that hitting recursion the
+                                        # limits is not considered a failure.
         self.valgrind = False  # True means run under valgrind
         self.tz_pacific = False # True means force Pacific time for the test
         self.expect_error = '' # Errors to expect and consider passing
         self.expect_status = 0 # Exit status to expect from shell
 
     def copy(self):
         t = Test(self.path)
         t.jitflags = self.jitflags[:]
         t.slow = self.slow
         t.allow_oom = self.allow_oom
+        t.allow_overrecursed = self.allow_overrecursed
         t.valgrind = self.valgrind
         t.tz_pacific = self.tz_pacific
         t.expect_error = self.expect_error
         t.expect_status = self.expect_status
         return t
 
     COOKIE = '|jit-test|'
     CacheDir = JS_CACHE_DIR
@@ -133,16 +136,18 @@ class Test:
                             print("warning: couldn't parse thread-count %s" % value)
                     else:
                         print('warning: unrecognized |jit-test| attribute %s' % part)
                 else:
                     if name == 'slow':
                         test.slow = True
                     elif name == 'allow-oom':
                         test.allow_oom = True
+                    elif name == 'allow-overrecursed':
+                        test.allow_overrecursed = True
                     elif name == 'valgrind':
                         test.valgrind = options.valgrind
                     elif name == 'tz-pacific':
                         test.tz_pacific = True
                     elif name == 'debug':
                         test.jitflags.append('--debugjit')
                     elif name == 'ion-eager':
                         test.jitflags.append('--ion-eager')
@@ -377,17 +382,25 @@ def check_output(out, err, rc, timed_out
         # Tests which expect a timeout check for exit code 6.
         # Sometimes 0 is returned on Windows for unknown reasons.
         # See bug 899697.
         if sys.platform in ['win32', 'cygwin'] and rc == 0:
             return True
 
         # Allow a non-zero exit code if we want to allow OOM, but only if we
         # actually got OOM.
-        return test.allow_oom and 'out of memory' in err and 'Assertion failure' not in err
+        if test.allow_oom and 'out of memory' in err and 'Assertion failure' not in err:
+            return True
+
+        # Allow a non-zero exit code if we want to all too-much-recursion and
+        # the test actually over-recursed.
+        if test.allow_overrecursed and 'too much recursion' in err and 'Assertion failure' not in err:
+            return True
+
+        return False
 
     return True
 
 def print_tinderbox(ok, res):
     # Output test failures in a TBPL parsable format, eg:
     # TEST-RESULT | filename.js | Failure description (code N, args "--foobar")
     #
     # Example:
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -3582,17 +3582,17 @@ js::GetScopeNameForTypeOf(JSContext *cx,
     return JSObject::getProperty(cx, obj, obj, name, vp);
 }
 
 JSObject *
 js::Lambda(JSContext *cx, HandleFunction fun, HandleObject parent)
 {
     MOZ_ASSERT(!fun->isArrow());
 
-    RootedObject clone(cx, CloneFunctionObjectIfNotSingleton(cx, fun, parent, TenuredObject));
+    RootedObject clone(cx, CloneFunctionObjectIfNotSingleton(cx, fun, parent));
     if (!clone)
         return nullptr;
 
     MOZ_ASSERT(clone->global() == clone->global());
     return clone;
 }
 
 JSObject *