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 2233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2244 RawFunction* LookupFunctionAllowPrivate(const String& name) const; | 2244 RawFunction* LookupFunctionAllowPrivate(const String& name) const; |
2245 RawFunction* LookupLocalFunction(const String& name) const; | 2245 RawFunction* LookupLocalFunction(const String& name) const; |
2246 RawLibraryPrefix* LookupLocalLibraryPrefix(const String& name) const; | 2246 RawLibraryPrefix* LookupLocalLibraryPrefix(const String& name) const; |
2247 RawScript* LookupScript(const String& url) const; | 2247 RawScript* LookupScript(const String& url) const; |
2248 RawArray* LoadedScripts() const; | 2248 RawArray* LoadedScripts() const; |
2249 | 2249 |
2250 void AddAnonymousClass(const Class& cls) const; | 2250 void AddAnonymousClass(const Class& cls) const; |
2251 | 2251 |
2252 void AddExport(const Namespace& ns) const; | 2252 void AddExport(const Namespace& ns) const; |
2253 | 2253 |
| 2254 void AddClassMetadata(const Class& cls, intptr_t token_pos) const; |
| 2255 void AddFieldMetadata(const Field& field, intptr_t token_pos) const; |
| 2256 void AddFunctionMetadata(const Function& func, intptr_t token_pos) const; |
| 2257 RawObject* GetMetadata(const Object& obj) const; |
| 2258 |
2254 // Library imports. | 2259 // Library imports. |
2255 void AddImport(const Namespace& ns) const; | 2260 void AddImport(const Namespace& ns) const; |
2256 intptr_t num_imports() const { return raw_ptr()->num_imports_; } | 2261 intptr_t num_imports() const { return raw_ptr()->num_imports_; } |
2257 RawNamespace* ImportAt(intptr_t index) const; | 2262 RawNamespace* ImportAt(intptr_t index) const; |
2258 RawLibrary* ImportLibraryAt(intptr_t index) const; | 2263 RawLibrary* ImportLibraryAt(intptr_t index) const; |
2259 bool ImportsCorelib() const; | 2264 bool ImportsCorelib() const; |
2260 | 2265 |
2261 RawFunction* LookupFunctionInScript(const Script& script, | 2266 RawFunction* LookupFunctionInScript(const Script& script, |
2262 intptr_t token_pos) const; | 2267 intptr_t token_pos) const; |
2263 | 2268 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2326 static const int kImportsCapacityIncrement = 8; | 2331 static const int kImportsCapacityIncrement = 8; |
2327 static RawLibrary* New(); | 2332 static RawLibrary* New(); |
2328 | 2333 |
2329 void set_num_imports(intptr_t value) const { | 2334 void set_num_imports(intptr_t value) const { |
2330 raw_ptr()->num_imports_ = value; | 2335 raw_ptr()->num_imports_ = value; |
2331 } | 2336 } |
2332 RawArray* imports() const { return raw_ptr()->imports_; } | 2337 RawArray* imports() const { return raw_ptr()->imports_; } |
2333 RawArray* exports() const { return raw_ptr()->exports_; } | 2338 RawArray* exports() const { return raw_ptr()->exports_; } |
2334 bool HasExports() const; | 2339 bool HasExports() const; |
2335 RawArray* loaded_scripts() const { return raw_ptr()->loaded_scripts_; } | 2340 RawArray* loaded_scripts() const { return raw_ptr()->loaded_scripts_; } |
| 2341 RawGrowableObjectArray* metadata() const { return raw_ptr()->metadata_; } |
2336 RawArray* dictionary() const { return raw_ptr()->dictionary_; } | 2342 RawArray* dictionary() const { return raw_ptr()->dictionary_; } |
2337 void InitClassDictionary() const; | 2343 void InitClassDictionary() const; |
2338 void InitImportList() const; | 2344 void InitImportList() const; |
2339 void GrowDictionary(const Array& dict, intptr_t dict_size) const; | 2345 void GrowDictionary(const Array& dict, intptr_t dict_size) const; |
2340 static RawLibrary* NewLibraryHelper(const String& url, | 2346 static RawLibrary* NewLibraryHelper(const String& url, |
2341 bool import_core_lib); | 2347 bool import_core_lib); |
2342 RawObject* LookupEntry(const String& name, intptr_t *index) const; | 2348 RawObject* LookupEntry(const String& name, intptr_t *index) const; |
2343 | 2349 |
| 2350 RawString* MakeMetadataName(const Object& obj) const; |
| 2351 RawField* GetMetadataField(const String& metaname) const; |
| 2352 void AddMetadata(const Class& cls, |
| 2353 const String& name, |
| 2354 intptr_t token_pos) const; |
| 2355 |
2344 FINAL_HEAP_OBJECT_IMPLEMENTATION(Library, Object); | 2356 FINAL_HEAP_OBJECT_IMPLEMENTATION(Library, Object); |
2345 | 2357 |
2346 friend class Bootstrap; | 2358 friend class Bootstrap; |
2347 friend class Class; | 2359 friend class Class; |
2348 friend class Debugger; | 2360 friend class Debugger; |
2349 friend class DictionaryIterator; | 2361 friend class DictionaryIterator; |
2350 friend class Isolate; | 2362 friend class Isolate; |
2351 friend class Namespace; | 2363 friend class Namespace; |
2352 friend class Object; | 2364 friend class Object; |
2353 }; | 2365 }; |
(...skipping 3513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5867 | 5879 |
5868 | 5880 |
5869 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 5881 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
5870 intptr_t index) { | 5882 intptr_t index) { |
5871 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 5883 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
5872 } | 5884 } |
5873 | 5885 |
5874 } // namespace dart | 5886 } // namespace dart |
5875 | 5887 |
5876 #endif // VM_OBJECT_H_ | 5888 #endif // VM_OBJECT_H_ |
OLD | NEW |