| OLD | NEW |
| 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 17 matching lines...) Expand all Loading... |
| 28 DEFINE_FLAG(bool, print_free_list_after_gc, false, | 28 DEFINE_FLAG(bool, print_free_list_after_gc, false, |
| 29 "Print free list statistics after a GC"); | 29 "Print free list statistics after a GC"); |
| 30 DEFINE_FLAG(bool, collect_code, true, | 30 DEFINE_FLAG(bool, collect_code, true, |
| 31 "Attempt to GC infrequently used code."); | 31 "Attempt to GC infrequently used code."); |
| 32 DEFINE_FLAG(int, code_collection_interval_in_us, 30000000, | 32 DEFINE_FLAG(int, code_collection_interval_in_us, 30000000, |
| 33 "Time between attempts to collect unused code."); | 33 "Time between attempts to collect unused code."); |
| 34 DEFINE_FLAG(bool, log_code_drop, false, | 34 DEFINE_FLAG(bool, log_code_drop, false, |
| 35 "Emit a log message when pointers to unused code are dropped."); | 35 "Emit a log message when pointers to unused code are dropped."); |
| 36 DEFINE_FLAG(bool, always_drop_code, false, | 36 DEFINE_FLAG(bool, always_drop_code, false, |
| 37 "Always try to drop code if the function's usage counter is >= 0"); | 37 "Always try to drop code if the function's usage counter is >= 0"); |
| 38 #if defined(TARGET_ARCH_IA32) | 38 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_ARM) |
| 39 DEFINE_FLAG(bool, concurrent_sweep, true, | 39 DEFINE_FLAG(bool, concurrent_sweep, true, |
| 40 "Concurrent sweep for old generation."); | 40 "Concurrent sweep for old generation."); |
| 41 #else // TARGET_ARCH_IA32 | 41 #else // TARGET_ARCH_IA32 || TARGET_ARCH_ARM |
| 42 DEFINE_FLAG(bool, concurrent_sweep, false, | 42 DEFINE_FLAG(bool, concurrent_sweep, false, |
| 43 "Concurrent sweep for old generation."); | 43 "Concurrent sweep for old generation."); |
| 44 #endif // TARGET_ARCH_IA32 | 44 #endif // TARGET_ARCH_IA32 || TARGET_ARCH_ARM |
| 45 DEFINE_FLAG(bool, log_growth, false, "Log PageSpace growth policy decisions."); | 45 DEFINE_FLAG(bool, log_growth, false, "Log PageSpace growth policy decisions."); |
| 46 | 46 |
| 47 HeapPage* HeapPage::Initialize(VirtualMemory* memory, PageType type) { | 47 HeapPage* HeapPage::Initialize(VirtualMemory* memory, PageType type) { |
| 48 ASSERT(memory->size() > VirtualMemory::PageSize()); | 48 ASSERT(memory->size() > VirtualMemory::PageSize()); |
| 49 bool is_executable = (type == kExecutable); | 49 bool is_executable = (type == kExecutable); |
| 50 memory->Commit(is_executable); | 50 memory->Commit(is_executable); |
| 51 | 51 |
| 52 HeapPage* result = reinterpret_cast<HeapPage*>(memory->address()); | 52 HeapPage* result = reinterpret_cast<HeapPage*>(memory->address()); |
| 53 result->memory_ = memory; | 53 result->memory_ = memory; |
| 54 result->next_ = NULL; | 54 result->next_ = NULL; |
| (...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 return 0; | 1000 return 0; |
| 1001 } else { | 1001 } else { |
| 1002 ASSERT(total_time >= gc_time); | 1002 ASSERT(total_time >= gc_time); |
| 1003 int result= static_cast<int>((static_cast<double>(gc_time) / | 1003 int result= static_cast<int>((static_cast<double>(gc_time) / |
| 1004 static_cast<double>(total_time)) * 100); | 1004 static_cast<double>(total_time)) * 100); |
| 1005 return result; | 1005 return result; |
| 1006 } | 1006 } |
| 1007 } | 1007 } |
| 1008 | 1008 |
| 1009 } // namespace dart | 1009 } // namespace dart |
| OLD | NEW |