| 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 static bool ContainsPC(RawObject* raw_obj, uword pc); | 1095 static bool ContainsPC(RawObject* raw_obj, uword pc); |
| 1092 | 1096 |
| 1093 friend class RawCode; | 1097 friend class RawCode; |
| 1094 friend class RawFunction; | 1098 friend class RawFunction; |
| 1095 friend class Code; | 1099 friend class Code; |
| 1096 friend class StackFrame; | 1100 friend class StackFrame; |
| 1097 friend class MarkingVisitor; | 1101 friend class MarkingVisitor; |
| 1098 friend class SkippedCodeFunctions; | 1102 friend class SkippedCodeFunctions; |
| 1099 friend class Function; | 1103 friend class Function; |
| 1100 friend class InstructionsReader; | 1104 friend class InstructionsReader; |
| 1105 friend class InstructionsWriter; |
| 1101 }; | 1106 }; |
| 1102 | 1107 |
| 1103 | 1108 |
| 1104 class RawPcDescriptors : public RawObject { | 1109 class RawPcDescriptors : public RawObject { |
| 1105 public: | 1110 public: |
| 1106 enum Kind { | 1111 enum Kind { |
| 1107 kDeopt = 1, // Deoptimization continuation point. | 1112 kDeopt = 1, // Deoptimization continuation point. |
| 1108 kIcCall = kDeopt << 1, // IC call. | 1113 kIcCall = kDeopt << 1, // IC call. |
| 1109 kUnoptStaticCall = kIcCall << 1, // Call to a known target via stub. | 1114 kUnoptStaticCall = kIcCall << 1, // Call to a known target via stub. |
| 1110 kRuntimeCall = kUnoptStaticCall << 1, // Runtime call. | 1115 kRuntimeCall = kUnoptStaticCall << 1, // Runtime call. |
| (...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2224 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2229 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
| 2225 kTypedDataInt8ArrayViewCid + 15); | 2230 kTypedDataInt8ArrayViewCid + 15); |
| 2226 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2231 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
| 2227 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2232 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
| 2228 return (kNullCid - kTypedDataInt8ArrayCid); | 2233 return (kNullCid - kTypedDataInt8ArrayCid); |
| 2229 } | 2234 } |
| 2230 | 2235 |
| 2231 } // namespace dart | 2236 } // namespace dart |
| 2232 | 2237 |
| 2233 #endif // VM_RAW_OBJECT_H_ | 2238 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |