Index: test/mjsunit/regress/regress-3709.js |
diff --git a/test/mjsunit/regress/regress-3709.js b/test/mjsunit/regress/regress-3709.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f4e820e528807a098c4f6863c8baca4190710b47 |
--- /dev/null |
+++ b/test/mjsunit/regress/regress-3709.js |
@@ -0,0 +1,29 @@ |
+// Copyright 2014 the V8 project authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Flags: --allow-natives-syntax |
+ |
+function getobj() { |
+ return { bar : function() { return 0}}; |
+} |
+ |
+function foo() { |
+ var obj = getobj(); |
+ var length = arguments.length; |
+ if (length == 0) { |
+ obj.bar(); |
+ } else { |
+ obj.bar.apply(obj, arguments); |
+ } |
+} |
+ |
+foo(); |
+foo(); |
+%OptimizeFunctionOnNextCall(foo); |
+foo(); |
+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.
|
+ assertEquals(1, %GetOptimizationStatus(foo)); |
+ foo(10); |
+ assertEquals(2, %GetOptimizationStatus(foo)); |
+} |