| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/assert.h" | 8 #include "vm/assert.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #include "vm/snapshot.h" | 10 #include "vm/snapshot.h" |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 RawString* url_; | 431 RawString* url_; |
| 432 RawString* source_; | 432 RawString* source_; |
| 433 RawTokenStream* tokens_; | 433 RawTokenStream* tokens_; |
| 434 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->tokens_); } | 434 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->tokens_); } |
| 435 | 435 |
| 436 Kind kind_; | 436 Kind kind_; |
| 437 }; | 437 }; |
| 438 | 438 |
| 439 | 439 |
| 440 class RawLibrary : public RawObject { | 440 class RawLibrary : public RawObject { |
| 441 enum LibraryState { |
| 442 kAllocated, // Initial state. |
| 443 kLoadInProgress, // Library is in the process of being loaded. |
| 444 kLoaded, // Library is loaded. |
| 445 kLoadError, // Error occurred during load of the Library. |
| 446 }; |
| 447 |
| 441 RAW_HEAP_OBJECT_IMPLEMENTATION(Library); | 448 RAW_HEAP_OBJECT_IMPLEMENTATION(Library); |
| 442 | 449 |
| 443 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } | 450 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } |
| 444 RawString* name_; | 451 RawString* name_; |
| 445 RawString* url_; | 452 RawString* url_; |
| 446 RawScript* script_; | 453 RawScript* script_; |
| 447 RawString* private_key_; | 454 RawString* private_key_; |
| 448 RawArray* dictionary_; // Top-level names in this library. | 455 RawArray* dictionary_; // Top-level names in this library. |
| 449 RawArray* anonymous_classes_; // Classes containing top-level elements. | 456 RawArray* anonymous_classes_; // Classes containing top-level elements. |
| 450 RawArray* imports_; // List of libraries imported without prefix. | 457 RawArray* imports_; // List of libraries imported without prefix. |
| 451 RawArray* imported_into_; // List of libraries where this library | 458 RawArray* imported_into_; // List of libraries where this library |
| 452 // is imported into without a prefix. | 459 // is imported into without a prefix. |
| 453 RawLibrary* next_registered_; // Linked list of registered libraries. | 460 RawLibrary* next_registered_; // Linked list of registered libraries. |
| 454 RawObject** to() { | 461 RawObject** to() { |
| 455 return reinterpret_cast<RawObject**>(&ptr()->next_registered_); | 462 return reinterpret_cast<RawObject**>(&ptr()->next_registered_); |
| 456 } | 463 } |
| 457 | 464 |
| 458 intptr_t num_imports_; // Number of entries in imports_. | 465 intptr_t num_imports_; // Number of entries in imports_. |
| 459 intptr_t num_imported_into_; // Number of entries in imported_into_. | 466 intptr_t num_imported_into_; // Number of entries in imported_into_. |
| 460 intptr_t num_anonymous_; // Number of entries in anonymous_classes_. | 467 intptr_t num_anonymous_; // Number of entries in anonymous_classes_. |
| 461 Dart_NativeEntryResolver native_entry_resolver_; // Resolves natives. | 468 Dart_NativeEntryResolver native_entry_resolver_; // Resolves natives. |
| 462 bool corelib_imported_; | 469 bool corelib_imported_; |
| 463 bool loaded_; | 470 int8_t load_state_; // Of type LibraryState. |
| 464 }; | 471 }; |
| 465 | 472 |
| 466 | 473 |
| 467 class RawLibraryPrefix : public RawObject { | 474 class RawLibraryPrefix : public RawObject { |
| 468 RAW_HEAP_OBJECT_IMPLEMENTATION(LibraryPrefix); | 475 RAW_HEAP_OBJECT_IMPLEMENTATION(LibraryPrefix); |
| 469 | 476 |
| 470 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } | 477 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } |
| 471 RawString* name_; // library prefix name. | 478 RawString* name_; // library prefix name. |
| 472 RawLibrary* library_; // library imported with a prefix. | 479 RawLibrary* library_; // library imported with a prefix. |
| 473 RawObject** to() { | 480 RawObject** to() { |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 intptr_t type_; // Uninitialized, simple or complex. | 776 intptr_t type_; // Uninitialized, simple or complex. |
| 770 intptr_t flags_; // Represents global/local, case insensitive, multiline. | 777 intptr_t flags_; // Represents global/local, case insensitive, multiline. |
| 771 | 778 |
| 772 // Variable length data follows here. | 779 // Variable length data follows here. |
| 773 uint8_t data_[0]; | 780 uint8_t data_[0]; |
| 774 }; | 781 }; |
| 775 | 782 |
| 776 } // namespace dart | 783 } // namespace dart |
| 777 | 784 |
| 778 #endif // VM_RAW_OBJECT_H_ | 785 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |