js/src/jit-test/tests/parallel/ic-setproperty.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 load(libdir + "parallelarray-helpers.js");
michael@0 2
michael@0 3 function set(o, v) {
michael@0 4 // Padding to prevent inlining.
michael@0 5 var foo = 0;
michael@0 6 var foo = 0;
michael@0 7 var foo = 0;
michael@0 8 var foo = 0;
michael@0 9 var foo = 0;
michael@0 10 var foo = 0;
michael@0 11 var foo = 0;
michael@0 12 var foo = 0;
michael@0 13 var foo = 0;
michael@0 14 var foo = 0;
michael@0 15 var foo = 0;
michael@0 16 var foo = 0;
michael@0 17 var foo = 0;
michael@0 18 var foo = 0;
michael@0 19 var foo = 0;
michael@0 20 var foo = 0;
michael@0 21 var foo = 0;
michael@0 22 var foo = 0;
michael@0 23 var foo = 0;
michael@0 24 var foo = 0;
michael@0 25 var foo = 0;
michael@0 26 var foo = 0;
michael@0 27 var foo = 0;
michael@0 28 var foo = 0;
michael@0 29 var foo = 0;
michael@0 30 var foo = 0;
michael@0 31 var foo = 0;
michael@0 32 var foo = 0;
michael@0 33 var foo = 0;
michael@0 34 var foo = 0;
michael@0 35 var foo = 0;
michael@0 36 var foo = 0;
michael@0 37 var foo = 0;
michael@0 38 var foo = 0;
michael@0 39 o.foo = v;
michael@0 40 var foo = 0;
michael@0 41 var foo = 0;
michael@0 42 var foo = 0;
michael@0 43 var foo = 0;
michael@0 44 var foo = 0;
michael@0 45 var foo = 0;
michael@0 46 var foo = 0;
michael@0 47 var foo = 0;
michael@0 48 var foo = 0;
michael@0 49 var foo = 0;
michael@0 50 var foo = 0;
michael@0 51 var foo = 0;
michael@0 52 var foo = 0;
michael@0 53 var foo = 0;
michael@0 54 var foo = 0;
michael@0 55 var foo = 0;
michael@0 56 var foo = 0;
michael@0 57 var foo = 0;
michael@0 58 var foo = 0;
michael@0 59 var foo = 0;
michael@0 60 var foo = 0;
michael@0 61 var foo = 0;
michael@0 62 var foo = 0;
michael@0 63 var foo = 0;
michael@0 64 var foo = 0;
michael@0 65 var foo = 0;
michael@0 66 var foo = 0;
michael@0 67 var foo = 0;
michael@0 68 var foo = 0;
michael@0 69 var foo = 0;
michael@0 70 var foo = 0;
michael@0 71 }
michael@0 72 set({ foo: 0 }, 42);
michael@0 73
michael@0 74 function testSetPropertySlot() {
michael@0 75 assertArraySeqParResultsEq(
michael@0 76 range(0, minItemsTestingThreshold),
michael@0 77 "map",
michael@0 78 function (i) {
michael@0 79 var o1 = {};
michael@0 80 var o2 = {};
michael@0 81 var o3 = {};
michael@0 82 var o4 = {};
michael@0 83 // Defines .foo
michael@0 84 set(o1, i + 1);
michael@0 85 set(o2, i + 2);
michael@0 86 set(o3, i + 3);
michael@0 87 set(o4, i + 4);
michael@0 88 // Sets .foo
michael@0 89 set(o1, i + 5);
michael@0 90 set(o2, i + 6);
michael@0 91 set(o3, i + 7);
michael@0 92 set(o4, i + 8);
michael@0 93 return o1.foo + o2.foo + o3.foo + o4.foo;
michael@0 94 });
michael@0 95 }
michael@0 96
michael@0 97 function testSetArrayLength() {
michael@0 98 assertArraySeqParResultsEq(
michael@0 99 range(0, minItemsTestingThreshold),
michael@0 100 "map",
michael@0 101 function (i) {
michael@0 102 var a = [];
michael@0 103 a.length = i;
michael@0 104 return a.length;
michael@0 105 });
michael@0 106 }
michael@0 107
michael@0 108 if (getBuildConfiguration().parallelJS) {
michael@0 109 testSetPropertySlot();
michael@0 110 testSetArrayLength();
michael@0 111 }

mercurial