tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ion-store-load-from-offset.js (949B)


      1 // |jit-test| --ion-offthread-compile=off;
      2 //
      3 function test(arr, max) {
      4 
      5  // LoadFixedFromOffset
      6  var test = 0;
      7  for (let i=0; i<20; i++) {
      8    test = arr[i%max].a;
      9  }
     10 
     11  // StoreFixedFromOffset
     12  var test = 0;
     13  for (let i=0; i<20; i++) {
     14    arr[i%max].a = i%max;
     15  }
     16 
     17  for (let i=0; i<max; i++) {
     18    assertEq(arr[i].a, i);
     19  }
     20 }
     21 
     22 var arr = [];
     23 arr[0] = {a:0};
     24 arr[1] = {b:0, a:1};
     25 arr[2] = {c:0, a:2};
     26 
     27 // GuardShapeListToOffset (3)
     28 for (let i=0; i<1000; i++) {
     29  test(arr, arr.length);
     30 }
     31 
     32 arr[3] = {d:0, a:3};
     33 
     34 // GuardShapeListToOffset (4)
     35 for (let i=0; i<1000; i++) {
     36  test(arr, arr.length);
     37 }
     38 
     39 arr[4] = {e:0, a:4};
     40 
     41 // GuardMultipleShapesToOffset (5)
     42 for (let i=0; i<1000; i++) {
     43  test(arr, arr.length);
     44 }
     45 
     46 arr[5] = {f:0, a:4};
     47 
     48 // GuardMultipleShapesToOffset (6)
     49 for (let i=0; i<1000; i++) {
     50  test(arr, arr.length);
     51 }
     52 
     53 arr[6] = {g:0, a:4};
     54 
     55 // GuardMultipleShapesToOffset (7)
     56 for (let i=0; i<1000; i++) {
     57  test(arr, arr.length);
     58 }