| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 BoolScope(bool* addr, bool value) : _addr(addr), _value(*addr) { | 55 BoolScope(bool* addr, bool value) : _addr(addr), _value(*addr) { |
| 56 *_addr = value; | 56 *_addr = value; |
| 57 } | 57 } |
| 58 ~BoolScope() { | 58 ~BoolScope() { |
| 59 *_addr = _value; | 59 *_addr = _value; |
| 60 } | 60 } |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 bool* _addr; | 63 bool* _addr; |
| 64 bool _value; | 64 bool _value; |
| 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(BoolScope); |
| 65 }; | 67 }; |
| 66 | 68 |
| 67 | 69 |
| 68 class ScavengerVisitor : public ObjectPointerVisitor { | 70 class ScavengerVisitor : public ObjectPointerVisitor { |
| 69 public: | 71 public: |
| 70 explicit ScavengerVisitor(Isolate* isolate, Scavenger* scavenger) | 72 explicit ScavengerVisitor(Isolate* isolate, Scavenger* scavenger) |
| 71 : ObjectPointerVisitor(isolate), | 73 : ObjectPointerVisitor(isolate), |
| 72 scavenger_(scavenger), | 74 scavenger_(scavenger), |
| 73 heap_(scavenger->heap_), | 75 heap_(scavenger->heap_), |
| 74 vm_heap_(Dart::vm_isolate()->heap()), | 76 vm_heap_(Dart::vm_isolate()->heap()), |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 PeerTable::iterator it = peer_table_.find(raw_obj); | 706 PeerTable::iterator it = peer_table_.find(raw_obj); |
| 705 return (it == peer_table_.end()) ? NULL : it->second; | 707 return (it == peer_table_.end()) ? NULL : it->second; |
| 706 } | 708 } |
| 707 | 709 |
| 708 | 710 |
| 709 int64_t Scavenger::PeerCount() const { | 711 int64_t Scavenger::PeerCount() const { |
| 710 return static_cast<int64_t>(peer_table_.size()); | 712 return static_cast<int64_t>(peer_table_.size()); |
| 711 } | 713 } |
| 712 | 714 |
| 713 } // namespace dart | 715 } // namespace dart |
| OLD | NEW |