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

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

Issue 14307013: - Remember the fact that an object has been added to the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1253 explicit StoreBufferUpdateVisitor(Isolate* isolate, RawObject* obj) : 1253 explicit StoreBufferUpdateVisitor(Isolate* isolate, RawObject* obj) :
1254 ObjectPointerVisitor(isolate), old_obj_(obj) { 1254 ObjectPointerVisitor(isolate), old_obj_(obj) {
1255 ASSERT(old_obj_->IsOldObject()); 1255 ASSERT(old_obj_->IsOldObject());
1256 } 1256 }
1257 1257
1258 void VisitPointers(RawObject** first, RawObject** last) { 1258 void VisitPointers(RawObject** first, RawObject** last) {
1259 for (RawObject** curr = first; curr <= last; ++curr) { 1259 for (RawObject** curr = first; curr <= last; ++curr) {
1260 RawObject* raw_obj = *curr; 1260 RawObject* raw_obj = *curr;
1261 if (raw_obj->IsHeapObject() && raw_obj->IsNewObject()) { 1261 if (raw_obj->IsHeapObject() && raw_obj->IsNewObject()) {
1262 uword ptr = reinterpret_cast<uword>(old_obj_); 1262 uword ptr = reinterpret_cast<uword>(old_obj_);
1263 old_obj_->SetRememberedBit();
1263 isolate()->store_buffer()->AddPointer(ptr); 1264 isolate()->store_buffer()->AddPointer(ptr);
1264 // Remembered this object. There is no need to continue searching. 1265 // Remembered this object. There is no need to continue searching.
1265 return; 1266 return;
1266 } 1267 }
1267 } 1268 }
1268 } 1269 }
1269 1270
1270 private: 1271 private:
1271 RawObject* old_obj_; 1272 RawObject* old_obj_;
1272 1273
(...skipping 11 matching lines...) Expand all
1284 } 1285 }
1285 1286
1286 1287
1287 1288
1288 RawObject* Object::Clone(const Object& src, Heap::Space space) { 1289 RawObject* Object::Clone(const Object& src, Heap::Space space) {
1289 const Class& cls = Class::Handle(src.clazz()); 1290 const Class& cls = Class::Handle(src.clazz());
1290 intptr_t size = src.raw()->Size(); 1291 intptr_t size = src.raw()->Size();
1291 RawObject* raw_obj = Object::Allocate(cls.id(), size, space); 1292 RawObject* raw_obj = Object::Allocate(cls.id(), size, space);
1292 NoGCScope no_gc; 1293 NoGCScope no_gc;
1293 memmove(raw_obj->ptr(), src.raw()->ptr(), size); 1294 memmove(raw_obj->ptr(), src.raw()->ptr(), size);
1294 if (space == Heap::kOld) { 1295 if ((space == Heap::kOld) && !raw_obj->IsRemembered()) {
1295 StoreBufferUpdateVisitor visitor(Isolate::Current(), raw_obj); 1296 StoreBufferUpdateVisitor visitor(Isolate::Current(), raw_obj);
1296 raw_obj->VisitPointers(&visitor); 1297 raw_obj->VisitPointers(&visitor);
1297 } 1298 }
1298 return raw_obj; 1299 return raw_obj;
1299 } 1300 }
1300 1301
1301 1302
1302 RawString* Class::Name() const { 1303 RawString* Class::Name() const {
1303 ASSERT(raw_ptr()->name_ != String::null()); 1304 ASSERT(raw_ptr()->name_ != String::null());
1304 return raw_ptr()->name_; 1305 return raw_ptr()->name_;
(...skipping 11862 matching lines...) Expand 10 before | Expand all | Expand 10 after
13167 } 13168 }
13168 return result.raw(); 13169 return result.raw();
13169 } 13170 }
13170 13171
13171 13172
13172 const char* WeakProperty::ToCString() const { 13173 const char* WeakProperty::ToCString() const {
13173 return "_WeakProperty"; 13174 return "_WeakProperty";
13174 } 13175 }
13175 13176
13176 } // namespace dart 13177 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | runtime/vm/raw_object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698