Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 340 void SetRememberedBit() { | 340 void SetRememberedBit() { |
| 341 ASSERT(!IsRemembered()); | 341 ASSERT(!IsRemembered()); |
| 342 uword tags = ptr()->tags_; | 342 uword tags = ptr()->tags_; |
| 343 ptr()->tags_ = RememberedBit::update(true, tags); | 343 ptr()->tags_ = RememberedBit::update(true, tags); |
| 344 } | 344 } |
| 345 void ClearRememberedBit() { | 345 void ClearRememberedBit() { |
| 346 uword tags = ptr()->tags_; | 346 uword tags = ptr()->tags_; |
| 347 ptr()->tags_ = RememberedBit::update(false, tags); | 347 ptr()->tags_ = RememberedBit::update(false, tags); |
| 348 } | 348 } |
| 349 | 349 |
| 350 bool IsRawClass() { | |
|
rmacnak
2013/09/19 00:46:04
Will remove before commit, just here to demonstrat
| |
| 351 return IsHeapObject() && (GetClassId() == kClassCid); | |
| 352 } | |
| 353 | |
| 350 bool IsDartInstance() { | 354 bool IsDartInstance() { |
| 351 return (!IsHeapObject() || (GetClassId() >= kInstanceCid)); | 355 return (!IsHeapObject() || (GetClassId() >= kInstanceCid)); |
| 352 } | 356 } |
| 353 bool IsFreeListElement() { | 357 bool IsFreeListElement() { |
| 354 return ((GetClassId() == kFreeListElement)); | 358 return ((GetClassId() == kFreeListElement)); |
| 355 } | 359 } |
| 356 | 360 |
| 357 intptr_t Size() const { | 361 intptr_t Size() const { |
| 358 uword tags = ptr()->tags_; | 362 uword tags = ptr()->tags_; |
| 359 intptr_t result = SizeTag::decode(tags); | 363 intptr_t result = SizeTag::decode(tags); |
| (...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1711 // Make sure this is updated when new TypedData types are added. | 1715 // Make sure this is updated when new TypedData types are added. |
| 1712 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 12); | 1716 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 12); |
| 1713 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 13); | 1717 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 13); |
| 1714 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 12); | 1718 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 12); |
| 1715 return (kNullCid - kTypedDataInt8ArrayCid); | 1719 return (kNullCid - kTypedDataInt8ArrayCid); |
| 1716 } | 1720 } |
| 1717 | 1721 |
| 1718 } // namespace dart | 1722 } // namespace dart |
| 1719 | 1723 |
| 1720 #endif // VM_RAW_OBJECT_H_ | 1724 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |