| 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 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1701 | 1701 |
| 1702 static RawLibrary* New(const String& url); | 1702 static RawLibrary* New(const String& url); |
| 1703 | 1703 |
| 1704 // Library scope name dictionary. | 1704 // Library scope name dictionary. |
| 1705 void AddClass(const Class& cls) const; | 1705 void AddClass(const Class& cls) const; |
| 1706 void AddObject(const Object& obj, const String& name) const; | 1706 void AddObject(const Object& obj, const String& name) const; |
| 1707 RawObject* LookupObject(const String& name) const; | 1707 RawObject* LookupObject(const String& name) const; |
| 1708 RawClass* LookupClass(const String& name) const; | 1708 RawClass* LookupClass(const String& name) const; |
| 1709 RawObject* LookupLocalObject(const String& name) const; | 1709 RawObject* LookupLocalObject(const String& name) const; |
| 1710 RawClass* LookupLocalClass(const String& name) const; | 1710 RawClass* LookupLocalClass(const String& name) const; |
| 1711 RawLibraryPrefix* LookupLocalLibraryPrefix(const String& name) const; |
| 1711 RawScript* LookupScript(const String& url) const; | 1712 RawScript* LookupScript(const String& url) const; |
| 1712 RawArray* LoadedScripts() const; | 1713 RawArray* LoadedScripts() const; |
| 1713 | 1714 |
| 1714 void AddAnonymousClass(const Class& cls) const; | 1715 void AddAnonymousClass(const Class& cls) const; |
| 1715 | 1716 |
| 1716 // Library imports. | 1717 // Library imports. |
| 1717 RawString* LookupImportMap(const String& name) const; | 1718 RawString* LookupImportMap(const String& name) const; |
| 1718 void AddImport(const Library& library) const; | 1719 void AddImport(const Library& library) const; |
| 1719 RawLibrary* LookupImport(const String& url) const; | 1720 RawLibrary* LookupImport(const String& url) const; |
| 1720 | 1721 |
| 1721 RawFunction* LookupFunctionInSource(const String& script_url, | 1722 RawFunction* LookupFunctionInSource(const String& script_url, |
| 1722 intptr_t line_number) const; | 1723 intptr_t line_number) const; |
| 1723 RawFunction* LookupFunctionInScript(const Script& script, | 1724 RawFunction* LookupFunctionInScript(const Script& script, |
| 1724 intptr_t token_index) const; | 1725 intptr_t token_index) const; |
| 1725 | 1726 |
| 1726 // Resolving native methods for script loaded in the library. | 1727 // Resolving native methods for script loaded in the library. |
| 1727 Dart_NativeEntryResolver native_entry_resolver() const { | 1728 Dart_NativeEntryResolver native_entry_resolver() const { |
| 1728 return raw_ptr()->native_entry_resolver_; | 1729 return raw_ptr()->native_entry_resolver_; |
| 1729 } | 1730 } |
| 1730 void set_native_entry_resolver(Dart_NativeEntryResolver value) const { | 1731 void set_native_entry_resolver(Dart_NativeEntryResolver value) const { |
| 1731 raw_ptr()->native_entry_resolver_ = value; | 1732 raw_ptr()->native_entry_resolver_ = value; |
| 1732 } | 1733 } |
| 1733 | 1734 |
| 1734 RawString* PrivateName(const char* name); | 1735 RawString* PrivateName(const char* name); |
| 1735 | 1736 |
| 1736 void Register() const; | 1737 void Register() const; |
| 1737 | 1738 |
| 1738 RawLibrary* next_registered() const { return raw_ptr()->next_registered_; } | 1739 RawLibrary* next_registered() const { return raw_ptr()->next_registered_; } |
| 1739 | 1740 |
| 1741 RawString* DuplicateDefineErrorString(const String& entry_name, |
| 1742 const Library& conflicting_lib) const; |
| 1740 static RawLibrary* LookupLibrary(const String& url); | 1743 static RawLibrary* LookupLibrary(const String& url); |
| 1741 static RawString* CheckForDuplicateDefinition(); | 1744 static RawString* CheckForDuplicateDefinition(); |
| 1742 static bool IsKeyUsed(intptr_t key); | 1745 static bool IsKeyUsed(intptr_t key); |
| 1743 | 1746 |
| 1744 static void InitCoreLibrary(Isolate* isolate); | 1747 static void InitCoreLibrary(Isolate* isolate); |
| 1745 static RawLibrary* CoreLibrary(); | 1748 static RawLibrary* CoreLibrary(); |
| 1746 static RawLibrary* CoreImplLibrary(); | 1749 static RawLibrary* CoreImplLibrary(); |
| 1747 static void InitNativeWrappersLibrary(Isolate* isolate); | 1750 static void InitNativeWrappersLibrary(Isolate* isolate); |
| 1748 static RawLibrary* NativeWrappersLibrary(); | 1751 static RawLibrary* NativeWrappersLibrary(); |
| 1749 | 1752 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1772 void InitClassDictionary() const; | 1775 void InitClassDictionary() const; |
| 1773 void InitImportList() const; | 1776 void InitImportList() const; |
| 1774 void InitImportedIntoList() const; | 1777 void InitImportedIntoList() const; |
| 1775 void GrowDictionary(const Array& dict, intptr_t dict_size) const; | 1778 void GrowDictionary(const Array& dict, intptr_t dict_size) const; |
| 1776 static RawLibrary* NewLibraryHelper(const String& url, | 1779 static RawLibrary* NewLibraryHelper(const String& url, |
| 1777 bool import_core_lib); | 1780 bool import_core_lib); |
| 1778 void AddImportedInto(const Library& library) const; | 1781 void AddImportedInto(const Library& library) const; |
| 1779 RawObject* LookupObjectFiltered(const String& name, | 1782 RawObject* LookupObjectFiltered(const String& name, |
| 1780 const Library& filter_lib) const; | 1783 const Library& filter_lib) const; |
| 1781 RawLibrary* LookupObjectInImporter(const String& name) const; | 1784 RawLibrary* LookupObjectInImporter(const String& name) const; |
| 1782 RawString* DuplicateDefineErrorString(const String& entry_name, | 1785 RawString* FindDuplicateDefinition() const; |
| 1783 const Library& conflicting_lib) const; | |
| 1784 RawString* FindDuplicateDefinition(Library* conflicting_lib) const; | |
| 1785 | 1786 |
| 1786 HEAP_OBJECT_IMPLEMENTATION(Library, Object); | 1787 HEAP_OBJECT_IMPLEMENTATION(Library, Object); |
| 1787 friend class Class; | 1788 friend class Class; |
| 1788 friend class DictionaryIterator; | 1789 friend class DictionaryIterator; |
| 1789 friend class Debugger; | 1790 friend class Debugger; |
| 1790 friend class Isolate; | 1791 friend class Isolate; |
| 1791 }; | 1792 }; |
| 1792 | 1793 |
| 1793 | 1794 |
| 1794 class LibraryPrefix : public Object { | 1795 class LibraryPrefix : public Object { |
| 1795 public: | 1796 public: |
| 1796 RawString* name() const { return raw_ptr()->name_; } | 1797 RawString* name() const { return raw_ptr()->name_; } |
| 1797 RawLibrary* library() const { return raw_ptr()->library_; } | 1798 RawArray* libraries() const { return raw_ptr()->libraries_; } |
| 1799 intptr_t num_libs() const { return raw_ptr()->num_libs_; } |
| 1800 |
| 1801 RawLibrary* GetLibrary(int index) const; |
| 1802 void AddLibrary(const Library& library) const; |
| 1803 RawClass* LookupLocalClass(const String& class_name) const; |
| 1804 RawString* CheckForDuplicateDefinition() const; |
| 1798 | 1805 |
| 1799 static intptr_t InstanceSize() { | 1806 static intptr_t InstanceSize() { |
| 1800 return RoundedAllocationSize(sizeof(RawLibraryPrefix)); | 1807 return RoundedAllocationSize(sizeof(RawLibraryPrefix)); |
| 1801 } | 1808 } |
| 1802 | 1809 |
| 1803 static RawLibraryPrefix* New(const String& name, const Library& lib); | 1810 static RawLibraryPrefix* New(const String& name, const Library& lib); |
| 1804 | 1811 |
| 1805 private: | 1812 private: |
| 1813 static const int kInitialSize = 2; |
| 1814 static const int kIncrementSize = 2; |
| 1815 |
| 1806 void set_name(const String& value) const; | 1816 void set_name(const String& value) const; |
| 1807 void set_library(const Library& value) const; | 1817 void set_libraries(const Array& value) const; |
| 1818 void set_num_libs(intptr_t value) const; |
| 1808 static RawLibraryPrefix* New(); | 1819 static RawLibraryPrefix* New(); |
| 1809 | 1820 |
| 1810 HEAP_OBJECT_IMPLEMENTATION(LibraryPrefix, Object); | 1821 HEAP_OBJECT_IMPLEMENTATION(LibraryPrefix, Object); |
| 1811 friend class Class; | 1822 friend class Class; |
| 1812 friend class Isolate; | 1823 friend class Isolate; |
| 1813 }; | 1824 }; |
| 1814 | 1825 |
| 1815 | 1826 |
| 1816 class Instructions : public Object { | 1827 class Instructions : public Object { |
| 1817 public: | 1828 public: |
| (...skipping 1841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3659 } | 3670 } |
| 3660 | 3671 |
| 3661 | 3672 |
| 3662 void Context::SetAt(intptr_t index, const Instance& value) const { | 3673 void Context::SetAt(intptr_t index, const Instance& value) const { |
| 3663 StorePointer(InstanceAddr(index), value.raw()); | 3674 StorePointer(InstanceAddr(index), value.raw()); |
| 3664 } | 3675 } |
| 3665 | 3676 |
| 3666 } // namespace dart | 3677 } // namespace dart |
| 3667 | 3678 |
| 3668 #endif // VM_OBJECT_H_ | 3679 #endif // VM_OBJECT_H_ |
| OLD | NEW |