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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 // that state "Array" implies an AllocationSite is present, and code is | 355 // that state "Array" implies an AllocationSite is present, and code is |
356 // configured to use it. | 356 // configured to use it. |
357 instanceof_check2(realmBArray); | 357 instanceof_check2(realmBArray); |
358 instanceof_check2(Array); | 358 instanceof_check2(Array); |
359 | 359 |
360 %OptimizeFunctionOnNextCall(instanceof_check); | 360 %OptimizeFunctionOnNextCall(instanceof_check); |
361 | 361 |
362 // No de-opt will occur because HCallNewArray wasn't selected, on account of | 362 // No de-opt will occur because HCallNewArray wasn't selected, on account of |
363 // the call site not being monomorphic to Array. | 363 // the call site not being monomorphic to Array. |
364 instanceof_check(Array); | 364 instanceof_check(Array); |
365 assertTrue(2 != %GetOptimizationStatus(instanceof_check)); | 365 assertOptimized(instanceof_check); |
366 instanceof_check(realmBArray); | 366 instanceof_check(realmBArray); |
367 assertTrue(2 != %GetOptimizationStatus(instanceof_check)); | 367 assertOptimized(instanceof_check); |
368 | 368 |
369 // Try to optimize again, but first clear all type feedback, and allow it | 369 // Try to optimize again, but first clear all type feedback, and allow it |
370 // to be monomorphic on first call. Only after crankshafting do we introduce | 370 // to be monomorphic on first call. Only after crankshafting do we introduce |
371 // realmBArray. This should deopt the method. | 371 // realmBArray. This should deopt the method. |
372 %DeoptimizeFunction(instanceof_check); | 372 %DeoptimizeFunction(instanceof_check); |
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 assertTrue(2 != %GetOptimizationStatus(instanceof_check)); | 378 assertOptimized(instanceof_check); |
379 | 379 |
380 instanceof_check(realmBArray); | 380 instanceof_check(realmBArray); |
381 assertTrue(1 != %GetOptimizationStatus(instanceof_check)); | 381 assertUnoptimized(instanceof_check); |
382 } | 382 } |
OLD | NEW |