Chromium Code Reviews| Index: test/mjsunit/regress/regress-610633.js |
| diff --git a/test/mjsunit/lithium/StoreKeyed.js b/test/mjsunit/regress/regress-610633.js |
| similarity index 71% |
| copy from test/mjsunit/lithium/StoreKeyed.js |
| copy to test/mjsunit/regress/regress-610633.js |
| index d34f390d25e3d04f7f3e8202e4076da945f660d9..d5882fd4d023def74de196677a3058843e4788b0 100644 |
| --- a/test/mjsunit/lithium/StoreKeyed.js |
| +++ b/test/mjsunit/regress/regress-610633.js |
| @@ -1,3 +1,4 @@ |
| + |
| // Copyright 2013 the V8 project authors. All rights reserved. |
|
adamk
2016/05/13 20:33:39
We now use a shorter copyright boilerplate (which
gsathya
2016/05/13 21:11:52
Done.
|
| // Redistribution and use in source and binary forms, with or without |
| // modification, are permitted provided that the following conditions are |
| @@ -25,37 +26,45 @@ |
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| -// Flags: --allow-natives-syntax --no-use-osr |
| +function getLength(a) { |
| + return a.length; |
| +} |
| -function foo(a, i, v) { |
| - a[0] = v; |
| - a[i] = v; |
| +function getByteLength(a) { |
| + return a.byteLength; |
| } |
| -function foo_int(a, i, v) { |
| - a[0] = v; |
| - a[i] = v; |
| +function getByteOffset(a) { |
| + return a.byteOffset; |
| } |
| -var A1 = [1.2, 2.3]; |
| -var A2 = [1.2, 2.3]; |
| -var A3 = [1.2, 2.3]; |
| +var a = new Uint8Array([1, 2, 3]); |
| +getLength(a); |
| +getLength(a); |
| + |
| +Object.defineProperty(a.__proto__, 'length', { |
|
adamk
2016/05/13 20:33:39
Formatting is weird here, looks like you have an e
gsathya
2016/05/13 21:11:53
Done.
|
| + value: 42 |
| +}); |
| + |
| +assertEquals(getLength(a), 42); |
|
adamk
2016/05/13 20:33:39
Nit: the ordering for assertEquals is "expected, a
gsathya
2016/05/13 21:11:52
Done.
|
| +assertEquals(a.length, 42); |
| + |
| +getByteLength(a); |
| +getByteLength(a); |
| + |
| +Object.defineProperty(a.__proto__, 'byteLength', { |
| + value: 42 |
| +}); |
| -var A1_int = [12, 23]; |
| -var A2_int = [12, 23]; |
| -var A3_int = [12, 23]; |
| +assertEquals(getByteLength(a), 42); |
| +assertEquals(a.byteLength, 42); |
| -foo(A1, 1, 3.4); |
| -foo(A2, 1, 3.4); |
| -%OptimizeFunctionOnNextCall(foo); |
| -foo(A3, 1, 3.4); |
| +getByteOffset(a); |
| +getByteOffset(a); |
| -foo_int(A1_int, 1, 34); |
| -foo_int(A2_int, 1, 34); |
| -%OptimizeFunctionOnNextCall(foo_int); |
| -foo_int(A3_int, 1, 34); |
| +Object.defineProperty(a.__proto__, 'byteOffset', { |
| + value: 42 |
| +}); |
| -assertEquals(A1[0], A3[0]); |
| -assertEquals(A1[1], A3[1]); |
| -assertEquals(A1_int[0], A3_int[0]); |
| -assertEquals(A1_int[1], A3_int[1]); |
| +assertEquals(getByteOffset(a), 42); |
| +assertEquals(a.byteOffset, 42); |