• 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 --expose-gc
6
7function f(x) {
8  // TurboFan will hoist the CompareIC for x === 'some_string' and spill it.
9  if (x === 'some_other_string_1' || x === 'some_string') {
10    gc();
11  }
12  if (x === 'some_other_string_2' || x === 'some_string') {
13    gc();
14  }
15  // TurboFan will hoist the CompareIC for x === 1.4 and spill it.
16  if (x === 1.7 || x === 1.4) {
17    gc();
18  }
19  if (x === 1.9 || x === 1.4) {
20    gc();
21  }
22}
23
24%OptimizeFunctionOnNextCall(f);
25
26f('some_other_string_1');
27f(1.7);
28