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

Side by Side Diff: src/heap/incremental-marking.cc

Issue 2310143002: [heap] Introduce enum of garbage collection reasons. (Closed)
Patch Set: rebase Created 4 years, 3 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/incremental-marking.h ('k') | src/heap/incremental-marking-job.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/incremental-marking.h" 5 #include "src/heap/incremental-marking.h"
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/compilation-cache.h" 8 #include "src/compilation-cache.h"
9 #include "src/conversions.h" 9 #include "src/conversions.h"
10 #include "src/heap/gc-idle-time-handler.h" 10 #include "src/heap/gc-idle-time-handler.h"
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 if (CodeStub::MajorKeyFromKey(key) == CodeStub::RecordWrite) { 490 if (CodeStub::MajorKeyFromKey(key) == CodeStub::RecordWrite) {
491 Object* e = stubs->ValueAt(i); 491 Object* e = stubs->ValueAt(i);
492 if (e->IsCode()) { 492 if (e->IsCode()) {
493 RecordWriteStub::Patch(Code::cast(e), mode); 493 RecordWriteStub::Patch(Code::cast(e), mode);
494 } 494 }
495 } 495 }
496 } 496 }
497 } 497 }
498 } 498 }
499 499
500 500 void IncrementalMarking::Start(GarbageCollectionReason gc_reason) {
501 void IncrementalMarking::Start(const char* reason) {
502 if (FLAG_trace_incremental_marking) { 501 if (FLAG_trace_incremental_marking) {
503 int old_generation_size_mb = 502 int old_generation_size_mb =
504 static_cast<int>(heap()->PromotedSpaceSizeOfObjects() / MB); 503 static_cast<int>(heap()->PromotedSpaceSizeOfObjects() / MB);
505 int old_generation_limit_mb = 504 int old_generation_limit_mb =
506 static_cast<int>(heap()->old_generation_allocation_limit() / MB); 505 static_cast<int>(heap()->old_generation_allocation_limit() / MB);
507 heap()->isolate()->PrintWithTimestamp( 506 heap()->isolate()->PrintWithTimestamp(
508 "[IncrementalMarking] Start (%s): old generation %dMB, limit %dMB, " 507 "[IncrementalMarking] Start (%s): old generation %dMB, limit %dMB, "
509 "slack %dMB\n", 508 "slack %dMB\n",
510 (reason == nullptr) ? "unknown reason" : reason, old_generation_size_mb, 509 Heap::GarbageCollectionReasonToString(gc_reason),
511 old_generation_limit_mb, 510 old_generation_size_mb, old_generation_limit_mb,
512 Max(0, old_generation_limit_mb - old_generation_size_mb)); 511 Max(0, old_generation_limit_mb - old_generation_size_mb));
513 } 512 }
514 DCHECK(FLAG_incremental_marking); 513 DCHECK(FLAG_incremental_marking);
515 DCHECK(state_ == STOPPED); 514 DCHECK(state_ == STOPPED);
516 DCHECK(heap_->gc_state() == Heap::NOT_IN_GC); 515 DCHECK(heap_->gc_state() == Heap::NOT_IN_GC);
517 DCHECK(!heap_->isolate()->serializer_enabled()); 516 DCHECK(!heap_->isolate()->serializer_enabled());
518 517
519 HistogramTimerScope incremental_marking_scope( 518 HistogramTimerScope incremental_marking_scope(
520 heap_->isolate()->counters()->gc_incremental_marking_start()); 519 heap_->isolate()->counters()->gc_incremental_marking_start());
521 TRACE_EVENT0("v8", "V8.GCIncrementalMarkingStart"); 520 TRACE_EVENT0("v8", "V8.GCIncrementalMarkingStart");
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 idle_marking_delay_counter_++; 1287 idle_marking_delay_counter_++;
1289 } 1288 }
1290 1289
1291 1290
1292 void IncrementalMarking::ClearIdleMarkingDelayCounter() { 1291 void IncrementalMarking::ClearIdleMarkingDelayCounter() {
1293 idle_marking_delay_counter_ = 0; 1292 idle_marking_delay_counter_ = 0;
1294 } 1293 }
1295 1294
1296 } // namespace internal 1295 } // namespace internal
1297 } // namespace v8 1296 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/incremental-marking.h ('k') | src/heap/incremental-marking-job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698