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

Side by Side Diff: test/mjsunit/fast-prototype.js

Issue 1474763007: [turbofan] Test has been outsmarted by optimization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 obj["x" + i] = 0; 43 obj["x" + i] = 0;
44 } 44 }
45 } 45 }
46 46
47 47
48 function DoProtoMagic(proto, set__proto__) { 48 function DoProtoMagic(proto, set__proto__) {
49 if (set__proto__) { 49 if (set__proto__) {
50 (new Sub()).__proto__ = proto; 50 (new Sub()).__proto__ = proto;
51 } else { 51 } else {
52 Sub.prototype = proto; 52 Sub.prototype = proto;
53 // Need to instantiate Sub to mark .prototype as prototype. 53 // Need to instantiate Sub to mark .prototype as prototype. Make sure the
54 new Sub(); 54 // instantiated object is used so that the allocation is not optimized away.
55 %DebugPrint(new Sub());
55 } 56 }
56 } 57 }
57 58
58 59
59 function test(use_new, add_first, set__proto__) { 60 function test(use_new, add_first, set__proto__) {
60 var proto = use_new ? new Super() : {}; 61 var proto = use_new ? new Super() : {};
61 62
62 // New object is fast. 63 // New object is fast.
63 assertTrue(%HasFastProperties(proto)); 64 assertTrue(%HasFastProperties(proto));
64 65
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 assertTrue(key == 'a'); 105 assertTrue(key == 'a');
105 break; 106 break;
106 } 107 }
107 assertTrue(%HasFastProperties(x)); 108 assertTrue(%HasFastProperties(x));
108 x.d = 4; 109 x.d = 4;
109 assertTrue(%HasFastProperties(x)); 110 assertTrue(%HasFastProperties(x));
110 for (key in x) { 111 for (key in x) {
111 assertTrue(key == 'a'); 112 assertTrue(key == 'a');
112 break; 113 break;
113 } 114 }
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698