| 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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 } | 941 } |
| 942 } | 942 } |
| 943 | 943 |
| 944 Scavenge(); | 944 Scavenge(); |
| 945 | 945 |
| 946 // It is possible for objects to stay in the new space | 946 // It is possible for objects to stay in the new space |
| 947 // if the VM cannot create more pages for these objects. | 947 // if the VM cannot create more pages for these objects. |
| 948 ASSERT((UsedInWords() == 0) || failed_to_promote_); | 948 ASSERT((UsedInWords() == 0) || failed_to_promote_); |
| 949 } | 949 } |
| 950 | 950 |
| 951 int64_t Scavenger::UsedInWords() const { |
| 952 uword saved_top = FlushTLS(); |
| 953 int64_t used_in_words = (top_ - FirstObjectStart()) >> kWordSizeLog2; |
| 954 UnflushTLS(saved_top); |
| 955 return used_in_words; |
| 956 } |
| 957 |
| 951 } // namespace dart | 958 } // namespace dart |
| OLD | NEW |