Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: runtime/vm/scavenger.cc

Issue 10915015: Make fewer assumptions about the layout of api handles. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/dart_api_state.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 9
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 189
190 class ScavengerWeakVisitor : public HandleVisitor { 190 class ScavengerWeakVisitor : public HandleVisitor {
191 public: 191 public:
192 explicit ScavengerWeakVisitor(Scavenger* scavenger) : scavenger_(scavenger) { 192 explicit ScavengerWeakVisitor(Scavenger* scavenger) : scavenger_(scavenger) {
193 } 193 }
194 194
195 void VisitHandle(uword addr) { 195 void VisitHandle(uword addr) {
196 FinalizablePersistentHandle* handle = 196 FinalizablePersistentHandle* handle =
197 reinterpret_cast<FinalizablePersistentHandle*>(addr); 197 reinterpret_cast<FinalizablePersistentHandle*>(addr);
198 RawObject** p = reinterpret_cast<RawObject**>(handle); 198 RawObject** p = handle->raw_addr();
199 if (scavenger_->IsUnreachable(p)) { 199 if (scavenger_->IsUnreachable(p)) {
200 FinalizablePersistentHandle::Finalize(handle); 200 FinalizablePersistentHandle::Finalize(handle);
201 } 201 }
202 } 202 }
203 203
204 private: 204 private:
205 Scavenger* scavenger_; 205 Scavenger* scavenger_;
206 206
207 DISALLOW_COPY_AND_ASSIGN(ScavengerWeakVisitor); 207 DISALLOW_COPY_AND_ASSIGN(ScavengerWeakVisitor);
208 }; 208 };
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 scavenging_ = false; 583 scavenging_ = false;
584 } 584 }
585 585
586 586
587 void Scavenger::WriteProtect(bool read_only) { 587 void Scavenger::WriteProtect(bool read_only) {
588 space_->Protect( 588 space_->Protect(
589 read_only ? VirtualMemory::kReadOnly : VirtualMemory::kReadWrite); 589 read_only ? VirtualMemory::kReadOnly : VirtualMemory::kReadWrite);
590 } 590 }
591 591
592 } // namespace dart 592 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698