5 #ifndef V8_IC_IC_STATS_H_ 6 #define V8_IC_IC_STATS_H_ 10 #include <unordered_map> 13 #include "src/base/atomicops.h" 14 #include "src/base/lazy-instance.h" 32 const char* function_name;
34 const char* script_name;
42 bool is_dictionary_map;
44 unsigned number_of_own_descriptors;
45 std::string instance_type;
50 const int MAX_IC_INFO = 4096;
57 V8_INLINE
ICInfo& Current() {
58 DCHECK(pos_ >= 0 && pos_ < MAX_IC_INFO);
59 return ic_infos_[pos_];
61 const char* GetOrCacheScriptName(
Script* script);
62 const char* GetOrCacheFunctionName(
JSFunction*
function);
63 V8_INLINE
static ICStats* instance() {
return instance_.Pointer(); }
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_;
77 #endif // V8_IC_IC_STATS_H_