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/globals.h" | 9 #include "vm/globals.h" |
10 #include "vm/token.h" | 10 #include "vm/token.h" |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 RawType* super_type_; | 425 RawType* super_type_; |
426 RawFunction* signature_function_; // Associated function for signature class. | 426 RawFunction* signature_function_; // Associated function for signature class. |
427 RawArray* constants_; // Canonicalized values of this class. | 427 RawArray* constants_; // Canonicalized values of this class. |
428 RawArray* canonical_types_; // Canonicalized types of this class. | 428 RawArray* canonical_types_; // Canonicalized types of this class. |
429 RawCode* allocation_stub_; // Stub code for allocation of instances. | 429 RawCode* allocation_stub_; // Stub code for allocation of instances. |
430 RawObject** to() { | 430 RawObject** to() { |
431 return reinterpret_cast<RawObject**>(&ptr()->allocation_stub_); | 431 return reinterpret_cast<RawObject**>(&ptr()->allocation_stub_); |
432 } | 432 } |
433 | 433 |
434 cpp_vtable handle_vtable_; | 434 cpp_vtable handle_vtable_; |
435 intptr_t instance_size_; // Size if fixed length or 0 if variable length. | 435 intptr_t instance_size_in_words_; // Size if fixed len or 0 if variable len. |
436 intptr_t id_; // Class Id, also index in the class table. | 436 intptr_t id_; // Class Id, also index in the class table. |
437 intptr_t type_arguments_field_offset_; // Offset of the type arguments field. | 437 intptr_t type_arguments_field_offset_in_words_; // Offset of type args fld. |
438 intptr_t next_field_offset_; // Offset of the next instance field. | 438 intptr_t next_field_offset_in_words_; // Offset of the next instance field. |
439 intptr_t num_native_fields_; // Number of native fields in class. | 439 intptr_t num_native_fields_; // Number of native fields in class. |
440 intptr_t token_pos_; | 440 intptr_t token_pos_; |
441 uint8_t state_bits_; // state, is_const, is_interface, is_implemented. | 441 uint8_t state_bits_; // state, is_const, is_interface, is_implemented. |
442 | 442 |
443 friend class Instance; | 443 friend class Instance; |
444 friend class Object; | 444 friend class Object; |
445 friend class RawInstance; | 445 friend class RawInstance; |
446 friend class RawInstructions; | 446 friend class RawInstructions; |
447 friend class SnapshotReader; | 447 friend class SnapshotReader; |
448 }; | 448 }; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 }; | 595 }; |
596 | 596 |
597 | 597 |
598 class RawField : public RawObject { | 598 class RawField : public RawObject { |
599 RAW_HEAP_OBJECT_IMPLEMENTATION(Field); | 599 RAW_HEAP_OBJECT_IMPLEMENTATION(Field); |
600 | 600 |
601 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } | 601 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } |
602 RawString* name_; | 602 RawString* name_; |
603 RawClass* owner_; | 603 RawClass* owner_; |
604 RawAbstractType* type_; | 604 RawAbstractType* type_; |
605 RawInstance* value_; // Offset for instance and value for static fields. | 605 RawInstance* value_; // Offset in words for instance and value for static. |
606 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->value_); } | 606 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->value_); } |
607 | 607 |
608 intptr_t token_pos_; | 608 intptr_t token_pos_; |
609 uint8_t kind_bits_; // static, final, const, has initializer. | 609 uint8_t kind_bits_; // static, final, const, has initializer. |
610 }; | 610 }; |
611 | 611 |
612 | 612 |
613 class RawLiteralToken : public RawObject { | 613 class RawLiteralToken : public RawObject { |
614 RAW_HEAP_OBJECT_IMPLEMENTATION(LiteralToken); | 614 RAW_HEAP_OBJECT_IMPLEMENTATION(LiteralToken); |
615 | 615 |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1635 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 7 && | 1635 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 7 && |
1636 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 8 && | 1636 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 8 && |
1637 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 9 && | 1637 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 9 && |
1638 kStacktraceCid == kExternalInt8ArrayCid + 10); | 1638 kStacktraceCid == kExternalInt8ArrayCid + 10); |
1639 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid); | 1639 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid); |
1640 } | 1640 } |
1641 | 1641 |
1642 } // namespace dart | 1642 } // namespace dart |
1643 | 1643 |
1644 #endif // VM_RAW_OBJECT_H_ | 1644 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |