Bug 1290931: Don't use the exponential operator in tests; r=till, a=RyanVM
authorBenjamin Bouvier <benj@benj.me>
Mon, 01 Aug 2016 18:48:20 +0200
changeset 347545 cace1687008bb7f514b76017f62895c23ec18c2c
parent 347544 70ee99f185b48cb59a4ec701282bf6a3fd6ce3e3
child 347546 cbe2a1eca2a8c2b6ef28f20055569b5fcc842be1
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstill, RyanVM
bugs1290931
milestone50.0a2
Bug 1290931: Don't use the exponential operator in tests; r=till, a=RyanVM MozReview-Commit-ID: HTUmcNj7SEZ
js/src/jit-test/tests/wasm/basic-bce.js
js/src/jit-test/tests/wasm/binary.js
--- a/js/src/jit-test/tests/wasm/basic-bce.js
+++ b/js/src/jit-test/tests/wasm/basic-bce.js
@@ -24,18 +24,18 @@ let baseOp = {
   '16_s': 'i32',
   '16_u':   'i32',
   '': 'i32',
   'f32':  'f32',
   'f64':  'f64',
 }
 
 function toSigned(width, num) {
-  let unsignedMax = 2 ** (accessWidth[width] * 8) - 1;
-  let signedMax = 2 ** (accessWidth[width] * 8 - 1) - 1;
+  let unsignedMax = Math.pow(2, accessWidth[width] * 8) - 1;
+  let signedMax = Math.pow(2, accessWidth[width] * 8 - 1) - 1;
 
   return (num <= signedMax ? num : -(unsignedMax + 1 - num));
 }
 
 function fromLittleEndianNum(width, bytes) {
   let base = 1;
   var res = 0;
   for (var i = 0; i < accessWidth[width]; i++) {
--- a/js/src/jit-test/tests/wasm/binary.js
+++ b/js/src/jit-test/tests/wasm/binary.js
@@ -252,17 +252,17 @@ wasmEval(moduleWithSections([sigSection(
 var manyBlocks = [];
 for (var i = 0; i < 20000; i++)
     manyBlocks.push(Block, End);
 wasmEval(moduleWithSections([sigSection([v2vSig]), declSection([0]), bodySection([funcBody({locals:[], body:manyBlocks})])]));
 
 // Ignore errors in name section.
 var tooBigNameSection = {
     name: nameId,
-    body: [...varU32(2**31)] // declare 2**31 functions.
+    body: [...varU32(Math.pow(2, 31))] // declare 2**31 functions.
 };
 wasmEval(moduleWithSections([tooBigNameSection]));
 
 // Checking stack trace.
 function runStackTraceTest(namesContent, expectedName) {
     var sections = [
         sigSection([v2vSig]),
         importSection([{sigIndex:0, module:"env", func:"callback"}]),