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

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

Issue 1722013002: Enable concurrent sweep on MIPS and ARM64. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
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/pages.h" 5 #include "vm/pages.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/compiler_stats.h" 8 #include "vm/compiler_stats.h"
9 #include "vm/gc_marker.h" 9 #include "vm/gc_marker.h"
10 #include "vm/gc_sweeper.h" 10 #include "vm/gc_sweeper.h"
(...skipping 19 matching lines...) Expand all
30 DEFINE_FLAG(bool, print_free_list_after_gc, false, 30 DEFINE_FLAG(bool, print_free_list_after_gc, false,
31 "Print free list statistics after a GC"); 31 "Print free list statistics after a GC");
32 DEFINE_FLAG(bool, collect_code, true, 32 DEFINE_FLAG(bool, collect_code, true,
33 "Attempt to GC infrequently used code."); 33 "Attempt to GC infrequently used code.");
34 DEFINE_FLAG(int, code_collection_interval_in_us, 30000000, 34 DEFINE_FLAG(int, code_collection_interval_in_us, 30000000,
35 "Time between attempts to collect unused code."); 35 "Time between attempts to collect unused code.");
36 DEFINE_FLAG(bool, log_code_drop, false, 36 DEFINE_FLAG(bool, log_code_drop, false,
37 "Emit a log message when pointers to unused code are dropped."); 37 "Emit a log message when pointers to unused code are dropped.");
38 DEFINE_FLAG(bool, always_drop_code, false, 38 DEFINE_FLAG(bool, always_drop_code, false,
39 "Always try to drop code if the function's usage counter is >= 0"); 39 "Always try to drop code if the function's usage counter is >= 0");
40 #if defined(TARGET_ARCH_MIPS) || defined(TARGET_ARCH_ARM64)
41 DEFINE_FLAG(bool, concurrent_sweep, false,
42 "Concurrent sweep for old generation.");
43 #else // TARGET_ARCH_MIPS || TARGET_ARCH_ARM64
44 DEFINE_FLAG(bool, concurrent_sweep, true, 40 DEFINE_FLAG(bool, concurrent_sweep, true,
45 "Concurrent sweep for old generation."); 41 "Concurrent sweep for old generation.");
46 #endif // TARGET_ARCH_MIPS || TARGET_ARCH_ARM64
47 DEFINE_FLAG(bool, log_growth, false, "Log PageSpace growth policy decisions."); 42 DEFINE_FLAG(bool, log_growth, false, "Log PageSpace growth policy decisions.");
48 43
49 HeapPage* HeapPage::Initialize(VirtualMemory* memory, PageType type) { 44 HeapPage* HeapPage::Initialize(VirtualMemory* memory, PageType type) {
50 ASSERT(memory != NULL); 45 ASSERT(memory != NULL);
51 ASSERT(memory->size() > VirtualMemory::PageSize()); 46 ASSERT(memory->size() > VirtualMemory::PageSize());
52 bool is_executable = (type == kExecutable); 47 bool is_executable = (type == kExecutable);
53 // Create the new page executable (RWX) only if we're not in W^X mode 48 // Create the new page executable (RWX) only if we're not in W^X mode
54 bool create_executable = !FLAG_write_protect_code && is_executable; 49 bool create_executable = !FLAG_write_protect_code && is_executable;
55 if (!memory->Commit(create_executable)) { 50 if (!memory->Commit(create_executable)) {
56 return NULL; 51 return NULL;
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 return 0; 1232 return 0;
1238 } else { 1233 } else {
1239 ASSERT(total_time >= gc_time); 1234 ASSERT(total_time >= gc_time);
1240 int result = static_cast<int>((static_cast<double>(gc_time) / 1235 int result = static_cast<int>((static_cast<double>(gc_time) /
1241 static_cast<double>(total_time)) * 100); 1236 static_cast<double>(total_time)) * 100);
1242 return result; 1237 return result;
1243 } 1238 }
1244 } 1239 }
1245 1240
1246 } // namespace dart 1241 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698