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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 a[0] = value; | 290 a[0] = value; |
291 return a; | 291 return a; |
292 } | 292 } |
293 | 293 |
294 obj = newarraycase_onearg(5, 3.5); | 294 obj = newarraycase_onearg(5, 3.5); |
295 assertKind(elements_kind.fast_double, obj); | 295 assertKind(elements_kind.fast_double, obj); |
296 obj = newarraycase_onearg(10, 5); | 296 obj = newarraycase_onearg(10, 5); |
297 assertKind(elements_kind.fast_double, obj); | 297 assertKind(elements_kind.fast_double, obj); |
298 obj = newarraycase_onearg(0, 5); | 298 obj = newarraycase_onearg(0, 5); |
299 assertKind(elements_kind.fast_double, obj); | 299 assertKind(elements_kind.fast_double, obj); |
| 300 // Now pass a length that forces the dictionary path. |
| 301 obj = newarraycase_onearg(100000, 5); |
| 302 assertKind(elements_kind.dictionary, obj); |
| 303 assertTrue(obj.length == 100000); |
300 | 304 |
301 // Verify that cross context calls work | 305 // Verify that cross context calls work |
302 var realmA = Realm.current(); | 306 var realmA = Realm.current(); |
303 var realmB = Realm.create(); | 307 var realmB = Realm.create(); |
304 assertEquals(0, realmA); | 308 assertEquals(0, realmA); |
305 assertEquals(1, realmB); | 309 assertEquals(1, realmB); |
306 | 310 |
307 function instanceof_check(type) { | 311 function instanceof_check(type) { |
308 assertTrue(new type() instanceof type); | 312 assertTrue(new type() instanceof type); |
309 assertTrue(new type(5) instanceof type); | 313 assertTrue(new type(5) instanceof type); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 assertKind(elements_kind.fast_smi_only, obj[1][0]); | 464 assertKind(elements_kind.fast_smi_only, obj[1][0]); |
461 obj[0][0] = 3.5; | 465 obj[0][0] = 3.5; |
462 obj[1][0][0] = "goodbye"; | 466 obj[1][0][0] = "goodbye"; |
463 assertKind(elements_kind.fast_double, obj[0]); | 467 assertKind(elements_kind.fast_double, obj[0]); |
464 assertKind(elements_kind.fast, obj[1][0]); | 468 assertKind(elements_kind.fast, obj[1][0]); |
465 | 469 |
466 obj = get_deep_nested_literal(); | 470 obj = get_deep_nested_literal(); |
467 assertKind(elements_kind.fast_double, obj[0]); | 471 assertKind(elements_kind.fast_double, obj[0]); |
468 assertKind(elements_kind.fast, obj[1][0]); | 472 assertKind(elements_kind.fast, obj[1][0]); |
469 })(); | 473 })(); |
OLD | NEW |