OLD | NEW |
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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 assertKind(elements_kind.fast_smi_only, obj[1][0]); | 467 assertKind(elements_kind.fast_smi_only, obj[1][0]); |
468 obj[0][0] = 3.5; | 468 obj[0][0] = 3.5; |
469 obj[1][0][0] = "goodbye"; | 469 obj[1][0][0] = "goodbye"; |
470 assertKind(elements_kind.fast_double, obj[0]); | 470 assertKind(elements_kind.fast_double, obj[0]); |
471 assertKind(elements_kind.fast, obj[1][0]); | 471 assertKind(elements_kind.fast, obj[1][0]); |
472 | 472 |
473 obj = get_deep_nested_literal(); | 473 obj = get_deep_nested_literal(); |
474 assertKind(elements_kind.fast_double, obj[0]); | 474 assertKind(elements_kind.fast_double, obj[0]); |
475 assertKind(elements_kind.fast, obj[1][0]); | 475 assertKind(elements_kind.fast, obj[1][0]); |
476 })(); | 476 })(); |
| 477 |
| 478 // Test gathering allocation site feedback for generic ics. |
| 479 (function() { |
| 480 function make() { return new Array(); } |
| 481 function foo(a, i) { a[0] = i; } |
| 482 |
| 483 var a = make(); |
| 484 assertKind(elements_kind.fast_smi_only, a); |
| 485 |
| 486 // Make the keyed store ic go generic. |
| 487 foo("howdy", 1); |
| 488 foo(a, 3.5); |
| 489 |
| 490 var b = make(); |
| 491 assertKind(elements_kind.fast_double, b); |
| 492 })(); |
OLD | NEW |