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

Side by Side Diff: test/mjsunit/track-fields.js

Issue 2598543003: [runtime][ic] Constant field tracking support. (Closed)
Patch Set: Addressing comments Created 3 years, 10 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/smi-representation.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 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 assertEquals(1, smi20); 256 assertEquals(1, smi20);
257 assertEquals(1.5, dbl20); 257 assertEquals(1.5, dbl20);
258 assertEquals(some_object20, obj20); 258 assertEquals(some_object20, obj20);
259 259
260 assertEquals(100, o20.smi); 260 assertEquals(100, o20.smi);
261 assertEquals(100, o20.dbl); 261 assertEquals(100, o20.dbl);
262 assertEquals(100, o20.dbl); 262 assertEquals(100, o20.dbl);
263 263
264 function attr_mismatch_obj(v, writable) { 264 function attr_mismatch_obj(v, writable) {
265 var o = {}; 265 var o = {};
266 // Assign twice to make the field non-constant.
267 // TODO(ishell): update test once constant field tracking is done.
268 o.some_value = 0;
266 o.some_value = v; 269 o.some_value = v;
267 Object.defineProperty(o, "second_value", {value:10, writable:writable}); 270 Object.defineProperty(o, "second_value", {value:10, writable:writable});
268 return o; 271 return o;
269 } 272 }
270 273
271 function is_writable(o, p) { 274 function is_writable(o, p) {
272 return Object.getOwnPropertyDescriptor(o,p).writable; 275 return Object.getOwnPropertyDescriptor(o,p).writable;
273 } 276 }
274 277
275 var writable = attr_mismatch_obj(10, true); 278 var writable = attr_mismatch_obj(10, true);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 var o = {"s_to_t":18}; 400 var o = {"s_to_t":18};
398 o.s_to_t = a; 401 o.s_to_t = a;
399 return o; 402 return o;
400 } 403 }
401 404
402 var st1 = smi_to_object(true); 405 var st1 = smi_to_object(true);
403 var st2 = smi_to_object(false); 406 var st2 = smi_to_object(false);
404 assertTrue(%HaveSameMap(st1, st2)); 407 assertTrue(%HaveSameMap(st1, st2));
405 assertEquals(true, st1.s_to_t); 408 assertEquals(true, st1.s_to_t);
406 assertEquals(false, st2.s_to_t); 409 assertEquals(false, st2.s_to_t);
OLDNEW
« no previous file with comments | « test/mjsunit/smi-representation.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698