| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 | 733 |
| 734 void Scavenger::PrintToJSONObject(JSONObject* object) { | 734 void Scavenger::PrintToJSONObject(JSONObject* object) { |
| 735 JSONObject space(object, "new"); | 735 JSONObject space(object, "new"); |
| 736 space.AddProperty("type", "@Scavenger"); | 736 space.AddProperty("type", "@Scavenger"); |
| 737 space.AddProperty("id", "heaps/new"); | 737 space.AddProperty("id", "heaps/new"); |
| 738 space.AddProperty("name", "Scavenger"); | 738 space.AddProperty("name", "Scavenger"); |
| 739 space.AddProperty("user_name", "new"); | 739 space.AddProperty("user_name", "new"); |
| 740 space.AddProperty("collections", collections()); | 740 space.AddProperty("collections", collections()); |
| 741 space.AddProperty("used", UsedInWords() * kWordSize); | 741 space.AddProperty("used", UsedInWords() * kWordSize); |
| 742 space.AddProperty("capacity", CapacityInWords() * kWordSize); | 742 space.AddProperty("capacity", CapacityInWords() * kWordSize); |
| 743 space.AddProperty("time", RoundMicrosecondsToSeconds(gc_time_micros())); | 743 space.AddProperty("time", MicrosecondsToSeconds(gc_time_micros())); |
| 744 } | 744 } |
| 745 | 745 |
| 746 | 746 |
| 747 void Scavenger::AllocateExternal(intptr_t size) { | 747 void Scavenger::AllocateExternal(intptr_t size) { |
| 748 ASSERT(size >= 0); | 748 ASSERT(size >= 0); |
| 749 external_size_ += size; | 749 external_size_ += size; |
| 750 intptr_t remaining = end_ - top_; | 750 intptr_t remaining = end_ - top_; |
| 751 end_ -= Utils::Minimum(remaining, size); | 751 end_ -= Utils::Minimum(remaining, size); |
| 752 } | 752 } |
| 753 | 753 |
| 754 | 754 |
| 755 void Scavenger::FreeExternal(intptr_t size) { | 755 void Scavenger::FreeExternal(intptr_t size) { |
| 756 ASSERT(size >= 0); | 756 ASSERT(size >= 0); |
| 757 external_size_ -= size; | 757 external_size_ -= size; |
| 758 ASSERT(external_size_ >= 0); | 758 ASSERT(external_size_ >= 0); |
| 759 end_ = Utils::Minimum(to_->end(), end_ + size); | 759 end_ = Utils::Minimum(to_->end(), end_ + size); |
| 760 } | 760 } |
| 761 | 761 |
| 762 } // namespace dart | 762 } // namespace dart |
| OLD | NEW |