LCOV - code coverage report
Current view: top level - src/ic - ic-stats.h (source / functions) Hit Total Coverage
Test: app.info Lines: 0 3 0.0 %
Date: 2017-04-26 Functions: 0 2 0.0 %

          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             : #ifndef V8_IC_IC_STATS_H_
       6             : #define V8_IC_IC_STATS_H_
       7             : 
       8             : #include <memory>
       9             : #include <string>
      10             : #include <unordered_map>
      11             : #include <vector>
      12             : 
      13             : #include "src/base/atomicops.h"
      14             : #include "src/base/lazy-instance.h"
      15             : 
      16             : namespace v8 {
      17             : 
      18             : namespace tracing {
      19             : class TracedValue;
      20             : }
      21             : 
      22             : namespace internal {
      23             : 
      24             : class JSFunction;
      25             : class Script;
      26             : 
      27           0 : struct ICInfo {
      28             :   ICInfo();
      29             :   void Reset();
      30             :   void AppendToTracedValue(v8::tracing::TracedValue* value) const;
      31             :   std::string type;
      32             :   const char* function_name;
      33             :   int script_offset;
      34             :   const char* script_name;
      35             :   int line_num;
      36             :   bool is_constructor;
      37             :   bool is_optimized;
      38             :   std::string state;
      39             :   // Address of the map.
      40             :   void* map;
      41             :   // Whether map is a dictionary map.
      42             :   bool is_dictionary_map;
      43             :   // Number of own descriptors.
      44             :   unsigned number_of_own_descriptors;
      45             :   std::string instance_type;
      46             : };
      47             : 
      48             : class ICStats {
      49             :  public:
      50             :   const int MAX_IC_INFO = 4096;
      51             : 
      52             :   ICStats();
      53             :   void Dump();
      54             :   void Begin();
      55             :   void End();
      56             :   void Reset();
      57             :   V8_INLINE ICInfo& Current() {
      58             :     DCHECK(pos_ >= 0 && pos_ < MAX_IC_INFO);
      59           0 :     return ic_infos_[pos_];
      60             :   }
      61             :   const char* GetOrCacheScriptName(Script* script);
      62             :   const char* GetOrCacheFunctionName(JSFunction* function);
      63           0 :   V8_INLINE static ICStats* instance() { return instance_.Pointer(); }
      64             : 
      65             :  private:
      66             :   static base::LazyInstance<ICStats>::type instance_;
      67             :   base::Atomic32 enabled_;
      68             :   std::vector<ICInfo> ic_infos_;
      69             :   std::unordered_map<Script*, std::unique_ptr<char[]>> script_name_map_;
      70             :   std::unordered_map<JSFunction*, std::unique_ptr<char[]>> function_name_map_;
      71             :   int pos_;
      72             : };
      73             : 
      74             : }  // namespace internal
      75             : }  // namespace v8
      76             : 
      77             : #endif  // V8_IC_IC_STATS_H_

Generated by: LCOV version 1.10