| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 // Test the correct behavior of the |length| property (which is read-only). | 187 // Test the correct behavior of the |length| property (which is read-only). |
| 188 if (t != 0) { | 188 if (t != 0) { |
| 189 assertEquals(kElementCount, a.length); | 189 assertEquals(kElementCount, a.length); |
| 190 a.length = 2; | 190 a.length = 2; |
| 191 assertEquals(kElementCount, a.length); | 191 assertEquals(kElementCount, a.length); |
| 192 assertTrue(delete a.length); | 192 assertTrue(delete a.length); |
| 193 a.length = 2; | 193 a.length = 2; |
| 194 assertEquals(2, a.length); | 194 assertEquals(2, a.length); |
| 195 } | 195 } |
| 196 |
| 197 function array_load_set_smi_check(a) { |
| 198 return a[0] = a[0] = 1; |
| 199 } |
| 200 |
| 201 array_load_set_smi_check(a); |
| 202 array_load_set_smi_check(0); |
| 203 |
| 204 function array_load_set_smi_check2(a) { |
| 205 return a[0] = a[0] = 1; |
| 206 } |
| 207 |
| 208 array_load_set_smi_check2(a); |
| 209 %OptimizeFunctionOnNextCall(array_load_set_smi_check2); |
| 210 array_load_set_smi_check2(a); |
| 211 array_load_set_smi_check2(0); |
| 212 %DeoptimizeFunction(array_load_set_smi_check2); |
| 213 gc(); // Makes V8 forget about type information for array_load_set_smi_check. |
| 196 } | 214 } |
| OLD | NEW |