v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
bytecode-liveness-map.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 {
9namespace compiler {
10
11std::string ToString(const BytecodeLivenessState& liveness) {
12 std::string out;
13 out.resize(liveness.register_count() + 1);
14 for (int i = 0; i < liveness.register_count(); ++i) {
15 if (liveness.RegisterIsLive(i)) {
16 out[i] = 'L';
17 } else {
18 out[i] = '.';
19 }
20 }
21 if (liveness.AccumulatorIsLive()) {
22 out[liveness.register_count()] = 'L';
23 } else {
24 out[liveness.register_count()] = '.';
25 }
26 return out;
27}
28
29} // namespace compiler
30} // namespace internal
31} // namespace v8
std::string ToString(const BytecodeLivenessState &liveness)