v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
deoptimize-reason.cc
Go to the documentation of this file.
1// Copyright 2016 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
6
7namespace v8 {
8namespace internal {
9
10std::ostream& operator<<(std::ostream& os, DeoptimizeReason reason) {
11 switch (reason) {
12#define DEOPTIMIZE_REASON(Name, message) \
13 case DeoptimizeReason::k##Name: \
14 return os << #Name;
16#undef DEOPTIMIZE_REASON
17 }
19}
20
22 return static_cast<uint8_t>(reason);
23}
24
26 static char const* kDeoptimizeReasonStrings[] = {
27#define DEOPTIMIZE_REASON(Name, message) message,
29#undef DEOPTIMIZE_REASON
30 };
31 size_t const index = static_cast<size_t>(reason);
32 DCHECK_LT(index, arraysize(kDeoptimizeReasonStrings));
33 return kDeoptimizeReasonStrings[index];
34}
35
37 static char const* kDeoptimizeReasonStrings[] = {
38#define LAZY_DEOPTIMIZE_REASON(Name, message) message,
40#undef LAZY_DEOPTIMIZE_REASON
41 };
42 size_t const index = static_cast<size_t>(reason);
43 DCHECK_LT(index, arraysize(kDeoptimizeReasonStrings));
44 return kDeoptimizeReasonStrings[index];
45}
46
47} // namespace internal
48} // namespace v8
#define LAZY_DEOPTIMIZE_REASON_LIST(V)
#define DEOPTIMIZE_REASON_LIST(V)
size_t hash_value(AtomicMemoryOrder order)
char const * DeoptimizeReasonToString(DeoptimizeReason reason)
std::ostream & operator<<(std::ostream &os, AtomicMemoryOrder order)
#define DCHECK_LT(v1, v2)
Definition logging.h:489
#define arraysize(array)
Definition macros.h:67