Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: test/mjsunit/regress/regress-crbug-351787.js

Issue 197793003: Use intrinsics for builtin ArrayBuffer property accesses (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/typedarray.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Flags: --allow-natives-syntax
6
7 var ab1 = new ArrayBuffer(8);
8 ab1.__defineGetter__("byteLength", function() { return 1000000; });
9 var ab2 = ab1.slice(800000, 900000);
10 var array = new Uint8Array(ab2);
11 for (var i = 0; i < array.length; i++) {
12 assertEquals(0, array[i]);
13 }
14 assertEquals(0, array.length);
15
16
17 var ab3 = new ArrayBuffer(8);
18 ab3.__defineGetter__("byteLength", function() { return 0xFFFFFFFC; });
19 var aaa = new DataView(ab3);
20
21 for (var i = 10; i < aaa.length; i++) {
22 aaa.setInt8(i, 0xcc);
23 }
24 assertEquals(8, aaa.byteLength);
25
26
27 var a = new Int8Array(4);
28 a.__defineGetter__("length", function() { return 0xFFFF; });
29 var b = new Int8Array(a);
30 for (var i = 0; i < b.length; i++) {
31 assertEquals(0, b[i]);
32 }
33
34
35 var ab4 = new ArrayBuffer(8);
36 ab4.__defineGetter__("byteLength", function() { return 0xFFFFFFFC; });
37 var aaaa = new Uint32Array(ab4);
38
39 for (var i = 10; i < aaaa.length; i++) {
40 aaaa[i] = 0xcccccccc;
41 }
42 assertEquals(2, aaaa.length);
OLDNEW
« no previous file with comments | « src/typedarray.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698