Bug 884989 - OdinMonkey: Check argument types before enabling ffi fastpath to IM. r=luke, a=bajaj
authorHannes Verschore <hv1989@gmail.com>
Tue, 25 Jun 2013 09:55:33 +0200
changeset 147780 40bef1cf558f215cacc8f753f53b5d6cdb32e3a5
parent 147779 049e957f10761e26dfec9afc28ca8988b4910c10
child 147781 29f62a025aae57abc54241fc864060103e1402dc
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke, bajaj
bugs884989
milestone24.0a2
Bug 884989 - OdinMonkey: Check argument types before enabling ffi fastpath to IM. r=luke, a=bajaj
js/src/ion/AsmJS.cpp
--- a/js/src/ion/AsmJS.cpp
+++ b/js/src/ion/AsmJS.cpp
@@ -5272,27 +5272,28 @@ TryEnablingIon(JSContext *cx, AsmJSModul
     // Currently we can't rectify arguments. Therefore disabling if argc is too low.
     if (exitDatum->fun->nargs > argc)
         return true;
 
     // Get the corresponding AsmJsModule
     const AsmJSModule &module =
         cx->mainThread().asmJSActivationStackFromOwnerThread()->module();
 
-#ifdef DEBUG
-    // The types should correspond, since we just run through invoke, before testing this.
-    JS_ASSERT(types::TypeScript::ThisTypes(script)->hasType(types::Type::UndefinedType()));
+    // Normally the types should corresond, since we just ran with those types,
+    // but there are reports this is asserting. Therefore doing it as a check, instead of DEBUG only.
+    if (!types::TypeScript::ThisTypes(script)->hasType(types::Type::UndefinedType()))
+        return true;
     for(uint32_t i = 0; i < exitDatum->fun->nargs; i++) {
         types::StackTypeSet *typeset = types::TypeScript::ArgTypes(script, i);
         types::Type type = types::Type::DoubleType();
         if (!argv[i].isDouble())
             type = types::Type::PrimitiveType(argv[i].extractNonDoubleType());
-        JS_ASSERT(typeset->hasType(type));
-    }
-#endif
+        if (!typeset->hasType(type))
+            return true;
+    }
 
     // Enable
     IonScript *ionScript = script->ionScript();
     unsigned id = module.exitDatumToExitIndex(exitDatum);
     DependentAsmJSModuleExit exit(&module, id);
     if (!ionScript->addDependentAsmJSModule(cx, exit))
         return false;