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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 // Note: usage_.capacity_in_words is increased by AllocateLargePage. | 390 // Note: usage_.capacity_in_words is increased by AllocateLargePage. |
391 usage_.used_in_words += size >> kWordSizeLog2; | 391 usage_.used_in_words += size >> kWordSizeLog2; |
392 } | 392 } |
393 } | 393 } |
394 } | 394 } |
395 if (result != 0) { | 395 if (result != 0) { |
396 #ifdef DEBUG | 396 #ifdef DEBUG |
397 // A successful allocation should increase usage_. | 397 // A successful allocation should increase usage_. |
398 ASSERT(usage_before.used_in_words < usage_.used_in_words); | 398 ASSERT(usage_before.used_in_words < usage_.used_in_words); |
399 #endif | 399 #endif |
400 if (FLAG_compiler_stats && (type == HeapPage::kExecutable)) { | |
401 CompilerStats::code_allocated += size; | |
402 } | |
403 } else { | 400 } else { |
404 #ifdef DEBUG | 401 #ifdef DEBUG |
405 // A failed allocation should not change used_in_words. | 402 // A failed allocation should not change used_in_words. |
406 ASSERT(usage_before.used_in_words == usage_.used_in_words); | 403 ASSERT(usage_before.used_in_words == usage_.used_in_words); |
407 #endif | 404 #endif |
408 } | 405 } |
409 ASSERT((result & kObjectAlignmentMask) == kOldObjectAlignmentOffset); | 406 ASSERT((result & kObjectAlignmentMask) == kOldObjectAlignmentOffset); |
410 return result; | 407 return result; |
411 } | 408 } |
412 | 409 |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1136 return 0; | 1133 return 0; |
1137 } else { | 1134 } else { |
1138 ASSERT(total_time >= gc_time); | 1135 ASSERT(total_time >= gc_time); |
1139 int result = static_cast<int>((static_cast<double>(gc_time) / | 1136 int result = static_cast<int>((static_cast<double>(gc_time) / |
1140 static_cast<double>(total_time)) * 100); | 1137 static_cast<double>(total_time)) * 100); |
1141 return result; | 1138 return result; |
1142 } | 1139 } |
1143 } | 1140 } |
1144 | 1141 |
1145 } // namespace dart | 1142 } // namespace dart |
OLD | NEW |