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

Side by Side Diff: test/mjsunit/regress/regress-put-prototype-transition.js

Issue 1033653002: Move prototype metadata from internal properties to prototype maps (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: small fixes 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/fast-prototype.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 2014 the V8 project authors. All rights reserved. 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 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 --expose-gc --stress-compaction --gc-interval=2 55 5 // Flags: --allow-natives-syntax --expose-gc --stress-compaction --gc-interval=2 55
6 6
7 function deepEquals(a, b) { if (a === b) { if (a === 0) return (1 / a) === (1 / b); return true; } if (typeof a != typeof b) return false; if (typeof a == "numb er") return isNaN(a) && isNaN(b); if (typeof a !== "object" && typeof a !== "fun ction") return false; var objectClass = classOf(a); if (objectClass !== classOf( b)) return false; if (objectClass === "RegExp") { return (a.toString() === b.toS tring()); } if (objectClass === "Function") return false; if (objectClass === "A rray") { var elementCount = 0; if (a.length != b.length) { return false; } for ( var i = 0; i < a.length; i++) { if (!deepEquals(a[i], b[i])) return false; } ret urn true; } if (objectClass == "String" || objectClass == "Number" || objectClas s == "Boolean" || objectClass == "Date") { if (a.valueOf() !== b.valueOf()) retu rn false; } return deepObjectEquals(a, b); } 7 function deepEquals(a, b) { if (a === b) { if (a === 0) return (1 / a) === (1 / b); return true; } if (typeof a != typeof b) return false; if (typeof a == "numb er") return isNaN(a) && isNaN(b); if (typeof a !== "object" && typeof a !== "fun ction") return false; var objectClass = classOf(a); if (objectClass !== classOf( b)) return false; if (objectClass === "RegExp") { return (a.toString() === b.toS tring()); } if (objectClass === "Function") return false; if (objectClass === "A rray") { var elementCount = 0; if (a.length != b.length) { return false; } for ( var i = 0; i < a.length; i++) { if (!deepEquals(a[i], b[i])) return false; } ret urn true; } if (objectClass == "String" || objectClass == "Number" || objectClas s == "Boolean" || objectClass == "Date") { if (a.valueOf() !== b.valueOf()) retu rn false; } return deepObjectEquals(a, b); }
8 assertSame = function assertSame(expected, found, name_opt) { if (found === expe cted) { if (expected !== 0 || (1 / expected) == (1 / found)) return; } else if ( (expected !== expected) && (found !== found)) { return; } fail(PrettyPrint(expec ted), found, name_opt); }; assertEquals = function assertEquals(expected, found, name_opt) { if (!deepEquals(found, expected)) { fail(PrettyPrint(expected), fou nd, name_opt); } }; 8 assertSame = function assertSame(expected, found, name_opt) { if (found === expe cted) { if (expected !== 0 || (1 / expected) == (1 / found)) return; } else if ( (expected !== expected) && (found !== found)) { return; } fail(PrettyPrint(expec ted), found, name_opt); }; assertEquals = function assertEquals(expected, found, name_opt) { if (!deepEquals(found, expected)) { fail(PrettyPrint(expected), fou nd, name_opt); } };
9 assertEqualsDelta = function assertEqualsDelta(expected, found, delta, name_opt) { assertTrue(Math.abs(expected - found) <= delta, name_opt); }; assertArrayEqua ls = function assertArrayEquals(expected, found, name_opt) { var start = ""; if (name_opt) { start = name_opt + " - "; } assertEquals(expected.length, found.len gth, start + "array length"); if (expected.length == found.length) { for (var i = 0; i < expected.length; ++i) { assertEquals(expected[i], found[i], start + "ar ray element at index " + i); } } }; 9 assertEqualsDelta = function assertEqualsDelta(expected, found, delta, name_opt) { assertTrue(Math.abs(expected - found) <= delta, name_opt); }; assertArrayEqua ls = function assertArrayEquals(expected, found, name_opt) { var start = ""; if (name_opt) { start = name_opt + " - "; } assertEquals(expected.length, found.len gth, start + "array length"); if (expected.length == found.length) { for (var i = 0; i < expected.length; ++i) { assertEquals(expected[i], found[i], start + "ar ray element at index " + i); } } };
10 assertTrue = function assertTrue(value, name_opt) { assertEquals(true, value, na me_opt); }; 10 assertTrue = function assertTrue(value, name_opt) { assertEquals(true, value, na me_opt); };
(...skipping 17 matching lines...) Expand all
28 assertTrue(%HasFastProperties(__v_1)); 28 assertTrue(%HasFastProperties(__v_1));
29 if (add_first) { 29 if (add_first) {
30 __f_4(__v_1); 30 __f_4(__v_1);
31 assertFalse(%HasFastProperties(__v_1)); 31 assertFalse(%HasFastProperties(__v_1));
32 __f_0(__v_1, __v_6); 32 __f_0(__v_1, __v_6);
33 assertTrue(%HasFastProperties(__v_1)); 33 assertTrue(%HasFastProperties(__v_1));
34 } else { 34 } else {
35 __f_0(__v_1, __v_6); 35 __f_0(__v_1, __v_6);
36 assertTrue(%HasFastProperties(__v_1)); 36 assertTrue(%HasFastProperties(__v_1));
37 __f_4(__v_1); 37 __f_4(__v_1);
38 assertFalse(%HasFastProperties(__v_1)); 38 assertTrue(%HasFastProperties(__v_1));
39 } 39 }
40 } 40 }
41 gc(); 41 gc();
42 for (var __v_2 = 0; __v_2 < 4; __v_2++) { 42 for (var __v_2 = 0; __v_2 < 4; __v_2++) {
43 var __v_6 = ((__v_2 & 2) != 7); 43 var __v_6 = ((__v_2 & 2) != 7);
44 var __v_4 = ((__v_2 & 2) != 0); 44 var __v_4 = ((__v_2 & 2) != 0);
45 __f_1(__v_4, true, __v_6); 45 __f_1(__v_4, true, __v_6);
46 var __v_0 = __f_1(__v_4, false, __v_6); 46 var __v_0 = __f_1(__v_4, false, __v_6);
47 __f_1(__v_4, false, __v_6, __v_0); 47 __f_1(__v_4, false, __v_6, __v_0);
48 } 48 }
49 __v_5 = {a: 1, b: 2, c: 3}; 49 __v_5 = {a: 1, b: 2, c: 3};
OLDNEW
« no previous file with comments | « test/mjsunit/fast-prototype.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698