| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 assertTrue(%HasFastHoleyElements(c)); | 89 assertTrue(%HasFastHoleyElements(c)); |
| 90 assertEquals(1, c[0]); | 90 assertEquals(1, c[0]); |
| 91 assertEquals(3.5, c[1]); | 91 assertEquals(3.5, c[1]); |
| 92 assertEquals(x, c[2]); | 92 assertEquals(x, c[2]); |
| 93 assertEquals(undefined, c[3]); | 93 assertEquals(undefined, c[3]); |
| 94 } | 94 } |
| 95 | 95 |
| 96 function test_with_optimization(f) { | 96 function test_with_optimization(f) { |
| 97 // Run tests in a loop to make sure that inlined Array() constructor runs out | 97 // Run tests in a loop to make sure that inlined Array() constructor runs out |
| 98 // of new space memory and must fall back on runtime impl. | 98 // of new space memory and must fall back on runtime impl. |
| 99 for (i = 0; i < 250000; ++i) f(); | 99 for (i = 0; i < 25000; ++i) f(); |
| 100 %OptimizeFunctionOnNextCall(f); | 100 %OptimizeFunctionOnNextCall(f); |
| 101 for (i = 0; i < 250000; ++i) f(); // Make sure GC happens | 101 for (i = 0; i < 25000; ++i) f(); // Make sure GC happens |
| 102 } | 102 } |
| 103 | 103 |
| 104 if (has_packed_elements) { | 104 if (has_packed_elements) { |
| 105 test_with_optimization(test1); | 105 test_with_optimization(test1); |
| 106 test_with_optimization(test2); | 106 test_with_optimization(test2); |
| 107 test_with_optimization(test3); | 107 test_with_optimization(test3); |
| 108 test_with_optimization(test4); | 108 test_with_optimization(test4); |
| 109 test_with_optimization(test5); | 109 test_with_optimization(test5); |
| 110 test_with_optimization(test6); | 110 test_with_optimization(test6); |
| 111 } | 111 } |
| 112 | 112 |
| OLD | NEW |