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

Side by Side Diff: runtime/vm/raw_object.h

Issue 51253003: Fix RawObject::IsVMHeapObject to use Contains instead of relying on the mark bit. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 | « no previous file | runtime/vm/raw_object.cc » ('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 #ifndef VM_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/token.h" 10 #include "vm/token.h"
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 void Validate(Isolate* isolate) const; 369 void Validate(Isolate* isolate) const;
370 intptr_t VisitPointers(ObjectPointerVisitor* visitor); 370 intptr_t VisitPointers(ObjectPointerVisitor* visitor);
371 bool FindObject(FindObjectVisitor* visitor); 371 bool FindObject(FindObjectVisitor* visitor);
372 372
373 static RawObject* FromAddr(uword addr) { 373 static RawObject* FromAddr(uword addr) {
374 // We expect the untagged address here. 374 // We expect the untagged address here.
375 ASSERT((addr & kSmiTagMask) != kHeapObjectTag); 375 ASSERT((addr & kSmiTagMask) != kHeapObjectTag);
376 return reinterpret_cast<RawObject*>(addr + kHeapObjectTag); 376 return reinterpret_cast<RawObject*>(addr + kHeapObjectTag);
377 } 377 }
378 378
379 static uword ToAddr(RawObject* raw_obj) { 379 static uword ToAddr(const RawObject* raw_obj) {
380 return reinterpret_cast<uword>(raw_obj->ptr()); 380 return reinterpret_cast<uword>(raw_obj->ptr());
381 } 381 }
382 382
383 static bool IsCreatedFromSnapshot(intptr_t value) { 383 static bool IsCreatedFromSnapshot(intptr_t value) {
384 return CreatedFromSnapshotTag::decode(value); 384 return CreatedFromSnapshotTag::decode(value);
385 } 385 }
386 386
387 static bool IsCanonical(intptr_t value) { 387 static bool IsCanonical(intptr_t value) {
388 return CanonicalObjectTag::decode(value); 388 return CanonicalObjectTag::decode(value);
389 } 389 }
(...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1713 // Make sure this is updated when new TypedData types are added. 1713 // Make sure this is updated when new TypedData types are added.
1714 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 12); 1714 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 12);
1715 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 13); 1715 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 13);
1716 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 12); 1716 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 12);
1717 return (kNullCid - kTypedDataInt8ArrayCid); 1717 return (kNullCid - kTypedDataInt8ArrayCid);
1718 } 1718 }
1719 1719
1720 } // namespace dart 1720 } // namespace dart
1721 1721
1722 #endif // VM_RAW_OBJECT_H_ 1722 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/raw_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698