Bug 861904. (r=sstangl)
authorShu-yu Guo <shu@rfrn.org>
Wed, 24 Apr 2013 18:41:03 -0700
changeset 129819 c1f983b78f1625fee2d390906ea263bb94ea2f9e
parent 129818 e1255e1e6ad3e0656ba13bd60d3ef518b3794ece
child 129820 722048a0587b6dbef660dd9ae2431f0563aa191a
push id24590
push userryanvm@gmail.com
push dateFri, 26 Apr 2013 01:39:07 +0000
treeherdermozilla-central@7f68735fc8da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssstangl
bugs861904
milestone23.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 861904. (r=sstangl)
js/src/ion/MCallOptimize.cpp
js/src/jit-test/tests/parallelarray/inline-new-bad-type.js
--- a/js/src/ion/MCallOptimize.cpp
+++ b/js/src/ion/MCallOptimize.cpp
@@ -1157,16 +1157,18 @@ IonBuilder::inlineParallelArrayTail(Call
     // constructed type objects, so we can only perform the inlining if we
     // already have one of these type objects.
     types::StackTypeSet *returnTypes = getInlineReturnTypeSet();
     if (returnTypes->getKnownTypeTag() != JSVAL_TYPE_OBJECT)
         return InliningStatus_NotInlined;
     if (returnTypes->unknownObject() || returnTypes->getObjectCount() != 1)
         return InliningStatus_NotInlined;
     types::TypeObject *typeObject = returnTypes->getTypeObject(0);
+    if (typeObject->clasp != &ParallelArrayObject::class_)
+        return InliningStatus_NotInlined;
 
     // Create the call and add in the non-this arguments.
     uint32_t targetArgs = argc;
     if (target && !target->isNative())
         targetArgs = Max<uint32_t>(target->nargs, argc);
 
     MCall *call = MCall::New(target, targetArgs + 1, argc, false);
     if (!call)
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/parallelarray/inline-new-bad-type.js
@@ -0,0 +1,14 @@
+// |jit-test| error: RangeError
+// 
+// Run with --ion-eager.
+function TestCase(n, d, e, a) {};
+function reportCompare() {
+  var testcase = new TestCase("x", 0);
+}
+reportCompare();
+TestCase = ParallelArray;
+gczeal(6);
+try {
+reportCompare();
+} catch(exc1) {}
+reportCompare();