Bug 1208259 - Disable ARM64 Ion, fail testPreserveJitCode. r=jandem
authorJakob Olesen <jolesen@mozilla.com>
Fri, 25 Sep 2015 10:26:00 +0200
changeset 298332 1a06e56abe768da542290e18fba5f27f2b2da3ce
parent 298331 dec1cf70443793139371a3c18a3f07b1cec1485a
child 298333 e301a8e150786de9ff460b3dce72f3746b1ed4ff
push id6068
push userkcambridge@mozilla.com
push dateFri, 02 Oct 2015 20:37:20 +0000
reviewersjandem
bugs1208259
milestone44.0a1
Bug 1208259 - Disable ARM64 Ion, fail testPreserveJitCode. r=jandem IonMonkey for ARM64 is not yet implemented, so don't try running it. The test case in testPreserveJitCode is explicitly counting how many functions get Ion-compiled. Mark the test as a known failure for ARM64 when Ion is disabled.
js/src/jit/Ion.h
js/src/jsapi-tests/testPreserveJitCode.cpp
--- a/js/src/jit/Ion.h
+++ b/js/src/jit/Ion.h
@@ -148,17 +148,18 @@ void StopAllOffThreadCompilations(Zone* 
 void StopAllOffThreadCompilations(JSCompartment* comp);
 
 void LazyLink(JSContext* cx, HandleScript calleescript);
 uint8_t* LazyLinkTopActivation(JSContext* cx);
 
 static inline bool
 IsIonEnabled(JSContext* cx)
 {
-#ifdef JS_CODEGEN_NONE
+    // The ARM64 Ion engine is not yet implemented.
+#if defined(JS_CODEGEN_NONE) || defined(JS_CODEGEN_ARM64)
     return false;
 #else
     return cx->runtime()->options().ion() &&
            cx->runtime()->options().baseline() &&
            cx->runtime()->jitSupportsFloatingPoint;
 #endif
 }
 
--- a/js/src/jsapi-tests/testPreserveJitCode.cpp
+++ b/js/src/jsapi-tests/testPreserveJitCode.cpp
@@ -1,12 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+// For js::jit::IsIonEnabled().
+#include "jit/Ion.h"
+
 #include "jsapi-tests/tests.h"
 
 using namespace JS;
 
 static void
 ScriptCallback(JSRuntime* rt, void* data, JSScript* script)
 {
     unsigned& count = *static_cast<unsigned*>(data);
@@ -35,16 +38,25 @@ testPreserveJitCode(bool preserveJitCode
     rt->options().setBaseline(true);
     rt->options().setIon(true);
     rt->setOffthreadIonCompilationEnabled(false);
 
     RootedObject global(cx, createTestGlobal(preserveJitCode));
     CHECK(global);
     JSAutoCompartment ac(cx, global);
 
+#ifdef JS_CODEGEN_ARM64
+    // The ARM64 Ion JIT is not yet enabled, so this test will fail with
+    // countIonScripts(global) == 0. Once Ion is enabled for ARM64, this test
+    // should be passing again, and this code can be deleted.
+    // Bug 1208526 - ARM64: Reenable jsapi-tests/testPreserveJitCode once Ion is enabled
+    if (!js::jit::IsIonEnabled(cx))
+        knownFail = true;
+#endif
+
     CHECK_EQUAL(countIonScripts(global), 0u);
 
     const char* source =
         "var i = 0;\n"
         "var sum = 0;\n"
         "while (i < 10) {\n"
         "    sum += i;\n"
         "    ++i;\n"