| 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/atomic.h" | 9 #include "vm/atomic.h" |
| 10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 } | 369 } |
| 370 void ClearCanonical() { | 370 void ClearCanonical() { |
| 371 UpdateTagBit<CanonicalObjectTag>(false); | 371 UpdateTagBit<CanonicalObjectTag>(false); |
| 372 } | 372 } |
| 373 bool IsVMHeapObject() const { | 373 bool IsVMHeapObject() const { |
| 374 return VMHeapObjectTag::decode(ptr()->tags_); | 374 return VMHeapObjectTag::decode(ptr()->tags_); |
| 375 } | 375 } |
| 376 void SetVMHeapObject() { | 376 void SetVMHeapObject() { |
| 377 UpdateTagBit<VMHeapObjectTag>(true); | 377 UpdateTagBit<VMHeapObjectTag>(true); |
| 378 } | 378 } |
| 379 void ClearVMHeapObject() { |
| 380 UpdateTagBit<VMHeapObjectTag>(false); |
| 381 } |
| 379 | 382 |
| 380 // Support for GC remembered bit. | 383 // Support for GC remembered bit. |
| 381 bool IsRemembered() const { | 384 bool IsRemembered() const { |
| 382 return RememberedBit::decode(ptr()->tags_); | 385 return RememberedBit::decode(ptr()->tags_); |
| 383 } | 386 } |
| 384 void SetRememberedBit() { | 387 void SetRememberedBit() { |
| 385 ASSERT(!IsRemembered()); | 388 ASSERT(!IsRemembered()); |
| 386 UpdateTagBit<RememberedBit>(true); | 389 UpdateTagBit<RememberedBit>(true); |
| 387 } | 390 } |
| 388 void SetRememberedBitUnsynchronized() { | 391 void SetRememberedBitUnsynchronized() { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 403 } | 406 } |
| 404 bool IsFreeListElement() { | 407 bool IsFreeListElement() { |
| 405 return ((GetClassId() == kFreeListElement)); | 408 return ((GetClassId() == kFreeListElement)); |
| 406 } | 409 } |
| 407 bool IsScript() { | 410 bool IsScript() { |
| 408 return ((GetClassId() == kScriptCid)); | 411 return ((GetClassId() == kScriptCid)); |
| 409 } | 412 } |
| 410 bool IsFunction() { | 413 bool IsFunction() { |
| 411 return ((GetClassId() == kFunctionCid)); | 414 return ((GetClassId() == kFunctionCid)); |
| 412 } | 415 } |
| 416 bool IsInstructions() { |
| 417 return ((GetClassId() == kInstructionsCid)); |
| 418 } |
| 413 | 419 |
| 414 intptr_t Size() const { | 420 intptr_t Size() const { |
| 415 uword tags = ptr()->tags_; | 421 uword tags = ptr()->tags_; |
| 416 intptr_t result = SizeTag::decode(tags); | 422 intptr_t result = SizeTag::decode(tags); |
| 417 if (result != 0) { | 423 if (result != 0) { |
| 418 ASSERT(result == SizeFromClass()); | 424 ASSERT(result == SizeFromClass()); |
| 419 return result; | 425 return result; |
| 420 } | 426 } |
| 421 result = SizeFromClass(); | 427 result = SizeFromClass(); |
| 422 ASSERT(result > SizeTag::kMaxSizeTag); | 428 ASSERT(result > SizeTag::kMaxSizeTag); |
| (...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2224 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2230 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
| 2225 kTypedDataInt8ArrayViewCid + 15); | 2231 kTypedDataInt8ArrayViewCid + 15); |
| 2226 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2232 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
| 2227 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2233 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
| 2228 return (kNullCid - kTypedDataInt8ArrayCid); | 2234 return (kNullCid - kTypedDataInt8ArrayCid); |
| 2229 } | 2235 } |
| 2230 | 2236 |
| 2231 } // namespace dart | 2237 } // namespace dart |
| 2232 | 2238 |
| 2233 #endif // VM_RAW_OBJECT_H_ | 2239 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |