| OLD | NEW |
| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 assertFalse(%HasFastHoleyElements(a4)); | 61 assertFalse(%HasFastHoleyElements(a4)); |
| 62 assertEquals(2.5, a4[0]); | 62 assertEquals(2.5, a4[0]); |
| 63 assertEquals(undefined, a4[8]); | 63 assertEquals(undefined, a4[8]); |
| 64 | 64 |
| 65 // Large array should deopt to runtimea | 65 // Large array should deopt to runtimea |
| 66 for (j = 0; j < iteration_count; ++j) { | 66 for (j = 0; j < iteration_count; ++j) { |
| 67 a5 = new Array(); | 67 a5 = new Array(); |
| 68 for (i = 0; i < 0x40000; ++i) { | 68 for (i = 0; i < 0x40000; ++i) { |
| 69 a5[i] = 0; | 69 a5[i] = 0; |
| 70 } | 70 } |
| 71 assertTrue(%HasFastSmiElements(a5)); | 71 assertTrue(%HasFastSmiElements(a5) || %HasFastDoubleElements(a5)); |
| 72 transition1(a5, 0, 2.5); | 72 transition1(a5, 0, 2.5); |
| 73 assertEquals(2.5, a5[0]); | 73 assertEquals(2.5, a5[0]); |
| 74 } | 74 } |
| 75 | 75 |
| 76 // | 76 // |
| 77 // Test HOLEY SMI -> HOLEY DOUBLE | 77 // Test HOLEY SMI -> HOLEY DOUBLE |
| 78 // | 78 // |
| 79 | 79 |
| 80 function transition2(a, i, v) { | 80 function transition2(a, i, v) { |
| 81 a[i] = v; | 81 a[i] = v; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 d5[i] = 0; | 209 d5[i] = 0; |
| 210 } | 210 } |
| 211 assertTrue(%HasFastDoubleElements(d5)); | 211 assertTrue(%HasFastDoubleElements(d5)); |
| 212 assertTrue(%HasFastHoleyElements(d5)); | 212 assertTrue(%HasFastHoleyElements(d5)); |
| 213 transition4(d5, 0, new Array(5)); | 213 transition4(d5, 0, new Array(5)); |
| 214 assertTrue(%HasFastHoleyElements(d5)); | 214 assertTrue(%HasFastHoleyElements(d5)); |
| 215 assertTrue(%HasFastObjectElements(d5)); | 215 assertTrue(%HasFastObjectElements(d5)); |
| 216 assertEquals(5, d5[0].length); | 216 assertEquals(5, d5[0].length); |
| 217 assertEquals(undefined, d5[2]); | 217 assertEquals(undefined, d5[2]); |
| 218 } | 218 } |
| OLD | NEW |