| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/scavenger.h" | 5 #include "vm/scavenger.h" |
| 6 | 6 |
| 7 #include "vm/dart.h" | 7 #include "vm/dart.h" |
| 8 #include "vm/dart_api_state.h" | 8 #include "vm/dart_api_state.h" |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/lockers.h" | 10 #include "vm/lockers.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 early_tenuring_threshold, | 26 early_tenuring_threshold, |
| 27 66, | 27 66, |
| 28 "When more than this percentage of promotion candidates survive, " | 28 "When more than this percentage of promotion candidates survive, " |
| 29 "promote all survivors of next scavenge."); | 29 "promote all survivors of next scavenge."); |
| 30 DEFINE_FLAG(int, | 30 DEFINE_FLAG(int, |
| 31 new_gen_garbage_threshold, | 31 new_gen_garbage_threshold, |
| 32 90, | 32 90, |
| 33 "Grow new gen when less than this percentage is garbage."); | 33 "Grow new gen when less than this percentage is garbage."); |
| 34 DEFINE_FLAG(int, new_gen_growth_factor, 4, "Grow new gen by this factor."); | 34 DEFINE_FLAG(int, new_gen_growth_factor, 4, "Grow new gen by this factor."); |
| 35 | 35 |
| 36 // Scavenger uses RawObject::kMarkBit to distinguish forwaded and non-forwarded | 36 // Scavenger uses RawObject::kMarkBit to distinguish forwarded and non-forwarded |
| 37 // objects. The kMarkBit does not intersect with the target address because of | 37 // objects. The kMarkBit does not intersect with the target address because of |
| 38 // object alignment. | 38 // object alignment. |
| 39 enum { | 39 enum { |
| 40 kForwardingMask = 1 << RawObject::kMarkBit, | 40 kForwardingMask = 1 << RawObject::kMarkBit, |
| 41 kNotForwarded = 0, | 41 kNotForwarded = 0, |
| 42 kForwarded = kForwardingMask, | 42 kForwarded = kForwardingMask, |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 | 45 |
| 46 static inline bool IsForwarding(uword header) { | 46 static inline bool IsForwarding(uword header) { |
| (...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 } | 899 } |
| 900 | 900 |
| 901 | 901 |
| 902 void Scavenger::FreeExternal(intptr_t size) { | 902 void Scavenger::FreeExternal(intptr_t size) { |
| 903 ASSERT(size >= 0); | 903 ASSERT(size >= 0); |
| 904 external_size_ -= size; | 904 external_size_ -= size; |
| 905 ASSERT(external_size_ >= 0); | 905 ASSERT(external_size_ >= 0); |
| 906 } | 906 } |
| 907 | 907 |
| 908 } // namespace dart | 908 } // namespace dart |
| OLD | NEW |