blob: 347ab5e59299b320981287dab6a2b19f1f8c5a1c [file] [log] [blame]
Ben Murdoch097c5b22016-05-18 11:27:45 +01001// Copyright 2016 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
7var f = (function() {
8 "use asm";
9 function foo(x) {
10 return x == 0;
11 }
12 return foo;
13})();
14
15function deopt(f) {
16 return {
17 toString : function() {
18 %DeoptimizeFunction(f);
19 return "2";
20 }
21 };
22}
23
24%OptimizeFunctionOnNextCall(f);
25assertFalse(f(deopt(f)));