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

Side by Side Diff: runtime/vm/heap.cc

Issue 1813053005: Fix to ensure the product mode builds again. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-comments Created 4 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 | « runtime/vm/gc_sweeper.cc ('k') | runtime/vm/timeline.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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/heap.h" 5 #include "vm/heap.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 360 }
361 361
362 362
363 void Heap::CollectNewSpaceGarbage(Thread* thread, 363 void Heap::CollectNewSpaceGarbage(Thread* thread,
364 ApiCallbacks api_callbacks, 364 ApiCallbacks api_callbacks,
365 GCReason reason) { 365 GCReason reason) {
366 if (BeginNewSpaceGC(thread)) { 366 if (BeginNewSpaceGC(thread)) {
367 bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks); 367 bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks);
368 RecordBeforeGC(kNew, reason); 368 RecordBeforeGC(kNew, reason);
369 VMTagScope tagScope(thread, VMTag::kGCNewSpaceTagId); 369 VMTagScope tagScope(thread, VMTag::kGCNewSpaceTagId);
370 #ifndef PRODUCT 370 TIMELINE_FUNCTION_GC_DURATION(thread, "CollectNewGeneration");
371 TimelineDurationScope tds(thread,
372 Timeline::GetGCStream(),
373 "CollectNewGeneration");
374 #endif // !PRODUCT
375 UpdateClassHeapStatsBeforeGC(kNew); 371 UpdateClassHeapStatsBeforeGC(kNew);
376 new_space_.Scavenge(invoke_api_callbacks); 372 new_space_.Scavenge(invoke_api_callbacks);
377 isolate()->class_table()->UpdatePromoted(); 373 isolate()->class_table()->UpdatePromoted();
378 UpdatePretenurePolicy(); 374 UpdatePretenurePolicy();
379 RecordAfterGC(kNew); 375 RecordAfterGC(kNew);
380 PrintStats(); 376 PrintStats();
381 EndNewSpaceGC(); 377 EndNewSpaceGC();
382 if (old_space_.NeedsGarbageCollection()) { 378 if (old_space_.NeedsGarbageCollection()) {
383 // Old collections should call the API callbacks. 379 // Old collections should call the API callbacks.
384 CollectOldSpaceGarbage(thread, kInvokeApiCallbacks, kPromotion); 380 CollectOldSpaceGarbage(thread, kInvokeApiCallbacks, kPromotion);
385 } 381 }
386 } 382 }
387 } 383 }
388 384
389 385
390 void Heap::CollectOldSpaceGarbage(Thread* thread, 386 void Heap::CollectOldSpaceGarbage(Thread* thread,
391 ApiCallbacks api_callbacks, 387 ApiCallbacks api_callbacks,
392 GCReason reason) { 388 GCReason reason) {
393 if (BeginOldSpaceGC(thread)) { 389 if (BeginOldSpaceGC(thread)) {
394 bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks); 390 bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks);
395 RecordBeforeGC(kOld, reason); 391 RecordBeforeGC(kOld, reason);
396 VMTagScope tagScope(thread, VMTag::kGCOldSpaceTagId); 392 VMTagScope tagScope(thread, VMTag::kGCOldSpaceTagId);
397 #ifndef PRODUCT 393 TIMELINE_FUNCTION_GC_DURATION(thread, "CollectOldGeneration");
398 TimelineDurationScope tds(thread,
399 Timeline::GetGCStream(),
400 "CollectOldGeneration");
401 #endif // !PRODUCT
402 UpdateClassHeapStatsBeforeGC(kOld); 394 UpdateClassHeapStatsBeforeGC(kOld);
403 old_space_.MarkSweep(invoke_api_callbacks); 395 old_space_.MarkSweep(invoke_api_callbacks);
404 RecordAfterGC(kOld); 396 RecordAfterGC(kOld);
405 PrintStats(); 397 PrintStats();
406 EndOldSpaceGC(); 398 EndOldSpaceGC();
407 } 399 }
408 } 400 }
409 401
410 402
411 void Heap::CollectGarbage(Space space, 403 void Heap::CollectGarbage(Space space,
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 Dart::vm_isolate()->heap()->WriteProtect(false, include_code_pages_); 846 Dart::vm_isolate()->heap()->WriteProtect(false, include_code_pages_);
855 } 847 }
856 848
857 849
858 WritableVMIsolateScope::~WritableVMIsolateScope() { 850 WritableVMIsolateScope::~WritableVMIsolateScope() {
859 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); 851 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0);
860 Dart::vm_isolate()->heap()->WriteProtect(true, include_code_pages_); 852 Dart::vm_isolate()->heap()->WriteProtect(true, include_code_pages_);
861 } 853 }
862 854
863 } // namespace dart 855 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/gc_sweeper.cc ('k') | runtime/vm/timeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698