• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2018 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 #ifndef V8_WASM_WASM_TIER_H_
6 #define V8_WASM_WASM_TIER_H_
7 
8 #include <cstdint>
9 
10 namespace v8 {
11 namespace internal {
12 namespace wasm {
13 
14 // All the tiers of Wasm execution.
15 enum class ExecutionTier : int8_t {
16   kNone,
17   kLiftoff,
18   kTurbofan,
19 };
20 
ExecutionTierToString(ExecutionTier tier)21 inline const char* ExecutionTierToString(ExecutionTier tier) {
22   switch (tier) {
23     case ExecutionTier::kTurbofan:
24       return "turbofan";
25     case ExecutionTier::kLiftoff:
26       return "liftoff";
27     case ExecutionTier::kNone:
28       return "none";
29   }
30 }
31 
32 // {kForDebugging} is used for default tiered-down code, {kWithBreakpoints} if
33 // the code also contains breakpoints, and {kForStepping} for code that is
34 // flooded with breakpoints.
35 enum ForDebugging : int8_t {
36   kNoDebugging = 0,
37   kForDebugging,
38   kWithBreakpoints,
39   kForStepping
40 };
41 
42 enum TieringState : int8_t { kTieredUp, kTieredDown };
43 
44 }  // namespace wasm
45 }  // namespace internal
46 }  // namespace v8
47 
48 #endif  // V8_WASM_WASM_TIER_H_
49