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 3615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3626 | 3626 |
3627 RawError* Patch(const Script& script) const; | 3627 RawError* Patch(const Script& script) const; |
3628 | 3628 |
3629 RawString* PrivateName(const String& name) const; | 3629 RawString* PrivateName(const String& name) const; |
3630 | 3630 |
3631 intptr_t index() const { return raw_ptr()->index_; } | 3631 intptr_t index() const { return raw_ptr()->index_; } |
3632 void set_index(intptr_t value) const { | 3632 void set_index(intptr_t value) const { |
3633 StoreNonPointer(&raw_ptr()->index_, value); | 3633 StoreNonPointer(&raw_ptr()->index_, value); |
3634 } | 3634 } |
3635 | 3635 |
3636 void Register() const; | 3636 void Register(Thread* thread) const; |
| 3637 static void RegisterLibraries(Thread* thread, |
| 3638 const GrowableObjectArray& libs); |
3637 | 3639 |
3638 bool IsDebuggable() const { | 3640 bool IsDebuggable() const { |
3639 return raw_ptr()->debuggable_; | 3641 return raw_ptr()->debuggable_; |
3640 } | 3642 } |
3641 void set_debuggable(bool value) const { | 3643 void set_debuggable(bool value) const { |
3642 StoreNonPointer(&raw_ptr()->debuggable_, value); | 3644 StoreNonPointer(&raw_ptr()->debuggable_, value); |
3643 } | 3645 } |
3644 | 3646 |
3645 bool is_dart_scheme() const { | 3647 bool is_dart_scheme() const { |
3646 return raw_ptr()->is_dart_scheme_; | 3648 return raw_ptr()->is_dart_scheme_; |
3647 } | 3649 } |
3648 void set_is_dart_scheme(bool value) const { | 3650 void set_is_dart_scheme(bool value) const { |
3649 StoreNonPointer(&raw_ptr()->is_dart_scheme_, value); | 3651 StoreNonPointer(&raw_ptr()->is_dart_scheme_, value); |
3650 } | 3652 } |
3651 | 3653 |
3652 bool IsCoreLibrary() const { | 3654 bool IsCoreLibrary() const { |
3653 return raw() == CoreLibrary(); | 3655 return raw() == CoreLibrary(); |
3654 } | 3656 } |
3655 | 3657 |
3656 inline intptr_t UrlHash() const; | 3658 inline intptr_t UrlHash() const; |
3657 | 3659 |
3658 static RawLibrary* LookupLibrary(const String& url); | 3660 static RawLibrary* LookupLibrary(Thread* thread, const String& url); |
3659 static RawLibrary* GetLibrary(intptr_t index); | 3661 static RawLibrary* GetLibrary(intptr_t index); |
3660 | 3662 |
3661 static void InitCoreLibrary(Isolate* isolate); | 3663 static void InitCoreLibrary(Isolate* isolate); |
3662 static void InitNativeWrappersLibrary(Isolate* isolate); | 3664 static void InitNativeWrappersLibrary(Isolate* isolate); |
3663 | 3665 |
3664 static RawLibrary* AsyncLibrary(); | 3666 static RawLibrary* AsyncLibrary(); |
3665 static RawLibrary* ConvertLibrary(); | 3667 static RawLibrary* ConvertLibrary(); |
3666 static RawLibrary* CoreLibrary(); | 3668 static RawLibrary* CoreLibrary(); |
3667 static RawLibrary* CollectionLibrary(); | 3669 static RawLibrary* CollectionLibrary(); |
3668 static RawLibrary* DeveloperLibrary(); | 3670 static RawLibrary* DeveloperLibrary(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3732 bool LookupExportedNamesCache(const String& name, Object* obj) const; | 3734 bool LookupExportedNamesCache(const String& name, Object* obj) const; |
3733 void AddToExportedNamesCache(const String& name, const Object& obj) const; | 3735 void AddToExportedNamesCache(const String& name, const Object& obj) const; |
3734 | 3736 |
3735 | 3737 |
3736 void InitImportList() const; | 3738 void InitImportList() const; |
3737 void GrowDictionary(const Array& dict, intptr_t dict_size) const; | 3739 void GrowDictionary(const Array& dict, intptr_t dict_size) const; |
3738 static RawLibrary* NewLibraryHelper(const String& url, | 3740 static RawLibrary* NewLibraryHelper(const String& url, |
3739 bool import_core_lib); | 3741 bool import_core_lib); |
3740 RawObject* LookupEntry(const String& name, intptr_t *index) const; | 3742 RawObject* LookupEntry(const String& name, intptr_t *index) const; |
3741 | 3743 |
3742 static bool IsKeyUsed(intptr_t key); | |
3743 void AllocatePrivateKey() const; | 3744 void AllocatePrivateKey() const; |
3744 | 3745 |
3745 RawString* MakeMetadataName(const Object& obj) const; | 3746 RawString* MakeMetadataName(const Object& obj) const; |
3746 RawField* GetMetadataField(const String& metaname) const; | 3747 RawField* GetMetadataField(const String& metaname) const; |
3747 void AddMetadata(const Object& owner, | 3748 void AddMetadata(const Object& owner, |
3748 const String& name, | 3749 const String& name, |
3749 TokenPosition token_pos) const; | 3750 TokenPosition token_pos) const; |
3750 | 3751 |
3751 FINAL_HEAP_OBJECT_IMPLEMENTATION(Library, Object); | 3752 FINAL_HEAP_OBJECT_IMPLEMENTATION(Library, Object); |
3752 | 3753 |
(...skipping 4770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8523 | 8524 |
8524 | 8525 |
8525 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 8526 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
8526 intptr_t index) { | 8527 intptr_t index) { |
8527 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 8528 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
8528 } | 8529 } |
8529 | 8530 |
8530 } // namespace dart | 8531 } // namespace dart |
8531 | 8532 |
8532 #endif // VM_OBJECT_H_ | 8533 #endif // VM_OBJECT_H_ |
OLD | NEW |