summaryrefslogtreecommitdiff
path: root/chromium/v8/src/wasm/wasm-tier.h
blob: 24a143d0690e3d3c2311b48110bfe220cb7fd1a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2018 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.

#ifndef V8_WASM_WASM_TIER_H_
#define V8_WASM_WASM_TIER_H_

#include <cstdint>

namespace v8 {
namespace internal {
namespace wasm {

// All the tiers of Wasm execution.
enum class ExecutionTier : int8_t {
  kNone,
  kInterpreter,
  kLiftoff,
  kTurbofan,
};

inline const char* ExecutionTierToString(ExecutionTier tier) {
  switch (tier) {
    case ExecutionTier::kTurbofan:
      return "turbofan";
    case ExecutionTier::kLiftoff:
      return "liftoff";
    case ExecutionTier::kInterpreter:
      return "interpreter";
    case ExecutionTier::kNone:
      return "none";
  }
}

// {kForDebugging} is used for default tiered-down code (potentially with
// breakpoints), {kForStepping} is code that is flooded with breakpoints.
enum ForDebugging : int8_t { kNoDebugging = 0, kForDebugging, kForStepping };

enum TieringState : int8_t { kTieredUp, kTieredDown };

}  // namespace wasm
}  // namespace internal
}  // namespace v8

#endif  // V8_WASM_WASM_TIER_H_