wasm-tier.h 1.08 KB
Newer Older
1 2 3 4 5 6 7
// 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_

8 9
#include <cstdint>

10 11 12 13
namespace v8 {
namespace internal {
namespace wasm {

14
// All the tiers of Wasm execution.
15
enum class ExecutionTier : int8_t {
16
  kNone,
17 18
  kLiftoff,
  kTurbofan,
19 20
};

21 22 23 24 25 26 27 28 29 30 31
inline const char* ExecutionTierToString(ExecutionTier tier) {
  switch (tier) {
    case ExecutionTier::kTurbofan:
      return "turbofan";
    case ExecutionTier::kLiftoff:
      return "liftoff";
    case ExecutionTier::kNone:
      return "none";
  }
}

32 33 34 35 36 37 38 39 40
// {kForDebugging} is used for default tiered-down code, {kWithBreakpoints} if
// the code also contains breakpoints, and {kForStepping} for code that is
// flooded with breakpoints.
enum ForDebugging : int8_t {
  kNoDebugging = 0,
  kForDebugging,
  kWithBreakpoints,
  kForStepping
};
41

42
enum TieringState : int8_t { kTieredUp, kTieredDown };
43

44 45 46 47 48
}  // namespace wasm
}  // namespace internal
}  // namespace v8

#endif  // V8_WASM_WASM_TIER_H_