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