| 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 return a; | 314 return a; |
| 315 } | 315 } |
| 316 | 316 |
| 317 obj = newarraycase_onearg(5, 3.5); | 317 obj = newarraycase_onearg(5, 3.5); |
| 318 assertKind(elements_kind.fast_double, obj); | 318 assertKind(elements_kind.fast_double, obj); |
| 319 obj = newarraycase_onearg(10, 5); | 319 obj = newarraycase_onearg(10, 5); |
| 320 assertKind(elements_kind.fast_double, obj); | 320 assertKind(elements_kind.fast_double, obj); |
| 321 obj = newarraycase_onearg(0, 5); | 321 obj = newarraycase_onearg(0, 5); |
| 322 assertKind(elements_kind.fast_double, obj); | 322 assertKind(elements_kind.fast_double, obj); |
| 323 // Now pass a length that forces the dictionary path. | 323 // Now pass a length that forces the dictionary path. |
| 324 obj = newarraycase_onearg(100000, 5); | 324 obj = newarraycase_onearg(100001, 5); |
| 325 assertKind(elements_kind.dictionary, obj); | 325 assertKind(elements_kind.dictionary, obj); |
| 326 assertTrue(obj.length == 100000); | 326 assertTrue(obj.length == 100001); |
| 327 | 327 |
| 328 // Verify that cross context calls work | 328 // Verify that cross context calls work |
| 329 var realmA = Realm.current(); | 329 var realmA = Realm.current(); |
| 330 var realmB = Realm.create(); | 330 var realmB = Realm.create(); |
| 331 assertEquals(0, realmA); | 331 assertEquals(0, realmA); |
| 332 assertEquals(1, realmB); | 332 assertEquals(1, realmB); |
| 333 | 333 |
| 334 function instanceof_check(type) { | 334 function instanceof_check(type) { |
| 335 assertTrue(new type() instanceof type); | 335 assertTrue(new type() instanceof type); |
| 336 assertTrue(new type(5) instanceof type); | 336 assertTrue(new type(5) instanceof type); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 %ClearFunctionTypeFeedback(instanceof_check); | 373 %ClearFunctionTypeFeedback(instanceof_check); |
| 374 instanceof_check(Array); | 374 instanceof_check(Array); |
| 375 instanceof_check(Array); | 375 instanceof_check(Array); |
| 376 %OptimizeFunctionOnNextCall(instanceof_check); | 376 %OptimizeFunctionOnNextCall(instanceof_check); |
| 377 instanceof_check(Array); | 377 instanceof_check(Array); |
| 378 assertOptimized(instanceof_check); | 378 assertOptimized(instanceof_check); |
| 379 | 379 |
| 380 instanceof_check(realmBArray); | 380 instanceof_check(realmBArray); |
| 381 assertUnoptimized(instanceof_check); | 381 assertUnoptimized(instanceof_check); |
| 382 } | 382 } |
| OLD | NEW |