LCOV - code coverage report
Current view: top level - src/compiler - bytecode-liveness-map.cc (source / functions) Hit Total Coverage
Test: app.info Lines: 15 15 100.0 %
Date: 2019-03-21 Functions: 6 7 85.7 %

          Line data    Source code
       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    15807142 : BytecodeLiveness::BytecodeLiveness(int register_count, Zone* zone)
      12             :     : in(new (zone) BytecodeLivenessState(register_count, zone)),
      13    31614272 :       out(new (zone) BytecodeLivenessState(register_count, zone)) {}
      14             : 
      15      528987 : BytecodeLivenessMap::BytecodeLivenessMap(int bytecode_size, Zone* zone)
      16      528987 :     : liveness_map_(base::bits::RoundUpToPowerOfTwo32(bytecode_size / 4 + 1),
      17             :                     base::KeyEqualityMatcher<int>(),
      18     1057970 :                     ZoneAllocationPolicy(zone)) {}
      19             : 
      20    28457136 : uint32_t OffsetHash(int offset) { return offset; }
      21             : 
      22    15807139 : BytecodeLiveness& BytecodeLivenessMap::InitializeLiveness(int offset,
      23             :                                                           int register_count,
      24             :                                                           Zone* zone) {
      25             :   return liveness_map_
      26    63228561 :       .LookupOrInsert(offset, OffsetHash(offset),
      27    15807141 :                       [&]() { return BytecodeLiveness(register_count, zone); },
      28             :                       ZoneAllocationPolicy(zone))
      29    31614288 :       ->value;
      30             : }
      31             : 
      32     1999226 : BytecodeLiveness& BytecodeLivenessMap::GetLiveness(int offset) {
      33     1999226 :   return liveness_map_.Lookup(offset, OffsetHash(offset))->value;
      34             : }
      35             : 
      36    10650771 : const BytecodeLiveness& BytecodeLivenessMap::GetLiveness(int offset) const {
      37    10650771 :   return liveness_map_.Lookup(offset, OffsetHash(offset))->value;
      38             : }
      39             : 
      40             : }  // namespace compiler
      41             : }  // namespace internal
      42      120216 : }  // namespace v8

Generated by: LCOV version 1.10