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

Side by Side 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 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
5 #include "src/compiler/bytecode-liveness-map.h"
6
7 namespace v8 {
8 namespace internal {
9 namespace compiler {
10
11 Liveness::Liveness(int size, Zone* zone)
12 : in(new (zone) BitVector(size, zone)),
13 out(new (zone) BitVector(size, zone)) {}
14
15 BytecodeLivenessMap::BytecodeLivenessMap(int bytecode_size, Zone* zone)
16 : liveness_map_(base::bits::RoundUpToPowerOfTwo32(bytecode_size / 4 + 1),
17 base::KeyEqualityMatcher<int>(),
18 ZoneAllocationPolicy(zone)) {}
19
20 uint32_t OffsetHash(int offset) { return offset; }
21
22 Liveness& BytecodeLivenessMap::InitializeLiveness(int offset, int size,
23 Zone* zone) {
24 return liveness_map_
25 .LookupOrInsert(offset, OffsetHash(offset),
26 [&]() { return Liveness(size, zone); },
27 ZoneAllocationPolicy(zone))
28 ->value;
29 }
30
31 Liveness& BytecodeLivenessMap::GetLiveness(int offset) {
32 return liveness_map_.Lookup(offset, OffsetHash(offset))->value;
33 }
34
35 const Liveness& BytecodeLivenessMap::GetLiveness(int offset) const {
36 return liveness_map_.Lookup(offset, OffsetHash(offset))->value;
37 }
38
39 } // namespace compiler
40 } // namespace internal
41 } // namespace v8
OLDNEW
« 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