v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
opcodes.cc
Go to the documentation of this file.
1
// Copyright 2014 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/compiler/opcodes.h
"
6
7
#include <algorithm>
8
#include <ostream>
9
10
#include "
src/base/macros.h
"
11
12
namespace
v8
{
13
namespace
internal
{
14
namespace
compiler {
15
16
namespace
{
17
18
char
const
*
const
kMnemonics[] = {
19
#define DECLARE_MNEMONIC(x, ...) #x,
20
ALL_OP_LIST
(
DECLARE_MNEMONIC
)
21
#undef DECLARE_MNEMONIC
22
"UnknownOpcode"
};
23
24
}
// namespace
25
26
27
// static
28
char
const
*
IrOpcode::Mnemonic
(
Value
value) {
29
DCHECK_LE
(0,
static_cast<
int
>
(value));
30
DCHECK_LE
(
static_cast<
int
>
(value),
IrOpcode::Value::kLast
);
31
size_t
const
n = std::min<size_t>(value,
arraysize
(kMnemonics) - 1);
32
return
kMnemonics[
n
];
33
}
34
35
36
std::ostream&
operator<<
(std::ostream& os,
IrOpcode::Value
opcode) {
37
return
os <<
IrOpcode::Mnemonic
(opcode);
38
}
39
40
}
// namespace compiler
41
}
// namespace internal
42
}
// namespace v8
v8::internal::compiler::IrOpcode::Value
Value
Definition
opcodes.h:1340
v8::internal::compiler::IrOpcode::kLast
@ kLast
Definition
opcodes.h:1344
v8::internal::compiler::IrOpcode::Mnemonic
static char const * Mnemonic(Value value)
Definition
opcodes.cc:28
n
int n
Definition
mul-fft.cc:296
v8::internal::compiler::operator<<
std::ostream & operator<<(std::ostream &os, AccessMode access_mode)
Definition
access-info.cc:74
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
v8
Definition
api-arguments-inl.h:19
DECLARE_MNEMONIC
#define DECLARE_MNEMONIC(x,...)
opcodes.h
ALL_OP_LIST
#define ALL_OP_LIST(V)
Definition
opcodes.h:1328
DCHECK_LE
#define DCHECK_LE(v1, v2)
Definition
logging.h:490
macros.h
arraysize
#define arraysize(array)
Definition
macros.h:67
src
compiler
opcodes.cc
Generated on Sun Apr 6 2025 21:08:52 for v8 by
1.12.0