Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: src/compiler/bytecode-liveness-map.cc

Issue 2523893003: Reland of [ignition/turbo] Perform liveness analysis on the bytecodes (Closed)
Patch Set: Export handler table for tests Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/bytecode-liveness-map.h ('k') | src/interpreter/bytecode-array-accessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/bytecode-liveness-map.cc
diff --git a/src/compiler/bytecode-liveness-map.cc b/src/compiler/bytecode-liveness-map.cc
new file mode 100644
index 0000000000000000000000000000000000000000..899e155b888d2620962eb5c66ebffcde0520dd92
--- /dev/null
+++ b/src/compiler/bytecode-liveness-map.cc
@@ -0,0 +1,41 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/compiler/bytecode-liveness-map.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+Liveness::Liveness(int size, Zone* zone)
+ : in(new (zone) BitVector(size, zone)),
+ out(new (zone) BitVector(size, 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; }
+
+Liveness& BytecodeLivenessMap::InitializeLiveness(int offset, int size,
+ Zone* zone) {
+ return liveness_map_
+ .LookupOrInsert(offset, OffsetHash(offset),
+ [&]() { return Liveness(size, zone); },
+ ZoneAllocationPolicy(zone))
+ ->value;
+}
+
+Liveness& BytecodeLivenessMap::GetLiveness(int offset) {
+ return liveness_map_.Lookup(offset, OffsetHash(offset))->value;
+}
+
+const Liveness& BytecodeLivenessMap::GetLiveness(int offset) const {
+ return liveness_map_.Lookup(offset, OffsetHash(offset))->value;
+}
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
« no previous file with comments | « src/compiler/bytecode-liveness-map.h ('k') | src/interpreter/bytecode-array-accessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698