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

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

Issue 9368049: Add external byte array API and finalize external strings and byte arrays. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address review comments Created 8 years, 10 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/raw_object_snapshot.cc ('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 "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/object.h" 10 #include "vm/object.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 void VisitHandle(uword addr) { 139 void VisitHandle(uword addr) {
140 WeakPersistentHandle* handle = 140 WeakPersistentHandle* handle =
141 reinterpret_cast<WeakPersistentHandle*>(addr); 141 reinterpret_cast<WeakPersistentHandle*>(addr);
142 RawObject* raw_obj = handle->raw(); 142 RawObject* raw_obj = handle->raw();
143 uword raw_addr = RawObject::ToAddr(raw_obj); 143 uword raw_addr = RawObject::ToAddr(raw_obj);
144 if (scavenger_->from_->Contains(raw_addr)) { 144 if (scavenger_->from_->Contains(raw_addr)) {
145 uword header = *reinterpret_cast<uword*>(raw_addr); 145 uword header = *reinterpret_cast<uword*>(raw_addr);
146 if (IsForwarding(header)) { 146 if (IsForwarding(header)) {
147 handle->set_raw(RawObject::FromAddr(ForwardedAddr(header))); 147 handle->set_raw(RawObject::FromAddr(ForwardedAddr(header)));
148 } else { 148 } else {
149 handle->Finalize(); 149 WeakPersistentHandle::Finalize(handle);
150 } 150 }
151 } 151 }
152 } 152 }
153 153
154 private: 154 private:
155 Scavenger* scavenger_; 155 Scavenger* scavenger_;
156 156
157 DISALLOW_COPY_AND_ASSIGN(ScavengerWeakVisitor); 157 DISALLOW_COPY_AND_ASSIGN(ScavengerWeakVisitor);
158 }; 158 };
159 159
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 OS::PrintErr(" done.\n"); 297 OS::PrintErr(" done.\n");
298 } 298 }
299 299
300 count_++; 300 count_++;
301 // Done scavenging. Reset the marker. 301 // Done scavenging. Reset the marker.
302 ASSERT(scavenging_); 302 ASSERT(scavenging_);
303 scavenging_ = false; 303 scavenging_ = false;
304 } 304 }
305 305
306 } // namespace dart 306 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698