| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 assertEquals(value_6, a[computed_6()]); // Test non-constant key | 108 assertEquals(value_6, a[computed_6()]); // Test non-constant key |
| 109 assertEquals(value_7, a[7]); | 109 assertEquals(value_7, a[7]); |
| 110 assertEquals(large_array_size, a.length); | 110 assertEquals(large_array_size, a.length); |
| 111 assertTrue(%HasFastDoubleElements(a)); | 111 assertTrue(%HasFastDoubleElements(a)); |
| 112 } | 112 } |
| 113 | 113 |
| 114 function test_various_loads5(a, value_5, value_6, value_7) { | 114 function test_various_loads5(a, value_5, value_6, value_7) { |
| 115 assertTrue(%HasFastDoubleElements(a)); | 115 assertTrue(%HasFastDoubleElements(a)); |
| 116 if (value_5 != undefined) { | 116 if (value_5 != undefined) { |
| 117 assertEquals(value_5, a[5]); | 117 assertEquals(value_5, a[5]); |
| 118 }; | 118 } |
| 119 if (value_6 != undefined) { | 119 if (value_6 != undefined) { |
| 120 assertEquals(value_6, a[6]); | 120 assertEquals(value_6, a[6]); |
| 121 assertEquals(value_6, a[computed_6()]); // Test non-constant key | 121 assertEquals(value_6, a[computed_6()]); // Test non-constant key |
| 122 } | 122 } |
| 123 assertEquals(value_7, a[7]); | 123 assertEquals(value_7, a[7]); |
| 124 assertEquals(large_array_size, a.length); | 124 assertEquals(large_array_size, a.length); |
| 125 assertTrue(%HasFastDoubleElements(a)); | 125 assertTrue(%HasFastDoubleElements(a)); |
| 126 } | 126 } |
| 127 | 127 |
| 128 function test_various_loads6(a, value_5, value_6, value_7) { | 128 function test_various_loads6(a, value_5, value_6, value_7) { |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 test_for_in(); | 482 test_for_in(); |
| 483 test_for_in(); | 483 test_for_in(); |
| 484 %OptimizeFunctionOnNextCall(test_for_in); | 484 %OptimizeFunctionOnNextCall(test_for_in); |
| 485 test_for_in(); | 485 test_for_in(); |
| 486 test_for_in(); | 486 test_for_in(); |
| 487 test_for_in(); | 487 test_for_in(); |
| 488 | 488 |
| 489 function test_get_property_names() { | 489 function test_get_property_names() { |
| 490 names = %GetPropertyNames(large_array3); | 490 names = %GetPropertyNames(large_array3); |
| 491 property_name_count = 0; | 491 property_name_count = 0; |
| 492 for (x in names) { property_name_count++; }; | 492 for (x in names) { property_name_count++; } |
| 493 assertEquals(26, property_name_count); | 493 assertEquals(26, property_name_count); |
| 494 } | 494 } |
| 495 | 495 |
| 496 test_get_property_names(); | 496 test_get_property_names(); |
| 497 test_get_property_names(); | 497 test_get_property_names(); |
| 498 test_get_property_names(); | 498 test_get_property_names(); |
| 499 | 499 |
| 500 // Test elements getters. | 500 // Test elements getters. |
| 501 assertEquals(expected_array_value(10), large_array3[10]); | 501 assertEquals(expected_array_value(10), large_array3[10]); |
| 502 assertEquals(expected_array_value(-NaN), large_array3[2]); | 502 assertEquals(expected_array_value(-NaN), large_array3[2]); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 assertEquals(expected_array_value(2), large_array4[2]); | 537 assertEquals(expected_array_value(2), large_array4[2]); |
| 538 } | 538 } |
| 539 | 539 |
| 540 test_setter(); | 540 test_setter(); |
| 541 test_setter(); | 541 test_setter(); |
| 542 test_setter(); | 542 test_setter(); |
| 543 %OptimizeFunctionOnNextCall(test_setter); | 543 %OptimizeFunctionOnNextCall(test_setter); |
| 544 test_setter(); | 544 test_setter(); |
| 545 test_setter(); | 545 test_setter(); |
| 546 test_setter(); | 546 test_setter(); |
| OLD | NEW |