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

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

Issue 792163003: Deletion barrier preparation: validate overwritten references. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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/freelist.cc ('k') | runtime/vm/pages.h » ('j') | 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) 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 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 uword old_tags; 956 uword old_tags;
957 // TODO(iposva): Investigate whether CompareAndSwapWord is necessary. 957 // TODO(iposva): Investigate whether CompareAndSwapWord is necessary.
958 do { 958 do {
959 old_tags = tags; 959 old_tags = tags;
960 tags = AtomicOperations::CompareAndSwapWord( 960 tags = AtomicOperations::CompareAndSwapWord(
961 &raw->ptr()->tags_, old_tags, new_tags); 961 &raw->ptr()->tags_, old_tags, new_tags);
962 } while (tags != old_tags); 962 } while (tags != old_tags);
963 963
964 intptr_t leftover_len = (leftover_size - TypedData::InstanceSize(0)); 964 intptr_t leftover_len = (leftover_size - TypedData::InstanceSize(0));
965 ASSERT(TypedData::InstanceSize(leftover_len) == leftover_size); 965 ASSERT(TypedData::InstanceSize(leftover_len) == leftover_size);
966 raw->StoreSmi(&(raw->ptr()->length_), Smi::New(leftover_len)); 966 raw->InitializeSmi(&(raw->ptr()->length_), Smi::New(leftover_len));
967 } else { 967 } else {
968 // Update the leftover space as a basic object. 968 // Update the leftover space as a basic object.
969 ASSERT(leftover_size == Object::InstanceSize()); 969 ASSERT(leftover_size == Object::InstanceSize());
970 RawObject* raw = reinterpret_cast<RawObject*>(RawObject::FromAddr(addr)); 970 RawObject* raw = reinterpret_cast<RawObject*>(RawObject::FromAddr(addr));
971 uword new_tags = RawObject::ClassIdTag::update(kInstanceCid, 0); 971 uword new_tags = RawObject::ClassIdTag::update(kInstanceCid, 0);
972 new_tags = RawObject::SizeTag::update(leftover_size, new_tags); 972 new_tags = RawObject::SizeTag::update(leftover_size, new_tags);
973 uword tags = raw->ptr()->tags_; 973 uword tags = raw->ptr()->tags_;
974 uword old_tags; 974 uword old_tags;
975 // TODO(iposva): Investigate whether CompareAndSwapWord is necessary. 975 // TODO(iposva): Investigate whether CompareAndSwapWord is necessary.
976 do { 976 do {
(...skipping 19655 matching lines...) Expand 10 before | Expand all | Expand 10 after
20632 return tag_label.ToCString(); 20632 return tag_label.ToCString();
20633 } 20633 }
20634 20634
20635 20635
20636 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 20636 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
20637 Instance::PrintJSONImpl(stream, ref); 20637 Instance::PrintJSONImpl(stream, ref);
20638 } 20638 }
20639 20639
20640 20640
20641 } // namespace dart 20641 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/freelist.cc ('k') | runtime/vm/pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698