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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 | 734 |
735 class RawPatchClass : public RawObject { | 735 class RawPatchClass : public RawObject { |
736 private: | 736 private: |
737 RAW_HEAP_OBJECT_IMPLEMENTATION(PatchClass); | 737 RAW_HEAP_OBJECT_IMPLEMENTATION(PatchClass); |
738 | 738 |
739 RawObject** from() { | 739 RawObject** from() { |
740 return reinterpret_cast<RawObject**>(&ptr()->patched_class_); | 740 return reinterpret_cast<RawObject**>(&ptr()->patched_class_); |
741 } | 741 } |
742 RawClass* patched_class_; | 742 RawClass* patched_class_; |
743 RawClass* source_class_; | 743 RawClass* source_class_; |
| 744 RawScript* script_; |
744 RawObject** to() { | 745 RawObject** to() { |
745 return reinterpret_cast<RawObject**>(&ptr()->source_class_); | 746 return reinterpret_cast<RawObject**>(&ptr()->script_); |
746 } | 747 } |
747 | 748 |
748 friend class Function; | 749 friend class Function; |
749 }; | 750 }; |
750 | 751 |
751 | 752 |
752 class RawFunction : public RawObject { | 753 class RawFunction : public RawObject { |
753 public: | 754 public: |
754 enum Kind { | 755 enum Kind { |
755 kRegularFunction, | 756 kRegularFunction, |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 | 971 |
971 RAW_HEAP_OBJECT_IMPLEMENTATION(Library); | 972 RAW_HEAP_OBJECT_IMPLEMENTATION(Library); |
972 | 973 |
973 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } | 974 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } |
974 RawString* name_; | 975 RawString* name_; |
975 RawString* url_; | 976 RawString* url_; |
976 RawScript* script_; | 977 RawScript* script_; |
977 RawString* private_key_; | 978 RawString* private_key_; |
978 RawArray* dictionary_; // Top-level names in this library. | 979 RawArray* dictionary_; // Top-level names in this library. |
979 RawGrowableObjectArray* metadata_; // Metadata on classes, methods etc. | 980 RawGrowableObjectArray* metadata_; // Metadata on classes, methods etc. |
980 RawArray* anonymous_classes_; // Classes containing top-level elements. | 981 RawClass* toplevel_class_; // Class containing top-level elements. |
981 RawGrowableObjectArray* patch_classes_; | 982 RawGrowableObjectArray* patch_classes_; |
982 RawArray* imports_; // List of Namespaces imported without prefix. | 983 RawArray* imports_; // List of Namespaces imported without prefix. |
983 RawArray* exports_; // List of re-exported Namespaces. | 984 RawArray* exports_; // List of re-exported Namespaces. |
984 RawInstance* load_error_; // Error iff load_state_ == kLoadError. | 985 RawInstance* load_error_; // Error iff load_state_ == kLoadError. |
985 RawObject** to_snapshot() { | 986 RawObject** to_snapshot() { |
986 return reinterpret_cast<RawObject**>(&ptr()->load_error_); | 987 return reinterpret_cast<RawObject**>(&ptr()->load_error_); |
987 } | 988 } |
988 RawArray* resolved_names_; // Cache of resolved names in library scope. | 989 RawArray* resolved_names_; // Cache of resolved names in library scope. |
989 RawArray* loaded_scripts_; // Array of scripts loaded in this library. | 990 RawArray* loaded_scripts_; // Array of scripts loaded in this library. |
990 RawObject** to() { | 991 RawObject** to() { |
991 return reinterpret_cast<RawObject**>(&ptr()->loaded_scripts_); | 992 return reinterpret_cast<RawObject**>(&ptr()->loaded_scripts_); |
992 } | 993 } |
993 | 994 |
994 Dart_NativeEntryResolver native_entry_resolver_; // Resolves natives. | 995 Dart_NativeEntryResolver native_entry_resolver_; // Resolves natives. |
995 Dart_NativeEntrySymbol native_entry_symbol_resolver_; | 996 Dart_NativeEntrySymbol native_entry_symbol_resolver_; |
996 classid_t index_; // Library id number. | 997 classid_t index_; // Library id number. |
997 classid_t num_anonymous_; // Number of entries in anonymous_classes_. | |
998 uint16_t num_imports_; // Number of entries in imports_. | 998 uint16_t num_imports_; // Number of entries in imports_. |
999 int8_t load_state_; // Of type LibraryState. | 999 int8_t load_state_; // Of type LibraryState. |
1000 bool corelib_imported_; | 1000 bool corelib_imported_; |
1001 bool is_dart_scheme_; | 1001 bool is_dart_scheme_; |
1002 bool debuggable_; // True if debugger can stop in library. | 1002 bool debuggable_; // True if debugger can stop in library. |
1003 bool is_in_fullsnapshot_; // True if library is in a full snapshot. | 1003 bool is_in_fullsnapshot_; // True if library is in a full snapshot. |
1004 | 1004 |
1005 friend class Class; | 1005 friend class Class; |
1006 friend class Isolate; | 1006 friend class Isolate; |
1007 }; | 1007 }; |
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2265 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2265 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2266 kTypedDataInt8ArrayViewCid + 15); | 2266 kTypedDataInt8ArrayViewCid + 15); |
2267 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2267 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2268 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2268 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2269 return (kNullCid - kTypedDataInt8ArrayCid); | 2269 return (kNullCid - kTypedDataInt8ArrayCid); |
2270 } | 2270 } |
2271 | 2271 |
2272 } // namespace dart | 2272 } // namespace dart |
2273 | 2273 |
2274 #endif // VM_RAW_OBJECT_H_ | 2274 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |