Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Flags: --allow-natives-syntax | |
| 6 | |
| 7 function getobj() { | |
| 8 return { bar : function() { return 0}}; | |
| 9 } | |
| 10 | |
| 11 function foo() { | |
| 12 var obj = getobj(); | |
| 13 var length = arguments.length; | |
| 14 if (length == 0) { | |
| 15 obj.bar(); | |
| 16 } else { | |
| 17 obj.bar.apply(obj, arguments); | |
| 18 } | |
| 19 } | |
| 20 | |
| 21 foo(); | |
| 22 foo(); | |
| 23 %OptimizeFunctionOnNextCall(foo); | |
| 24 foo(); | |
| 25 if (%GetOptimizationStatus(foo) != 4) { | |
|
Jakob Kummerow
2014/11/19 20:46:16
Just use assertOptimized(foo) / assertUnoptimized(
ulan
2014/11/20 15:23:30
Done.
| |
| 26 assertEquals(1, %GetOptimizationStatus(foo)); | |
| 27 foo(10); | |
| 28 assertEquals(2, %GetOptimizationStatus(foo)); | |
| 29 } | |
| OLD | NEW |