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

Side by Side Diff: test/mjsunit/elide-double-hole-check-12.js

Issue 1092043002: Protect the emptiness of Array prototype elements with a PropertyCell. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Try again :p. Created 5 years, 8 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
« no previous file with comments | « test/mjsunit/concurrent-initial-prototype-change.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
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --allow-natives-syntax 5 // Flags: --allow-natives-syntax
6 6
7 function f1(a, i) { 7 function f1(a, i) {
8 return a[i] + 0.5; 8 return a[i] + 0.5;
9 } 9 }
10
11 var other_realm = Realm.create();
10 var arr = [,0.0,2.5]; 12 var arr = [,0.0,2.5];
11 assertEquals(0.5, f1(arr, 1)); 13 assertEquals(0.5, f1(arr, 1));
12 assertEquals(0.5, f1(arr, 1)); 14 assertEquals(0.5, f1(arr, 1));
13 %OptimizeFunctionOnNextCall(f1); 15 %OptimizeFunctionOnNextCall(f1);
14 assertEquals(0.5, f1(arr, 1)); 16 assertEquals(0.5, f1(arr, 1));
15 Array.prototype.unshift(1.5); 17
16 assertEquals(2, f1(arr, 0)); 18 Realm.shared = arr.__proto__;
19
20 // The call syntax is useful to make sure the native context is that of the
21 // other realm.
22 Realm.eval(other_realm, "Array.prototype.push.call(Realm.shared, 1);");
23 assertEquals(1.5, f1(arr, 0));
OLDNEW
« no previous file with comments | « test/mjsunit/concurrent-initial-prototype-change.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698