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

5 6 7 8
#if !V8_ENABLE_WEBASSEMBLY
#error This header should only be included if WebAssembly is enabled.
#endif  // !V8_ENABLE_WEBASSEMBLY

9 10 11
#ifndef V8_WASM_WASM_TIER_H_
#define V8_WASM_WASM_TIER_H_

12 13
#include <cstdint>

14 15 16 17
namespace v8 {
namespace internal {
namespace wasm {

18
// All the tiers of Wasm execution.
19
enum class ExecutionTier : int8_t {
20
  kNone,
21 22
  kLiftoff,
  kTurbofan,
23 24
};

25 26 27 28 29 30 31 32 33 34 35
inline const char* ExecutionTierToString(ExecutionTier tier) {
  switch (tier) {
    case ExecutionTier::kTurbofan:
      return "turbofan";
    case ExecutionTier::kLiftoff:
      return "liftoff";
    case ExecutionTier::kNone:
      return "none";
  }
}

36 37 38 39 40 41 42 43 44
// {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
};
45

46
enum TieringState : int8_t { kTieredUp, kTieredDown };
47

48 49 50 51 52
}  // namespace wasm
}  // namespace internal
}  // namespace v8

#endif  // V8_WASM_WASM_TIER_H_