| 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 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1750 RawFunction* LookupLocalFunction(const String& name) const; | 1750 RawFunction* LookupLocalFunction(const String& name) const; |
| 1751 RawLibraryPrefix* LookupLocalLibraryPrefix(const String& name) const; | 1751 RawLibraryPrefix* LookupLocalLibraryPrefix(const String& name) const; |
| 1752 RawScript* LookupScript(const String& url) const; | 1752 RawScript* LookupScript(const String& url) const; |
| 1753 RawArray* LoadedScripts() const; | 1753 RawArray* LoadedScripts() const; |
| 1754 | 1754 |
| 1755 void AddAnonymousClass(const Class& cls) const; | 1755 void AddAnonymousClass(const Class& cls) const; |
| 1756 | 1756 |
| 1757 // Library imports. | 1757 // Library imports. |
| 1758 void AddImport(const Library& library) const; | 1758 void AddImport(const Library& library) const; |
| 1759 RawLibrary* LookupImport(const String& url) const; | 1759 RawLibrary* LookupImport(const String& url) const; |
| 1760 intptr_t num_imports() const { return raw_ptr()->num_imports_; } |
| 1761 RawLibrary* ImportAt(intptr_t index) const; |
| 1762 RawLibraryPrefix* ImportPrefixAt(intptr_t index) const; |
| 1760 | 1763 |
| 1761 RawFunction* LookupFunctionInSource(const String& script_url, | 1764 RawFunction* LookupFunctionInSource(const String& script_url, |
| 1762 intptr_t line_number) const; | 1765 intptr_t line_number) const; |
| 1763 RawFunction* LookupFunctionInScript(const Script& script, | 1766 RawFunction* LookupFunctionInScript(const Script& script, |
| 1764 intptr_t token_index) const; | 1767 intptr_t token_index) const; |
| 1765 | 1768 |
| 1766 // Resolving native methods for script loaded in the library. | 1769 // Resolving native methods for script loaded in the library. |
| 1767 Dart_NativeEntryResolver native_entry_resolver() const { | 1770 Dart_NativeEntryResolver native_entry_resolver() const { |
| 1768 return raw_ptr()->native_entry_resolver_; | 1771 return raw_ptr()->native_entry_resolver_; |
| 1769 } | 1772 } |
| 1770 void set_native_entry_resolver(Dart_NativeEntryResolver value) const { | 1773 void set_native_entry_resolver(Dart_NativeEntryResolver value) const { |
| 1771 raw_ptr()->native_entry_resolver_ = value; | 1774 raw_ptr()->native_entry_resolver_ = value; |
| 1772 } | 1775 } |
| 1773 | 1776 |
| 1774 RawString* PrivateName(const String& name) const; | 1777 RawString* PrivateName(const String& name) const; |
| 1775 | 1778 |
| 1779 intptr_t index() const { return raw_ptr()->index_; } |
| 1780 void set_index(intptr_t value) const { |
| 1781 raw_ptr()->index_ = value; |
| 1782 } |
| 1783 |
| 1776 void Register() const; | 1784 void Register() const; |
| 1777 | 1785 |
| 1778 RawString* DuplicateDefineErrorString(const String& entry_name, | 1786 RawString* DuplicateDefineErrorString(const String& entry_name, |
| 1779 const Library& conflicting_lib) const; | 1787 const Library& conflicting_lib) const; |
| 1780 static RawLibrary* LookupLibrary(const String& url); | 1788 static RawLibrary* LookupLibrary(const String& url); |
| 1781 static RawLibrary* GetLibrary(intptr_t index); | 1789 static RawLibrary* GetLibrary(intptr_t index); |
| 1782 static RawString* CheckForDuplicateDefinition(); | 1790 static RawString* CheckForDuplicateDefinition(); |
| 1783 static bool IsKeyUsed(intptr_t key); | 1791 static bool IsKeyUsed(intptr_t key); |
| 1784 | 1792 |
| 1785 static void InitCoreLibrary(Isolate* isolate); | 1793 static void InitCoreLibrary(Isolate* isolate); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1797 // Eagerly compile all classes and functions in the library. | 1805 // Eagerly compile all classes and functions in the library. |
| 1798 static RawError* CompileAll(); | 1806 static RawError* CompileAll(); |
| 1799 | 1807 |
| 1800 private: | 1808 private: |
| 1801 static const int kInitialImportsCapacity = 4; | 1809 static const int kInitialImportsCapacity = 4; |
| 1802 static const int kImportsCapacityIncrement = 8; | 1810 static const int kImportsCapacityIncrement = 8; |
| 1803 static const int kInitialImportedIntoCapacity = 1; | 1811 static const int kInitialImportedIntoCapacity = 1; |
| 1804 static const int kImportedIntoCapacityIncrement = 2; | 1812 static const int kImportedIntoCapacityIncrement = 2; |
| 1805 static RawLibrary* New(); | 1813 static RawLibrary* New(); |
| 1806 | 1814 |
| 1807 intptr_t num_imports() const { return raw_ptr()->num_imports_; } | |
| 1808 void set_num_imports(intptr_t value) const { | 1815 void set_num_imports(intptr_t value) const { |
| 1809 raw_ptr()->num_imports_ = value; | 1816 raw_ptr()->num_imports_ = value; |
| 1810 } | 1817 } |
| 1811 intptr_t num_imported_into() const { return raw_ptr()->num_imported_into_; } | 1818 intptr_t num_imported_into() const { return raw_ptr()->num_imported_into_; } |
| 1812 void set_num_imported_into(intptr_t value) const { | 1819 void set_num_imported_into(intptr_t value) const { |
| 1813 raw_ptr()->num_imported_into_ = value; | 1820 raw_ptr()->num_imported_into_ = value; |
| 1814 } | 1821 } |
| 1815 RawArray* imports() const { return raw_ptr()->imports_; } | 1822 RawArray* imports() const { return raw_ptr()->imports_; } |
| 1816 RawArray* imported_into() const { return raw_ptr()->imported_into_; } | 1823 RawArray* imported_into() const { return raw_ptr()->imported_into_; } |
| 1817 RawArray* loaded_scripts() const { return raw_ptr()->loaded_scripts_; } | 1824 RawArray* loaded_scripts() const { return raw_ptr()->loaded_scripts_; } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1835 friend class Isolate; | 1842 friend class Isolate; |
| 1836 }; | 1843 }; |
| 1837 | 1844 |
| 1838 | 1845 |
| 1839 class LibraryPrefix : public Object { | 1846 class LibraryPrefix : public Object { |
| 1840 public: | 1847 public: |
| 1841 RawString* name() const { return raw_ptr()->name_; } | 1848 RawString* name() const { return raw_ptr()->name_; } |
| 1842 RawArray* libraries() const { return raw_ptr()->libraries_; } | 1849 RawArray* libraries() const { return raw_ptr()->libraries_; } |
| 1843 intptr_t num_libs() const { return raw_ptr()->num_libs_; } | 1850 intptr_t num_libs() const { return raw_ptr()->num_libs_; } |
| 1844 | 1851 |
| 1852 bool ContainsLibrary(const Library& library) const; |
| 1845 RawLibrary* GetLibrary(int index) const; | 1853 RawLibrary* GetLibrary(int index) const; |
| 1846 void AddLibrary(const Library& library) const; | 1854 void AddLibrary(const Library& library) const; |
| 1847 RawClass* LookupLocalClass(const String& class_name) const; | 1855 RawClass* LookupLocalClass(const String& class_name) const; |
| 1848 RawString* CheckForDuplicateDefinition() const; | 1856 RawString* CheckForDuplicateDefinition() const; |
| 1849 | 1857 |
| 1850 static intptr_t InstanceSize() { | 1858 static intptr_t InstanceSize() { |
| 1851 return RoundedAllocationSize(sizeof(RawLibraryPrefix)); | 1859 return RoundedAllocationSize(sizeof(RawLibraryPrefix)); |
| 1852 } | 1860 } |
| 1853 | 1861 |
| 1854 static RawLibraryPrefix* New(const String& name, const Library& lib); | 1862 static RawLibraryPrefix* New(const String& name, const Library& lib); |
| (...skipping 3094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4949 } | 4957 } |
| 4950 | 4958 |
| 4951 | 4959 |
| 4952 intptr_t Stackmap::SizeInBits() const { | 4960 intptr_t Stackmap::SizeInBits() const { |
| 4953 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); | 4961 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); |
| 4954 } | 4962 } |
| 4955 | 4963 |
| 4956 } // namespace dart | 4964 } // namespace dart |
| 4957 | 4965 |
| 4958 #endif // VM_OBJECT_H_ | 4966 #endif // VM_OBJECT_H_ |
| OLD | NEW |