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/track-fields.js

Issue 14966005: Fix polymorphic to monomorphic load to take representation into account. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 7 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/property-details.h ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 assertTrue(%HaveSameMap(o6, o7)); 92 assertTrue(%HaveSameMap(o6, o7));
93 // Smi, double, smi. 93 // Smi, double, smi.
94 o6.b = 1.5; 94 o6.b = 1.5;
95 assertFalse(%HaveSameMap(o6, o7)); 95 assertFalse(%HaveSameMap(o6, o7));
96 // Smi, double, object. 96 // Smi, double, object.
97 o7.c = {}; 97 o7.c = {};
98 assertFalse(%HaveSameMap(o6, o7)); 98 assertFalse(%HaveSameMap(o6, o7));
99 // Smi, double, object. 99 // Smi, double, object.
100 o6.c = {}; 100 o6.c = {};
101 assertTrue(%HaveSameMap(o6, o7)); 101 assertTrue(%HaveSameMap(o6, o7));
102
103 function poly_load(o, b) {
104 var v = o.field;
105 if (b) {
106 return v + 10;
107 }
108 return o;
109 }
110
111 var of1 = {a:0};
112 of1.field = {};
113 var of2 = {b:0};
114 of2.field = 10;
115
116 poly_load(of1, false);
117 poly_load(of1, false);
118 poly_load(of2, true);
119 %OptimizeFunctionOnNextCall(poly_load);
120 assertEquals("[object Object]10", poly_load(of1, true));
OLDNEW
« no previous file with comments | « src/property-details.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698