- Update ObjectStatsVisitTracker::Visit function to check if CodeCache is of
CodeCache type, and extract the FixedArray from the struct if so
- Fix typo in v8-counters.h where count_of_FIXED_ARRAY_XXX fields weren't being
initialized.
BUG=v8:2780
R=danno@chromium.org, hpayer@chromium.org
Review URL: https://codereview.chromium.org/
19257002
Patch from Ross McIlroy <mcilroy@chromium.org>.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15748
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
TRANSITION_ARRAY_SUB_TYPE,
fixed_array_size);
}
- if (map_obj->code_cache() != heap->empty_fixed_array()) {
+ if (map_obj->has_code_cache()) {
+ CodeCache* cache = CodeCache::cast(map_obj->code_cache());
heap->RecordObjectStats(
FIXED_ARRAY_TYPE,
MAP_CODE_CACHE_SUB_TYPE,
- FixedArray::cast(map_obj->code_cache())->Size());
+ cache->default_cache()->Size());
+ if (!cache->normal_type_cache()->IsUndefined()) {
+ heap->RecordObjectStats(
+ FIXED_ARRAY_TYPE,
+ MAP_CODE_CACHE_SUB_TYPE,
+ FixedArray::cast(cache->normal_type_cache())->Size());
+ }
}
ObjectStatsVisitBase(kVisitMap, map, obj);
}
}
+bool Map::has_code_cache() {
+ return code_cache() != GetIsolate()->heap()->empty_fixed_array();
+}
+
+
bool Map::CanBeDeprecated() {
int descriptor = LastAdded();
for (int i = 0; i <= descriptor; i++) {
inline void set_is_access_check_needed(bool access_check_needed);
inline bool is_access_check_needed();
+ // Returns true if map has a non-empty stub code cache.
+ inline bool has_code_cache();
+
// [prototype]: implicit prototype object.
DECL_ACCESSORS(prototype, Object)
count_of_FIXED_ARRAY_##name##_ = \
StatsCounter("c:" "V8.CountOf_FIXED_ARRAY-" #name); \
size_of_FIXED_ARRAY_##name##_ = \
- StatsCounter("c:" "V8.SizeOf_FIXED_ARRAY-" #name); \
+ StatsCounter("c:" "V8.SizeOf_FIXED_ARRAY-" #name);
FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC)
#undef SC
}