• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
7(function ShiftRightWithDeoptUsage() {
8  function g() {}
9
10  function f() {
11    var tmp = 1264475713;
12    var tmp1 = tmp - (-913041544);
13    g();
14    return 1 >> tmp1;
15  }
16
17  %OptimizeFunctionOnNextCall(f);
18  assertEquals(0, f());
19})();
20
21
22(function ShiftRightWithCallUsage() {
23  var f = (function() {
24    "use asm"
25    // This is not a valid asm.js, we use the "use asm" here to
26    // trigger Turbofan without deoptimization support.
27
28    function g(x) { return x; }
29
30    function f() {
31      var tmp = 1264475713;
32      var tmp1 = tmp - (-913041544);
33      return g(1 >> tmp1, tmp1);
34    }
35
36    return f;
37  })();
38
39  %OptimizeFunctionOnNextCall(f);
40  assertEquals(0, f());
41})();
42