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 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1832 static RawLibrary* New(const String& url); | 1832 static RawLibrary* New(const String& url); |
1833 | 1833 |
1834 // Library scope name dictionary. | 1834 // Library scope name dictionary. |
1835 // | 1835 // |
1836 // TODO(turnidge): The Lookup functions are not consistent in how | 1836 // TODO(turnidge): The Lookup functions are not consistent in how |
1837 // they deal with private names. Go through and make them a bit | 1837 // they deal with private names. Go through and make them a bit |
1838 // more regular. | 1838 // more regular. |
1839 void AddClass(const Class& cls) const; | 1839 void AddClass(const Class& cls) const; |
1840 void AddObject(const Object& obj, const String& name) const; | 1840 void AddObject(const Object& obj, const String& name) const; |
1841 void ReplaceObject(const Object& obj, const String& name) const; | 1841 void ReplaceObject(const Object& obj, const String& name) const; |
| 1842 RawObject* LookupExport(const String& name) const; |
1842 RawObject* LookupObject(const String& name) const; | 1843 RawObject* LookupObject(const String& name) const; |
1843 RawClass* LookupClass(const String& name) const; | 1844 RawClass* LookupClass(const String& name) const; |
1844 RawClass* LookupClassAllowPrivate(const String& name) const; | 1845 RawClass* LookupClassAllowPrivate(const String& name) const; |
1845 RawObject* LookupLocalObject(const String& name) const; | 1846 RawObject* LookupLocalObject(const String& name) const; |
1846 RawClass* LookupLocalClass(const String& name) const; | 1847 RawClass* LookupLocalClass(const String& name) const; |
1847 RawField* LookupFieldAllowPrivate(const String& name) const; | 1848 RawField* LookupFieldAllowPrivate(const String& name) const; |
1848 RawField* LookupLocalField(const String& name) const; | 1849 RawField* LookupLocalField(const String& name) const; |
1849 RawFunction* LookupFunctionAllowPrivate(const String& name) const; | 1850 RawFunction* LookupFunctionAllowPrivate(const String& name) const; |
1850 RawFunction* LookupLocalFunction(const String& name) const; | 1851 RawFunction* LookupLocalFunction(const String& name) const; |
1851 RawLibraryPrefix* LookupLocalLibraryPrefix(const String& name) const; | 1852 RawLibraryPrefix* LookupLocalLibraryPrefix(const String& name) const; |
1852 RawScript* LookupScript(const String& url) const; | 1853 RawScript* LookupScript(const String& url) const; |
1853 RawArray* LoadedScripts() const; | 1854 RawArray* LoadedScripts() const; |
1854 | 1855 |
1855 void AddAnonymousClass(const Class& cls) const; | 1856 void AddAnonymousClass(const Class& cls) const; |
1856 | 1857 |
| 1858 void AddExport(const Namespace& ns) const; |
| 1859 |
1857 // Library imports. | 1860 // Library imports. |
1858 void AddImport(const Namespace& ns) const; | 1861 void AddImport(const Namespace& ns) const; |
1859 RawLibrary* LookupImport(const String& url) const; | |
1860 intptr_t num_imports() const { return raw_ptr()->num_imports_; } | 1862 intptr_t num_imports() const { return raw_ptr()->num_imports_; } |
1861 RawNamespace* ImportAt(intptr_t index) const; | 1863 RawNamespace* ImportAt(intptr_t index) const; |
1862 RawLibrary* ImportLibraryAt(intptr_t index) const; | 1864 RawLibrary* ImportLibraryAt(intptr_t index) const; |
1863 bool ImportsCorelib() const; | 1865 bool ImportsCorelib() const; |
1864 | 1866 |
1865 RawFunction* LookupFunctionInSource(const String& script_url, | 1867 RawFunction* LookupFunctionInSource(const String& script_url, |
1866 intptr_t line_number) const; | 1868 intptr_t line_number) const; |
1867 RawFunction* LookupFunctionInScript(const Script& script, | 1869 RawFunction* LookupFunctionInScript(const Script& script, |
1868 intptr_t token_pos) const; | 1870 intptr_t token_pos) const; |
1869 | 1871 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1921 | 1923 |
1922 private: | 1924 private: |
1923 static const int kInitialImportsCapacity = 4; | 1925 static const int kInitialImportsCapacity = 4; |
1924 static const int kImportsCapacityIncrement = 8; | 1926 static const int kImportsCapacityIncrement = 8; |
1925 static RawLibrary* New(); | 1927 static RawLibrary* New(); |
1926 | 1928 |
1927 void set_num_imports(intptr_t value) const { | 1929 void set_num_imports(intptr_t value) const { |
1928 raw_ptr()->num_imports_ = value; | 1930 raw_ptr()->num_imports_ = value; |
1929 } | 1931 } |
1930 RawArray* imports() const { return raw_ptr()->imports_; } | 1932 RawArray* imports() const { return raw_ptr()->imports_; } |
| 1933 RawArray* exports() const { return raw_ptr()->exports_; } |
| 1934 bool HasExports() const; |
1931 RawArray* loaded_scripts() const { return raw_ptr()->loaded_scripts_; } | 1935 RawArray* loaded_scripts() const { return raw_ptr()->loaded_scripts_; } |
1932 RawArray* dictionary() const { return raw_ptr()->dictionary_; } | 1936 RawArray* dictionary() const { return raw_ptr()->dictionary_; } |
1933 void InitClassDictionary() const; | 1937 void InitClassDictionary() const; |
1934 void InitImportList() const; | 1938 void InitImportList() const; |
1935 void GrowDictionary(const Array& dict, intptr_t dict_size) const; | 1939 void GrowDictionary(const Array& dict, intptr_t dict_size) const; |
1936 static RawLibrary* NewLibraryHelper(const String& url, | 1940 static RawLibrary* NewLibraryHelper(const String& url, |
1937 bool import_core_lib); | 1941 bool import_core_lib); |
1938 RawObject* LookupEntry(const String& name, intptr_t *index) const; | 1942 RawObject* LookupEntry(const String& name, intptr_t *index) const; |
1939 | 1943 |
1940 HEAP_OBJECT_IMPLEMENTATION(Library, Object); | 1944 HEAP_OBJECT_IMPLEMENTATION(Library, Object); |
(...skipping 3785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5726 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5730 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
5727 return false; | 5731 return false; |
5728 } | 5732 } |
5729 } | 5733 } |
5730 return true; | 5734 return true; |
5731 } | 5735 } |
5732 | 5736 |
5733 } // namespace dart | 5737 } // namespace dart |
5734 | 5738 |
5735 #endif // VM_OBJECT_H_ | 5739 #endif // VM_OBJECT_H_ |
OLD | NEW |