1// Copyright 2015 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 7function foo(a, b) { 8 var passed = a == 3; 9 if (passed) { 10 if (passed) { 11 passed = b == 4; 12 } 13 } 14 %DeoptimizeFunction(foo); 15 return passed; 16} 17 18assertTrue(foo(3, 4)); 19assertTrue(foo(3, 4)); 20assertFalse(foo(3.1, 4)); 21assertFalse(foo(3, 4.1)); 22 23%OptimizeFunctionOnNextCall(foo); 24 25assertTrue(foo(3, 4)); 26assertTrue(foo(3, 4)); 27assertFalse(foo(3.1, 4)); 28assertFalse(foo(3, 4.1)); 29