v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
bytecode-register.cc
Go to the documentation of this file.
1// Copyright 2015 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 {
9namespace interpreter {
10
11std::string Register::ToString() const {
12 if (is_current_context()) {
13 return std::string("<context>");
14 } else if (is_function_closure()) {
15 return std::string("<closure>");
16 } else if (*this == virtual_accumulator()) {
17 return std::string("<accumulator>");
18 } else if (is_parameter()) {
19 int parameter_index = ToParameterIndex();
20 if (parameter_index == 0) {
21 return std::string("<this>");
22 } else {
23 std::ostringstream s;
24 s << "a" << parameter_index - 1;
25 return s.str();
26 }
27 } else {
28 std::ostringstream s;
29 s << "r" << index();
30 return s.str();
31 }
32}
33
34} // namespace interpreter
35} // namespace internal
36} // namespace v8
static constexpr Register virtual_accumulator()
constexpr bool is_current_context() const
constexpr bool is_function_closure() const
int s
Definition mul-fft.cc:297