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

Side by Side Diff: src/heap/object-stats.cc

Issue 2021373002: Refactor Maps' code_cache (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: windows don't want no constexpr Created 4 years, 6 months 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 | « no previous file | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/object-stats.h" 5 #include "src/heap/object-stats.h"
6 6
7 #include "src/counters.h" 7 #include "src/counters.h"
8 #include "src/heap/heap-inl.h" 8 #include "src/heap/heap-inl.h"
9 #include "src/isolate.h" 9 #include "src/isolate.h"
10 #include "src/utils.h" 10 #include "src/utils.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 Heap* heap = map->GetHeap(); 180 Heap* heap = map->GetHeap();
181 Map* map_obj = Map::cast(obj); 181 Map* map_obj = Map::cast(obj);
182 DCHECK(map->instance_type() == MAP_TYPE); 182 DCHECK(map->instance_type() == MAP_TYPE);
183 DescriptorArray* array = map_obj->instance_descriptors(); 183 DescriptorArray* array = map_obj->instance_descriptors();
184 if (map_obj->owns_descriptors() && array != heap->empty_descriptor_array()) { 184 if (map_obj->owns_descriptors() && array != heap->empty_descriptor_array()) {
185 int fixed_array_size = array->Size(); 185 int fixed_array_size = array->Size();
186 heap->object_stats_->RecordFixedArraySubTypeStats(DESCRIPTOR_ARRAY_SUB_TYPE, 186 heap->object_stats_->RecordFixedArraySubTypeStats(DESCRIPTOR_ARRAY_SUB_TYPE,
187 fixed_array_size); 187 fixed_array_size);
188 } 188 }
189 if (map_obj->has_code_cache()) { 189 if (map_obj->has_code_cache()) {
190 FixedArray* cache = FixedArray::cast(map_obj->code_cache()); 190 FixedArray* cache = map_obj->code_cache();
191 heap->object_stats_->RecordFixedArraySubTypeStats(MAP_CODE_CACHE_SUB_TYPE, 191 heap->object_stats_->RecordFixedArraySubTypeStats(MAP_CODE_CACHE_SUB_TYPE,
192 cache->Size()); 192 cache->Size());
193 } 193 }
194 VisitBase(kVisitMap, map, obj); 194 VisitBase(kVisitMap, map, obj);
195 } 195 }
196 196
197 197
198 template <> 198 template <>
199 void ObjectStatsVisitor::Visit<ObjectStatsVisitor::kVisitCode>( 199 void ObjectStatsVisitor::Visit<ObjectStatsVisitor::kVisitCode>(
200 Map* map, HeapObject* obj) { 200 Map* map, HeapObject* obj) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 // Copy the original visitor table to make call-through possible. After we 238 // Copy the original visitor table to make call-through possible. After we
239 // preserved a copy locally, we patch the original table to call us. 239 // preserved a copy locally, we patch the original table to call us.
240 table_.CopyFrom(original); 240 table_.CopyFrom(original);
241 #define COUNT_FUNCTION(id) original->Register(kVisit##id, Visit<kVisit##id>); 241 #define COUNT_FUNCTION(id) original->Register(kVisit##id, Visit<kVisit##id>);
242 VISITOR_ID_LIST(COUNT_FUNCTION) 242 VISITOR_ID_LIST(COUNT_FUNCTION)
243 #undef COUNT_FUNCTION 243 #undef COUNT_FUNCTION
244 } 244 }
245 245
246 } // namespace internal 246 } // namespace internal
247 } // namespace v8 247 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698