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

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

Issue 2770253002: [heap] Enforce explicit MarkingState (Closed)
Patch Set: rebase Created 3 years, 9 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 | « src/heap/mark-compact-inl.h ('k') | src/heap/objects-visiting-inl.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/assembler-inl.h" 7 #include "src/assembler-inl.h"
8 #include "src/compilation-cache.h" 8 #include "src/compilation-cache.h"
9 #include "src/counters.h" 9 #include "src/counters.h"
10 #include "src/heap/heap-inl.h" 10 #include "src/heap/heap-inl.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 array != heap->empty_descriptor_array() && 336 array != heap->empty_descriptor_array() &&
337 array != heap->empty_properties_dictionary(); 337 array != heap->empty_properties_dictionary();
338 } 338 }
339 339
340 static bool IsCowArray(Heap* heap, FixedArrayBase* array) { 340 static bool IsCowArray(Heap* heap, FixedArrayBase* array) {
341 return array->map() == heap->fixed_cow_array_map(); 341 return array->map() == heap->fixed_cow_array_map();
342 } 342 }
343 343
344 static bool SameLiveness(HeapObject* obj1, HeapObject* obj2) { 344 static bool SameLiveness(HeapObject* obj1, HeapObject* obj2) {
345 return obj1 == nullptr || obj2 == nullptr || 345 return obj1 == nullptr || obj2 == nullptr ||
346 ObjectMarking::Color(obj1) == ObjectMarking::Color(obj2); 346 ObjectMarking::Color(obj1, MarkingState::Internal(obj1)) ==
347 ObjectMarking::Color(obj2, MarkingState::Internal(obj2));
347 } 348 }
348 349
349 bool ObjectStatsCollector::RecordFixedArrayHelper(HeapObject* parent, 350 bool ObjectStatsCollector::RecordFixedArrayHelper(HeapObject* parent,
350 FixedArray* array, 351 FixedArray* array,
351 int subtype, 352 int subtype,
352 size_t overhead) { 353 size_t overhead) {
353 if (SameLiveness(parent, array) && CanRecordFixedArray(heap_, array) && 354 if (SameLiveness(parent, array) && CanRecordFixedArray(heap_, array) &&
354 !IsCowArray(heap_, array)) { 355 !IsCowArray(heap_, array)) {
355 return stats_->RecordFixedArraySubTypeStats(array, subtype, array->Size(), 356 return stats_->RecordFixedArraySubTypeStats(array, subtype, array->Size(),
356 overhead); 357 overhead);
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 SLOW_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE); 578 SLOW_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE);
578 FixedArray* fast_cache = native_ctx->fast_template_instantiations_cache(); 579 FixedArray* fast_cache = native_ctx->fast_template_instantiations_cache();
579 stats_->RecordFixedArraySubTypeStats( 580 stats_->RecordFixedArraySubTypeStats(
580 fast_cache, FAST_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE, 581 fast_cache, FAST_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE,
581 fast_cache->Size(), 0); 582 fast_cache->Size(), 0);
582 } 583 }
583 } 584 }
584 585
585 } // namespace internal 586 } // namespace internal
586 } // namespace v8 587 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/mark-compact-inl.h ('k') | src/heap/objects-visiting-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698