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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 | 417 |
418 bool IsDartInstance() { | 418 bool IsDartInstance() { |
419 return (!IsHeapObject() || (GetClassId() >= kInstanceCid)); | 419 return (!IsHeapObject() || (GetClassId() >= kInstanceCid)); |
420 } | 420 } |
421 bool IsFreeListElement() { | 421 bool IsFreeListElement() { |
422 return ((GetClassId() == kFreeListElement)); | 422 return ((GetClassId() == kFreeListElement)); |
423 } | 423 } |
424 bool IsScript() { | 424 bool IsScript() { |
425 return ((GetClassId() == kScriptCid)); | 425 return ((GetClassId() == kScriptCid)); |
426 } | 426 } |
| 427 bool IsField() { |
| 428 return ((GetClassId() == kFieldCid)); |
| 429 } |
427 bool IsFunction() { | 430 bool IsFunction() { |
428 return ((GetClassId() == kFunctionCid)); | 431 return ((GetClassId() == kFunctionCid)); |
429 } | 432 } |
430 bool IsInstructions() { | 433 bool IsInstructions() { |
431 return ((GetClassId() == kInstructionsCid)); | 434 return ((GetClassId() == kInstructionsCid)); |
432 } | 435 } |
433 bool IsCode() { | 436 bool IsCode() { |
434 return ((GetClassId() == kCodeCid)); | 437 return ((GetClassId() == kCodeCid)); |
435 } | 438 } |
436 bool IsString() { | 439 bool IsString() { |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 } | 877 } |
875 }; | 878 }; |
876 | 879 |
877 | 880 |
878 class RawField : public RawObject { | 881 class RawField : public RawObject { |
879 RAW_HEAP_OBJECT_IMPLEMENTATION(Field); | 882 RAW_HEAP_OBJECT_IMPLEMENTATION(Field); |
880 | 883 |
881 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } | 884 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } |
882 RawString* name_; | 885 RawString* name_; |
883 RawObject* owner_; // Class or patch class or mixin class | 886 RawObject* owner_; // Class or patch class or mixin class |
884 // where this field is defined. | 887 // where this field is defined or original field. |
885 RawAbstractType* type_; | 888 RawAbstractType* type_; |
886 union { | 889 union { |
887 RawInstance* static_value_; // Value for static fields. | 890 RawInstance* static_value_; // Value for static fields. |
888 RawSmi* offset_; // Offset in words for instance fields. | 891 RawSmi* offset_; // Offset in words for instance fields. |
889 } value_; | 892 } value_; |
890 union { | 893 union { |
891 // When precompiling we need to save the static initializer function here | 894 // When precompiling we need to save the static initializer function here |
892 // so that code for it can be generated. | 895 // so that code for it can be generated. |
893 RawFunction* precompiled_; // Static initializer function - precompiling. | 896 RawFunction* precompiled_; // Static initializer function - precompiling. |
894 // When generating script snapshots after running the application it is | 897 // When generating script snapshots after running the application it is |
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2352 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2355 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2353 kTypedDataInt8ArrayViewCid + 15); | 2356 kTypedDataInt8ArrayViewCid + 15); |
2354 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2357 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2355 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2358 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2356 return (kNullCid - kTypedDataInt8ArrayCid); | 2359 return (kNullCid - kTypedDataInt8ArrayCid); |
2357 } | 2360 } |
2358 | 2361 |
2359 } // namespace dart | 2362 } // namespace dart |
2360 | 2363 |
2361 #endif // VM_RAW_OBJECT_H_ | 2364 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |