v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
bytecode-operands.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
5
#include "
src/interpreter/bytecode-operands.h
"
6
7
#include <iomanip>
8
9
namespace
v8
{
10
namespace
internal
{
11
namespace
interpreter {
12
13
namespace
{
14
15
const
char
* ImplicitRegisterUseToString(
16
ImplicitRegisterUse
implicit_register_use) {
17
switch
(implicit_register_use) {
18
case
ImplicitRegisterUse::kNone
:
19
return
"None"
;
20
case
ImplicitRegisterUse::kReadAccumulator
:
21
return
"ReadAccumulator"
;
22
case
ImplicitRegisterUse::kWriteAccumulator
:
23
return
"WriteAccumulator"
;
24
case
ImplicitRegisterUse::kClobberAccumulator
:
25
return
"ClobberAccumulator"
;
26
case
ImplicitRegisterUse::kWriteShortStar
:
27
return
"WriteShortStar"
;
28
case
ImplicitRegisterUse::kReadAndClobberAccumulator
:
29
return
"ReadAndClobberAccumulator"
;
30
case
ImplicitRegisterUse::kReadWriteAccumulator
:
31
return
"ReadWriteAccumulator"
;
32
case
ImplicitRegisterUse::kReadAccumulatorWriteShortStar
:
33
return
"ReadAccumulatorWriteShortStar"
;
34
}
35
UNREACHABLE
();
36
}
37
38
const
char
* OperandTypeToString(
OperandType
operand_type) {
39
switch
(operand_type) {
40
#define CASE(Name, _) \
41
case OperandType::k##Name: \
42
return #Name;
43
OPERAND_TYPE_LIST
(
CASE
)
44
#undef CASE
45
}
46
UNREACHABLE
();
47
}
48
49
const
char
* OperandScaleToString(
OperandScale
operand_scale) {
50
switch
(operand_scale) {
51
#define CASE(Name, _) \
52
case OperandScale::k##Name: \
53
return #Name;
54
OPERAND_SCALE_LIST
(
CASE
)
55
#undef CASE
56
}
57
UNREACHABLE
();
58
}
59
60
const
char
* OperandSizeToString(
OperandSize
operand_size) {
61
switch
(operand_size) {
62
case
OperandSize::kNone
:
63
return
"None"
;
64
case
OperandSize::kByte
:
65
return
"Byte"
;
66
case
OperandSize::kShort
:
67
return
"Short"
;
68
case
OperandSize::kQuad
:
69
return
"Quad"
;
70
}
71
UNREACHABLE
();
72
}
73
74
}
// namespace
75
76
std::ostream&
operator<<
(std::ostream& os,
const
ImplicitRegisterUse
& use) {
77
return
os << ImplicitRegisterUseToString(use);
78
}
79
80
std::ostream&
operator<<
(std::ostream& os,
const
OperandSize
& operand_size) {
81
return
os << OperandSizeToString(operand_size);
82
}
83
84
std::ostream&
operator<<
(std::ostream& os,
const
OperandScale
& operand_scale) {
85
return
os << OperandScaleToString(operand_scale);
86
}
87
88
std::ostream&
operator<<
(std::ostream& os,
const
OperandType
& operand_type) {
89
return
os << OperandTypeToString(operand_type);
90
}
91
92
}
// namespace interpreter
93
}
// namespace internal
94
}
// namespace v8
bytecode-operands.h
OPERAND_TYPE_LIST
#define OPERAND_TYPE_LIST(V)
Definition
bytecode-operands.h:58
OPERAND_SCALE_LIST
#define OPERAND_SCALE_LIST(V)
Definition
bytecode-operands.h:64
v8::internal::compiler::turboshaft::operator<<
std::ostream & operator<<(std::ostream &os, PaddingSpace padding)
Definition
copying-phase.cc:18
v8::internal::interpreter::OperandType
OperandType
Definition
bytecode-operands.h:103
v8::internal::interpreter::OperandSize
OperandSize
Definition
bytecode-operands.h:79
v8::internal::interpreter::OperandSize::kByte
@ kByte
v8::internal::interpreter::OperandSize::kShort
@ kShort
v8::internal::interpreter::OperandSize::kNone
@ kNone
v8::internal::interpreter::OperandSize::kQuad
@ kQuad
v8::internal::interpreter::ImplicitRegisterUse
ImplicitRegisterUse
Definition
bytecode-operands.h:114
v8::internal::interpreter::ImplicitRegisterUse::kClobberAccumulator
@ kClobberAccumulator
v8::internal::interpreter::ImplicitRegisterUse::kNone
@ kNone
v8::internal::interpreter::ImplicitRegisterUse::kReadWriteAccumulator
@ kReadWriteAccumulator
v8::internal::interpreter::ImplicitRegisterUse::kWriteShortStar
@ kWriteShortStar
v8::internal::interpreter::ImplicitRegisterUse::kReadAccumulator
@ kReadAccumulator
v8::internal::interpreter::ImplicitRegisterUse::kWriteAccumulator
@ kWriteAccumulator
v8::internal::interpreter::ImplicitRegisterUse::kReadAndClobberAccumulator
@ kReadAndClobberAccumulator
v8::internal::interpreter::ImplicitRegisterUse::kReadAccumulatorWriteShortStar
@ kReadAccumulatorWriteShortStar
v8::internal::interpreter::OperandScale
OperandScale
Definition
bytecode-operands.h:69
v8::internal::TranslationOpcode::CASE
CASE(name,...)
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
v8::internal::UNREACHABLE
UNREACHABLE()
v8
Definition
api-arguments-inl.h:19
src
interpreter
bytecode-operands.cc
Generated on Sun Apr 6 2025 21:08:54 for v8 by
1.12.0