Use abbreviated CodeAlloc selftest on non-desktop platforms.
authorWilliam Maddox <wmaddox@adobe.com>
Thu, 17 Nov 2011 21:33:24 -0800
changeset 6740 2b6f0238be8d63ebfbd2d9d14a7ff06f053cc046
parent 6739 a3af8d83cae513947a380910e92acbad2cfa0f7a
child 6741 c054b5d4ca1811d7a57e1b0dda76d1b79c41bf11
push id4029
push userwmaddox@adobe.com
push dateFri, 18 Nov 2011 05:34:00 +0000
Use abbreviated CodeAlloc selftest on non-desktop platforms. Test was timing out on Android debug builds.
extensions/ST_nanojit_codealloc.st
extensions/SelftestExec.cpp
--- a/extensions/ST_nanojit_codealloc.st
+++ b/extensions/ST_nanojit_codealloc.st
@@ -202,17 +202,23 @@ static uint32_t n_ap = sizeof(ap) / size
 #endif /* VMCFG_NANOJIT */
 
 %%test allocfree
 
 #ifdef VMCFG_NANOJIT
 
 for (uint32_t i = 0; i < n_ap; i++) {
     CodeAllocDriver* driver = mmfx_new(CodeAllocDriver(20, cp, ap[i]));
+#if defined(DEBUG) && !(defined(VMCFG_IA32) || defined(VMCFG_AMD64))
+    // This test is very slow in debug builds, due to the calls to sanity_check().
+    // Run an abbreviated version of the test except on desktop platforms.
+    driver->run(200);
+#else
     driver->run(20000);
+#endif
     mmfx_delete(driver);
  }
 
 #endif /* VMCFG_NANOJIT */
 
 // We pass if we don't crash or assert.
 %%verify true
 
--- a/extensions/SelftestExec.cpp
+++ b/extensions/SelftestExec.cpp
@@ -4078,24 +4078,30 @@ static uint32_t n_ap = sizeof(ap) / size
 #endif /* VMCFG_NANOJIT */
 
 void ST_nanojit_codealloc::test0() {
 
 #ifdef VMCFG_NANOJIT
 
 for (uint32_t i = 0; i < n_ap; i++) {
     CodeAllocDriver* driver = mmfx_new(CodeAllocDriver(20, cp, ap[i]));
+#if defined(DEBUG) && !(defined(VMCFG_IA32) || defined(VMCFG_AMD64))
+    // This test is very slow in debug builds, due to the calls to sanity_check().
+    // Run an abbreviated version of the test except on desktop platforms.
+    driver->run(200);
+#else
     driver->run(20000);
+#endif
     mmfx_delete(driver);
  }
 
 #endif /* VMCFG_NANOJIT */
 
 // We pass if we don't crash or assert.
-// line 217 "ST_nanojit_codealloc.st"
+// line 223 "ST_nanojit_codealloc.st"
 verifyPass(true, "true", __FILE__, __LINE__);
 
 
 }
 void create_nanojit_codealloc(AvmCore* core) { new ST_nanojit_codealloc(core); }
 }
 }
 #endif