| 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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 } | 403 } |
| 404 bool IsFreeListElement() { | 404 bool IsFreeListElement() { |
| 405 return ((GetClassId() == kFreeListElement)); | 405 return ((GetClassId() == kFreeListElement)); |
| 406 } | 406 } |
| 407 bool IsScript() { | 407 bool IsScript() { |
| 408 return ((GetClassId() == kScriptCid)); | 408 return ((GetClassId() == kScriptCid)); |
| 409 } | 409 } |
| 410 bool IsFunction() { | 410 bool IsFunction() { |
| 411 return ((GetClassId() == kFunctionCid)); | 411 return ((GetClassId() == kFunctionCid)); |
| 412 } | 412 } |
| 413 bool IsInstructions() { |
| 414 return ((GetClassId() == kInstructionsCid)); |
| 415 } |
| 413 | 416 |
| 414 intptr_t Size() const { | 417 intptr_t Size() const { |
| 415 uword tags = ptr()->tags_; | 418 uword tags = ptr()->tags_; |
| 416 intptr_t result = SizeTag::decode(tags); | 419 intptr_t result = SizeTag::decode(tags); |
| 417 if (result != 0) { | 420 if (result != 0) { |
| 418 ASSERT(result == SizeFromClass()); | 421 ASSERT(result == SizeFromClass()); |
| 419 return result; | 422 return result; |
| 420 } | 423 } |
| 421 result = SizeFromClass(); | 424 result = SizeFromClass(); |
| 422 ASSERT(result > SizeTag::kMaxSizeTag); | 425 ASSERT(result > SizeTag::kMaxSizeTag); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 friend class RawExternalTypedData; | 581 friend class RawExternalTypedData; |
| 579 friend class RawInstructions; | 582 friend class RawInstructions; |
| 580 friend class RawInstance; | 583 friend class RawInstance; |
| 581 friend class RawTypedData; | 584 friend class RawTypedData; |
| 582 friend class Scavenger; | 585 friend class Scavenger; |
| 583 friend class ScavengerVisitor; | 586 friend class ScavengerVisitor; |
| 584 friend class SizeExcludingClassVisitor; // GetClassId | 587 friend class SizeExcludingClassVisitor; // GetClassId |
| 585 friend class RetainingPathVisitor; // GetClassId | 588 friend class RetainingPathVisitor; // GetClassId |
| 586 friend class SkippedCodeFunctions; // StorePointer | 589 friend class SkippedCodeFunctions; // StorePointer |
| 587 friend class InstructionsReader; // tags_ check | 590 friend class InstructionsReader; // tags_ check |
| 591 friend class InstructionsWriter; |
| 588 friend class SnapshotReader; | 592 friend class SnapshotReader; |
| 589 friend class SnapshotWriter; | 593 friend class SnapshotWriter; |
| 590 friend class String; | 594 friend class String; |
| 591 friend class TypedData; | 595 friend class TypedData; |
| 592 friend class TypedDataView; | 596 friend class TypedDataView; |
| 593 friend class WeakProperty; // StorePointer | 597 friend class WeakProperty; // StorePointer |
| 594 friend class Instance; // StorePointer | 598 friend class Instance; // StorePointer |
| 595 | 599 |
| 596 DISALLOW_ALLOCATION(); | 600 DISALLOW_ALLOCATION(); |
| 597 DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject); | 601 DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject); |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 static bool ContainsPC(RawObject* raw_obj, uword pc); | 1097 static bool ContainsPC(RawObject* raw_obj, uword pc); |
| 1094 | 1098 |
| 1095 friend class RawCode; | 1099 friend class RawCode; |
| 1096 friend class RawFunction; | 1100 friend class RawFunction; |
| 1097 friend class Code; | 1101 friend class Code; |
| 1098 friend class StackFrame; | 1102 friend class StackFrame; |
| 1099 friend class MarkingVisitor; | 1103 friend class MarkingVisitor; |
| 1100 friend class SkippedCodeFunctions; | 1104 friend class SkippedCodeFunctions; |
| 1101 friend class Function; | 1105 friend class Function; |
| 1102 friend class InstructionsReader; | 1106 friend class InstructionsReader; |
| 1107 friend class InstructionsWriter; |
| 1103 }; | 1108 }; |
| 1104 | 1109 |
| 1105 | 1110 |
| 1106 class RawPcDescriptors : public RawObject { | 1111 class RawPcDescriptors : public RawObject { |
| 1107 public: | 1112 public: |
| 1108 enum Kind { | 1113 enum Kind { |
| 1109 kDeopt = 1, // Deoptimization continuation point. | 1114 kDeopt = 1, // Deoptimization continuation point. |
| 1110 kIcCall = kDeopt << 1, // IC call. | 1115 kIcCall = kDeopt << 1, // IC call. |
| 1111 kUnoptStaticCall = kIcCall << 1, // Call to a known target via stub. | 1116 kUnoptStaticCall = kIcCall << 1, // Call to a known target via stub. |
| 1112 kRuntimeCall = kUnoptStaticCall << 1, // Runtime call. | 1117 kRuntimeCall = kUnoptStaticCall << 1, // Runtime call. |
| (...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2226 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2231 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
| 2227 kTypedDataInt8ArrayViewCid + 15); | 2232 kTypedDataInt8ArrayViewCid + 15); |
| 2228 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2233 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
| 2229 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2234 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
| 2230 return (kNullCid - kTypedDataInt8ArrayCid); | 2235 return (kNullCid - kTypedDataInt8ArrayCid); |
| 2231 } | 2236 } |
| 2232 | 2237 |
| 2233 } // namespace dart | 2238 } // namespace dart |
| 2234 | 2239 |
| 2235 #endif // VM_RAW_OBJECT_H_ | 2240 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |