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