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/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 } | |
|
siva
2015/09/15 23:22:01
This is not used anymore I guess, it can be remove
rmacnak
2015/09/16 01:34:45
Done.
| |
| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 578 friend class RawExternalTypedData; | 584 friend class RawExternalTypedData; |
| 579 friend class RawInstructions; | 585 friend class RawInstructions; |
| 580 friend class RawInstance; | 586 friend class RawInstance; |
| 581 friend class RawTypedData; | 587 friend class RawTypedData; |
| 582 friend class Scavenger; | 588 friend class Scavenger; |
| 583 friend class ScavengerVisitor; | 589 friend class ScavengerVisitor; |
| 584 friend class SizeExcludingClassVisitor; // GetClassId | 590 friend class SizeExcludingClassVisitor; // GetClassId |
| 585 friend class RetainingPathVisitor; // GetClassId | 591 friend class RetainingPathVisitor; // GetClassId |
| 586 friend class SkippedCodeFunctions; // StorePointer | 592 friend class SkippedCodeFunctions; // StorePointer |
| 587 friend class InstructionsReader; // tags_ check | 593 friend class InstructionsReader; // tags_ check |
| 594 friend class InstructionsWriter; | |
| 588 friend class SnapshotReader; | 595 friend class SnapshotReader; |
| 589 friend class SnapshotWriter; | 596 friend class SnapshotWriter; |
| 590 friend class String; | 597 friend class String; |
| 591 friend class TypedData; | 598 friend class TypedData; |
| 592 friend class TypedDataView; | 599 friend class TypedDataView; |
| 593 friend class WeakProperty; // StorePointer | 600 friend class WeakProperty; // StorePointer |
| 594 friend class Instance; // StorePointer | 601 friend class Instance; // StorePointer |
| 595 | 602 |
| 596 DISALLOW_ALLOCATION(); | 603 DISALLOW_ALLOCATION(); |
| 597 DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject); | 604 DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject); |
| (...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2224 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2231 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
| 2225 kTypedDataInt8ArrayViewCid + 15); | 2232 kTypedDataInt8ArrayViewCid + 15); |
| 2226 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2233 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
| 2227 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2234 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
| 2228 return (kNullCid - kTypedDataInt8ArrayCid); | 2235 return (kNullCid - kTypedDataInt8ArrayCid); |
| 2229 } | 2236 } |
| 2230 | 2237 |
| 2231 } // namespace dart | 2238 } // namespace dart |
| 2232 | 2239 |
| 2233 #endif // VM_RAW_OBJECT_H_ | 2240 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |