diff options
Diffstat (limited to 'deps/v8/test/mjsunit/compiler/array-every.js')
-rw-r--r-- | deps/v8/test/mjsunit/compiler/array-every.js | 50 |
1 files changed, 38 insertions, 12 deletions
diff --git a/deps/v8/test/mjsunit/compiler/array-every.js b/deps/v8/test/mjsunit/compiler/array-every.js index ec925b7937..66230c5e06 100644 --- a/deps/v8/test/mjsunit/compiler/array-every.js +++ b/deps/v8/test/mjsunit/compiler/array-every.js @@ -17,27 +17,53 @@ assertTrue(foo([3, 3, 3], {x:3})); assertFalse(foo([3, 3, 2], {x:3})); + // Packed // Non-extensible array %PrepareFunctionForOptimization(foo); - assertTrue(foo(Object.preventExtensions([3, 3, 3]), {x:3})); - assertFalse(foo(Object.preventExtensions([3, 3, 2]), {x:3})); + assertTrue(foo(Object.preventExtensions(['3', '3', '3']), {x:'3'})); + assertFalse(foo(Object.preventExtensions(['3', '3', '2']), {x:'3'})); %OptimizeFunctionOnNextCall(foo); - assertTrue(foo(Object.preventExtensions([3, 3, 3]), {x:3})); - assertFalse(foo(Object.preventExtensions([3, 3, 2]), {x:3})); + assertTrue(foo(Object.preventExtensions(['3', '3', '3']), {x:'3'})); + assertFalse(foo(Object.preventExtensions(['3', '3', '2']), {x:'3'})); // Sealed array %PrepareFunctionForOptimization(foo); - assertTrue(foo(Object.seal([3, 3, 3]), {x:3})); - assertFalse(foo(Object.seal([3, 3, 2]), {x:3})); + assertTrue(foo(Object.seal(['3', '3', '3']), {x:'3'})); + assertFalse(foo(Object.seal(['3', '3', '2']), {x:'3'})); %OptimizeFunctionOnNextCall(foo); - assertTrue(foo(Object.seal([3, 3, 3]), {x:3})); - assertFalse(foo(Object.seal([3, 3, 2]), {x:3})); + assertTrue(foo(Object.seal(['3', '3', '3']), {x:'3'})); + assertFalse(foo(Object.seal(['3', '3', '2']), {x:'3'})); // Frozen array %PrepareFunctionForOptimization(foo); - assertTrue(foo(Object.freeze([3, 3, 3]), {x:3})); - assertFalse(foo(Object.freeze([3, 3, 2]), {x:3})); + assertTrue(foo(Object.freeze(['3', '3', '3']), {x:'3'})); + assertFalse(foo(Object.freeze(['3', '3', '2']), {x:'3'})); %OptimizeFunctionOnNextCall(foo); - assertTrue(foo(Object.freeze([3, 3, 3]), {x:3})); - assertFalse(foo(Object.freeze([3, 3, 2]), {x:3})); + assertTrue(foo(Object.freeze(['3', '3', '3']), {x:'3'})); + assertFalse(foo(Object.freeze(['3', '3', '2']), {x:'3'})); + + // Holey + // Non-extensible array + %PrepareFunctionForOptimization(foo); + assertTrue(foo(Object.preventExtensions([, '3', '3', '3']), {x:'3'})); + assertFalse(foo(Object.preventExtensions([, '3', '3', '2']), {x:'3'})); + %OptimizeFunctionOnNextCall(foo); + assertTrue(foo(Object.preventExtensions([, '3', '3', '3']), {x:'3'})); + assertFalse(foo(Object.preventExtensions([, '3', '3', '2']), {x:'3'})); + + // Sealed array + %PrepareFunctionForOptimization(foo); + assertTrue(foo(Object.seal([, '3', '3', '3']), {x:'3'})); + assertFalse(foo(Object.seal([, '3', '3', '2']), {x:'3'})); + %OptimizeFunctionOnNextCall(foo); + assertTrue(foo(Object.seal([, '3', '3', '3']), {x:'3'})); + assertFalse(foo(Object.seal([, '3', '3', '2']), {x:'3'})); + + // Frozen array + %PrepareFunctionForOptimization(foo); + assertTrue(foo(Object.freeze([, '3', '3', '3']), {x:'3'})); + assertFalse(foo(Object.freeze([, '3', '3', '2']), {x:'3'})); + %OptimizeFunctionOnNextCall(foo); + assertTrue(foo(Object.freeze([, '3', '3', '3']), {x:'3'})); + assertFalse(foo(Object.freeze([, '3', '3', '2']), {x:'3'})); })(); |