summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/bytecode-liveness-map.cc
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2022-04-12 11:10:15 +0200
committerMichaël Zasso <targos@protonmail.com>2022-04-12 22:08:39 +0200
commitfd4f80ce54d7f7b7503e0999f6a9d293d493846d (patch)
tree00fba34b8aabeb481c7128fccee635719ee44a3b /deps/v8/src/compiler/bytecode-liveness-map.cc
parent73d53fe9f56d7ce5de4b9c9ad5257dc601bbce14 (diff)
downloadnode-new-fd4f80ce54d7f7b7503e0999f6a9d293d493846d.tar.gz
deps: update V8 to 10.1.124.6
PR-URL: https://github.com/nodejs/node/pull/42657 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
Diffstat (limited to 'deps/v8/src/compiler/bytecode-liveness-map.cc')
-rw-r--r--deps/v8/src/compiler/bytecode-liveness-map.cc42
1 files changed, 16 insertions, 26 deletions
diff --git a/deps/v8/src/compiler/bytecode-liveness-map.cc b/deps/v8/src/compiler/bytecode-liveness-map.cc
index 7050ec385e..a24dbecafa 100644
--- a/deps/v8/src/compiler/bytecode-liveness-map.cc
+++ b/deps/v8/src/compiler/bytecode-liveness-map.cc
@@ -8,32 +8,22 @@ namespace v8 {
namespace internal {
namespace compiler {
-BytecodeLiveness::BytecodeLiveness(int register_count, Zone* zone)
- : in(zone->New<BytecodeLivenessState>(register_count, zone)),
- out(zone->New<BytecodeLivenessState>(register_count, zone)) {}
-
-BytecodeLivenessMap::BytecodeLivenessMap(int bytecode_size, Zone* zone)
- : liveness_map_(base::bits::RoundUpToPowerOfTwo32(bytecode_size / 4 + 1),
- base::KeyEqualityMatcher<int>(),
- ZoneAllocationPolicy(zone)) {}
-
-uint32_t OffsetHash(int offset) { return offset; }
-
-BytecodeLiveness& BytecodeLivenessMap::InitializeLiveness(int offset,
- int register_count,
- Zone* zone) {
- return liveness_map_
- .LookupOrInsert(offset, OffsetHash(offset),
- [&]() { return BytecodeLiveness(register_count, zone); })
- ->value;
-}
-
-BytecodeLiveness& BytecodeLivenessMap::GetLiveness(int offset) {
- return liveness_map_.Lookup(offset, OffsetHash(offset))->value;
-}
-
-const BytecodeLiveness& BytecodeLivenessMap::GetLiveness(int offset) const {
- return liveness_map_.Lookup(offset, OffsetHash(offset))->value;
+std::string ToString(const BytecodeLivenessState& liveness) {
+ std::string out;
+ out.resize(liveness.register_count() + 1);
+ for (int i = 0; i < liveness.register_count(); ++i) {
+ if (liveness.RegisterIsLive(i)) {
+ out[i] = 'L';
+ } else {
+ out[i] = '.';
+ }
+ }
+ if (liveness.AccumulatorIsLive()) {
+ out[liveness.register_count()] = 'L';
+ } else {
+ out[liveness.register_count()] = '.';
+ }
+ return out;
}
} // namespace compiler