Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Side by Side Diff: runtime/vm/object.h

Issue 1955453002: - Use a map to lookup libraries by URL. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix precompiler handling. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 3614 matching lines...) Expand 10 before | Expand all | Expand 10 after
3625 3625
3626 RawError* Patch(const Script& script) const; 3626 RawError* Patch(const Script& script) const;
3627 3627
3628 RawString* PrivateName(const String& name) const; 3628 RawString* PrivateName(const String& name) const;
3629 3629
3630 intptr_t index() const { return raw_ptr()->index_; } 3630 intptr_t index() const { return raw_ptr()->index_; }
3631 void set_index(intptr_t value) const { 3631 void set_index(intptr_t value) const {
3632 StoreNonPointer(&raw_ptr()->index_, value); 3632 StoreNonPointer(&raw_ptr()->index_, value);
3633 } 3633 }
3634 3634
3635 void Register() const; 3635 void Register(Thread* thread) const;
3636 static void RegisterLibraries(Thread* thread,
3637 const GrowableObjectArray& libs);
3636 3638
3637 bool IsDebuggable() const { 3639 bool IsDebuggable() const {
3638 return raw_ptr()->debuggable_; 3640 return raw_ptr()->debuggable_;
3639 } 3641 }
3640 void set_debuggable(bool value) const { 3642 void set_debuggable(bool value) const {
3641 StoreNonPointer(&raw_ptr()->debuggable_, value); 3643 StoreNonPointer(&raw_ptr()->debuggable_, value);
3642 } 3644 }
3643 3645
3644 bool is_dart_scheme() const { 3646 bool is_dart_scheme() const {
3645 return raw_ptr()->is_dart_scheme_; 3647 return raw_ptr()->is_dart_scheme_;
3646 } 3648 }
3647 void set_is_dart_scheme(bool value) const { 3649 void set_is_dart_scheme(bool value) const {
3648 StoreNonPointer(&raw_ptr()->is_dart_scheme_, value); 3650 StoreNonPointer(&raw_ptr()->is_dart_scheme_, value);
3649 } 3651 }
3650 3652
3651 bool IsCoreLibrary() const { 3653 bool IsCoreLibrary() const {
3652 return raw() == CoreLibrary(); 3654 return raw() == CoreLibrary();
3653 } 3655 }
3654 3656
3655 inline intptr_t UrlHash() const; 3657 inline intptr_t UrlHash() const;
3656 3658
3657 static RawLibrary* LookupLibrary(const String& url); 3659 static RawLibrary* LookupLibrary(Thread* thread, const String& url);
3658 static RawLibrary* GetLibrary(intptr_t index); 3660 static RawLibrary* GetLibrary(intptr_t index);
3659 3661
3660 static void InitCoreLibrary(Isolate* isolate); 3662 static void InitCoreLibrary(Isolate* isolate);
3661 static void InitNativeWrappersLibrary(Isolate* isolate); 3663 static void InitNativeWrappersLibrary(Isolate* isolate);
3662 3664
3663 static RawLibrary* AsyncLibrary(); 3665 static RawLibrary* AsyncLibrary();
3664 static RawLibrary* ConvertLibrary(); 3666 static RawLibrary* ConvertLibrary();
3665 static RawLibrary* CoreLibrary(); 3667 static RawLibrary* CoreLibrary();
3666 static RawLibrary* CollectionLibrary(); 3668 static RawLibrary* CollectionLibrary();
3667 static RawLibrary* DeveloperLibrary(); 3669 static RawLibrary* DeveloperLibrary();
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
3731 bool LookupExportedNamesCache(const String& name, Object* obj) const; 3733 bool LookupExportedNamesCache(const String& name, Object* obj) const;
3732 void AddToExportedNamesCache(const String& name, const Object& obj) const; 3734 void AddToExportedNamesCache(const String& name, const Object& obj) const;
3733 3735
3734 3736
3735 void InitImportList() const; 3737 void InitImportList() const;
3736 void GrowDictionary(const Array& dict, intptr_t dict_size) const; 3738 void GrowDictionary(const Array& dict, intptr_t dict_size) const;
3737 static RawLibrary* NewLibraryHelper(const String& url, 3739 static RawLibrary* NewLibraryHelper(const String& url,
3738 bool import_core_lib); 3740 bool import_core_lib);
3739 RawObject* LookupEntry(const String& name, intptr_t *index) const; 3741 RawObject* LookupEntry(const String& name, intptr_t *index) const;
3740 3742
3741 static bool IsKeyUsed(intptr_t key);
3742 void AllocatePrivateKey() const; 3743 void AllocatePrivateKey() const;
3743 3744
3744 RawString* MakeMetadataName(const Object& obj) const; 3745 RawString* MakeMetadataName(const Object& obj) const;
3745 RawField* GetMetadataField(const String& metaname) const; 3746 RawField* GetMetadataField(const String& metaname) const;
3746 void AddMetadata(const Object& owner, 3747 void AddMetadata(const Object& owner,
3747 const String& name, 3748 const String& name,
3748 TokenPosition token_pos) const; 3749 TokenPosition token_pos) const;
3749 3750
3750 FINAL_HEAP_OBJECT_IMPLEMENTATION(Library, Object); 3751 FINAL_HEAP_OBJECT_IMPLEMENTATION(Library, Object);
3751 3752
(...skipping 4770 matching lines...) Expand 10 before | Expand all | Expand 10 after
8522 8523
8523 8524
8524 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 8525 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
8525 intptr_t index) { 8526 intptr_t index) {
8526 return array.At((index * kEntryLength) + kTargetFunctionIndex); 8527 return array.At((index * kEntryLength) + kTargetFunctionIndex);
8527 } 8528 }
8528 8529
8529 } // namespace dart 8530 } // namespace dart
8530 8531
8531 #endif // VM_OBJECT_H_ 8532 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698