michael@0: load(libdir + "parallelarray-helpers.js"); michael@0: michael@0: function set(o, v) { michael@0: // Padding to prevent inlining. michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: o.foo = v; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: var foo = 0; michael@0: } michael@0: set({ foo: 0 }, 42); michael@0: michael@0: function testSetPropertySlot() { michael@0: assertArraySeqParResultsEq( michael@0: range(0, minItemsTestingThreshold), michael@0: "map", michael@0: function (i) { michael@0: var o1 = {}; michael@0: var o2 = {}; michael@0: var o3 = {}; michael@0: var o4 = {}; michael@0: // Defines .foo michael@0: set(o1, i + 1); michael@0: set(o2, i + 2); michael@0: set(o3, i + 3); michael@0: set(o4, i + 4); michael@0: // Sets .foo michael@0: set(o1, i + 5); michael@0: set(o2, i + 6); michael@0: set(o3, i + 7); michael@0: set(o4, i + 8); michael@0: return o1.foo + o2.foo + o3.foo + o4.foo; michael@0: }); michael@0: } michael@0: michael@0: function testSetArrayLength() { michael@0: assertArraySeqParResultsEq( michael@0: range(0, minItemsTestingThreshold), michael@0: "map", michael@0: function (i) { michael@0: var a = []; michael@0: a.length = i; michael@0: return a.length; michael@0: }); michael@0: } michael@0: michael@0: if (getBuildConfiguration().parallelJS) { michael@0: testSetPropertySlot(); michael@0: testSetArrayLength(); michael@0: }