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

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

Issue 16780008: Reified metadata in the VM (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
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 2233 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
2344 FINAL_HEAP_OBJECT_IMPLEMENTATION(Library, Object); 2353 FINAL_HEAP_OBJECT_IMPLEMENTATION(Library, Object);
2345 2354
2346 friend class Bootstrap; 2355 friend class Bootstrap;
2347 friend class Class; 2356 friend class Class;
2348 friend class Debugger; 2357 friend class Debugger;
2349 friend class DictionaryIterator; 2358 friend class DictionaryIterator;
2350 friend class Isolate; 2359 friend class Isolate;
2351 friend class Namespace; 2360 friend class Namespace;
2352 friend class Object; 2361 friend class Object;
2353 }; 2362 };
(...skipping 3513 matching lines...) Expand 10 before | Expand all | Expand 10 after
5867 5876
5868 5877
5869 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 5878 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
5870 intptr_t index) { 5879 intptr_t index) {
5871 return array.At((index * kEntryLength) + kTargetFunctionIndex); 5880 return array.At((index * kEntryLength) + kTargetFunctionIndex);
5872 } 5881 }
5873 5882
5874 } // namespace dart 5883 } // namespace dart
5875 5884
5876 #endif // VM_OBJECT_H_ 5885 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698