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_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 | 465 |
466 static const LanguageError& branch_offset_error() { | 466 static const LanguageError& branch_offset_error() { |
467 ASSERT(branch_offset_error_ != NULL); | 467 ASSERT(branch_offset_error_ != NULL); |
468 return *branch_offset_error_; | 468 return *branch_offset_error_; |
469 } | 469 } |
470 | 470 |
471 static const Array& vm_isolate_snapshot_object_table() { | 471 static const Array& vm_isolate_snapshot_object_table() { |
472 ASSERT(vm_isolate_snapshot_object_table_ != NULL); | 472 ASSERT(vm_isolate_snapshot_object_table_ != NULL); |
473 return *vm_isolate_snapshot_object_table_; | 473 return *vm_isolate_snapshot_object_table_; |
474 } | 474 } |
| 475 static const Type& dynamic_type() { |
| 476 ASSERT(dynamic_type_ != NULL); |
| 477 return *dynamic_type_; |
| 478 } |
| 479 static const Type& void_type() { |
| 480 ASSERT(void_type_ != NULL); |
| 481 return *void_type_; |
| 482 } |
| 483 |
475 static void InitVmIsolateSnapshotObjectTable(intptr_t len); | 484 static void InitVmIsolateSnapshotObjectTable(intptr_t len); |
476 | 485 |
477 static RawClass* class_class() { return class_class_; } | 486 static RawClass* class_class() { return class_class_; } |
478 static RawClass* dynamic_class() { return dynamic_class_; } | 487 static RawClass* dynamic_class() { return dynamic_class_; } |
479 static RawClass* void_class() { return void_class_; } | 488 static RawClass* void_class() { return void_class_; } |
480 static RawType* dynamic_type() { return dynamic_type_; } | |
481 static RawType* void_type() { return void_type_; } | |
482 static RawClass* unresolved_class_class() { return unresolved_class_class_; } | 489 static RawClass* unresolved_class_class() { return unresolved_class_class_; } |
483 static RawClass* type_arguments_class() { return type_arguments_class_; } | 490 static RawClass* type_arguments_class() { return type_arguments_class_; } |
484 static RawClass* patch_class_class() { return patch_class_class_; } | 491 static RawClass* patch_class_class() { return patch_class_class_; } |
485 static RawClass* function_class() { return function_class_; } | 492 static RawClass* function_class() { return function_class_; } |
486 static RawClass* closure_data_class() { return closure_data_class_; } | 493 static RawClass* closure_data_class() { return closure_data_class_; } |
487 static RawClass* redirection_data_class() { return redirection_data_class_; } | 494 static RawClass* redirection_data_class() { return redirection_data_class_; } |
488 static RawClass* field_class() { return field_class_; } | 495 static RawClass* field_class() { return field_class_; } |
489 static RawClass* literal_token_class() { return literal_token_class_; } | 496 static RawClass* literal_token_class() { return literal_token_class_; } |
490 static RawClass* token_stream_class() { return token_stream_class_; } | 497 static RawClass* token_stream_class() { return token_stream_class_; } |
491 static RawClass* script_class() { return script_class_; } | 498 static RawClass* script_class() { return script_class_; } |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 static cpp_vtable handle_vtable_; | 740 static cpp_vtable handle_vtable_; |
734 static cpp_vtable builtin_vtables_[kNumPredefinedCids]; | 741 static cpp_vtable builtin_vtables_[kNumPredefinedCids]; |
735 | 742 |
736 // The static values below are singletons shared between the different | 743 // The static values below are singletons shared between the different |
737 // isolates. They are all allocated in the non-GC'd Dart::vm_isolate_. | 744 // isolates. They are all allocated in the non-GC'd Dart::vm_isolate_. |
738 static RawObject* null_; | 745 static RawObject* null_; |
739 | 746 |
740 static RawClass* class_class_; // Class of the Class vm object. | 747 static RawClass* class_class_; // Class of the Class vm object. |
741 static RawClass* dynamic_class_; // Class of the 'dynamic' type. | 748 static RawClass* dynamic_class_; // Class of the 'dynamic' type. |
742 static RawClass* void_class_; // Class of the 'void' type. | 749 static RawClass* void_class_; // Class of the 'void' type. |
743 static RawType* dynamic_type_; // Class of the 'dynamic' type. | |
744 static RawType* void_type_; // Class of the 'void' type. | |
745 static RawClass* unresolved_class_class_; // Class of UnresolvedClass. | 750 static RawClass* unresolved_class_class_; // Class of UnresolvedClass. |
746 static RawClass* type_arguments_class_; // Class of TypeArguments vm object. | 751 static RawClass* type_arguments_class_; // Class of TypeArguments vm object. |
747 static RawClass* patch_class_class_; // Class of the PatchClass vm object. | 752 static RawClass* patch_class_class_; // Class of the PatchClass vm object. |
748 static RawClass* function_class_; // Class of the Function vm object. | 753 static RawClass* function_class_; // Class of the Function vm object. |
749 static RawClass* closure_data_class_; // Class of ClosureData vm obj. | 754 static RawClass* closure_data_class_; // Class of ClosureData vm obj. |
750 static RawClass* redirection_data_class_; // Class of RedirectionData vm obj. | 755 static RawClass* redirection_data_class_; // Class of RedirectionData vm obj. |
751 static RawClass* field_class_; // Class of the Field vm object. | 756 static RawClass* field_class_; // Class of the Field vm object. |
752 static RawClass* literal_token_class_; // Class of LiteralToken vm object. | 757 static RawClass* literal_token_class_; // Class of LiteralToken vm object. |
753 static RawClass* token_stream_class_; // Class of the TokenStream vm object. | 758 static RawClass* token_stream_class_; // Class of the TokenStream vm object. |
754 static RawClass* script_class_; // Class of the Script vm object. | 759 static RawClass* script_class_; // Class of the Script vm object. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 static Instance* sentinel_; | 796 static Instance* sentinel_; |
792 static Instance* transition_sentinel_; | 797 static Instance* transition_sentinel_; |
793 static Instance* unknown_constant_; | 798 static Instance* unknown_constant_; |
794 static Instance* non_constant_; | 799 static Instance* non_constant_; |
795 static Bool* bool_true_; | 800 static Bool* bool_true_; |
796 static Bool* bool_false_; | 801 static Bool* bool_false_; |
797 static Smi* smi_illegal_cid_; | 802 static Smi* smi_illegal_cid_; |
798 static LanguageError* snapshot_writer_error_; | 803 static LanguageError* snapshot_writer_error_; |
799 static LanguageError* branch_offset_error_; | 804 static LanguageError* branch_offset_error_; |
800 static Array* vm_isolate_snapshot_object_table_; | 805 static Array* vm_isolate_snapshot_object_table_; |
| 806 static Type* dynamic_type_; |
| 807 static Type* void_type_; |
801 | 808 |
802 friend void ClassTable::Register(const Class& cls); | 809 friend void ClassTable::Register(const Class& cls); |
803 friend void RawObject::Validate(Isolate* isolate) const; | 810 friend void RawObject::Validate(Isolate* isolate) const; |
804 friend class Closure; | 811 friend class Closure; |
805 friend class SnapshotReader; | 812 friend class SnapshotReader; |
806 friend class OneByteString; | 813 friend class OneByteString; |
807 friend class TwoByteString; | 814 friend class TwoByteString; |
808 friend class ExternalOneByteString; | 815 friend class ExternalOneByteString; |
809 friend class ExternalTwoByteString; | 816 friend class ExternalTwoByteString; |
810 friend class Thread; | 817 friend class Thread; |
(...skipping 7355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8166 | 8173 |
8167 | 8174 |
8168 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 8175 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
8169 intptr_t index) { | 8176 intptr_t index) { |
8170 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 8177 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
8171 } | 8178 } |
8172 | 8179 |
8173 } // namespace dart | 8180 } // namespace dart |
8174 | 8181 |
8175 #endif // VM_OBJECT_H_ | 8182 #endif // VM_OBJECT_H_ |
OLD | NEW |