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

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

Issue 19662003: Refactor resolution code in the vm to properly handle ambiguity errors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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
« no previous file with comments | « runtime/vm/mirrors_api_impl.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2279 2279
2280 // Library scope name dictionary. 2280 // Library scope name dictionary.
2281 // 2281 //
2282 // TODO(turnidge): The Lookup functions are not consistent in how 2282 // TODO(turnidge): The Lookup functions are not consistent in how
2283 // they deal with private names. Go through and make them a bit 2283 // they deal with private names. Go through and make them a bit
2284 // more regular. 2284 // more regular.
2285 void AddClass(const Class& cls) const; 2285 void AddClass(const Class& cls) const;
2286 void AddObject(const Object& obj, const String& name) const; 2286 void AddObject(const Object& obj, const String& name) const;
2287 void ReplaceObject(const Object& obj, const String& name) const; 2287 void ReplaceObject(const Object& obj, const String& name) const;
2288 RawObject* LookupExport(const String& name) const; 2288 RawObject* LookupExport(const String& name) const;
2289 RawObject* LookupObject(const String& name) const; 2289 RawObject* LookupObject(const String& name,
2290 RawClass* LookupClass(const String& name) const; 2290 String* ambiguity_error_msg) const;
2291 RawClass* LookupClassAllowPrivate(const String& name) const; 2291 RawObject* LookupObjectAllowPrivate(const String& name,
2292 String* ambiguity_error_msg) const;
2293 RawObject* LookupLocalObjectAllowPrivate(const String& name) const;
2292 RawObject* LookupLocalObject(const String& name) const; 2294 RawObject* LookupLocalObject(const String& name) const;
2295 RawObject* LookupImportedObject(const String& name,
2296 String* ambiguity_error_msg) const;
2297 RawClass* LookupClass(const String& name, String* ambiguity_error_msg) const;
2298 RawClass* LookupClassAllowPrivate(const String& name,
2299 String* ambiguity_error_msg) const;
2293 RawClass* LookupLocalClass(const String& name) const; 2300 RawClass* LookupLocalClass(const String& name) const;
2294 RawField* LookupFieldAllowPrivate(const String& name) const; 2301 RawField* LookupFieldAllowPrivate(const String& name,
2302 String* ambiguity_error_msg) const;
2295 RawField* LookupLocalField(const String& name) const; 2303 RawField* LookupLocalField(const String& name) const;
2296 RawFunction* LookupFunctionAllowPrivate(const String& name) const; 2304 RawFunction* LookupFunctionAllowPrivate(const String& name,
2305 String* ambiguity_error_msg) const;
2297 RawFunction* LookupLocalFunction(const String& name) const; 2306 RawFunction* LookupLocalFunction(const String& name) const;
2298 RawLibraryPrefix* LookupLocalLibraryPrefix(const String& name) const; 2307 RawLibraryPrefix* LookupLocalLibraryPrefix(const String& name) const;
2299 RawScript* LookupScript(const String& url) const; 2308 RawScript* LookupScript(const String& url) const;
2300 RawArray* LoadedScripts() const; 2309 RawArray* LoadedScripts() const;
2301 2310
2302 void AddAnonymousClass(const Class& cls) const; 2311 void AddAnonymousClass(const Class& cls) const;
2303 2312
2304 void AddExport(const Namespace& ns) const; 2313 void AddExport(const Namespace& ns) const;
2305 2314
2306 void AddClassMetadata(const Class& cls, intptr_t token_pos) const; 2315 void AddClassMetadata(const Class& cls, intptr_t token_pos) const;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
2420 public: 2429 public:
2421 RawString* name() const { return raw_ptr()->name_; } 2430 RawString* name() const { return raw_ptr()->name_; }
2422 virtual RawString* DictionaryName() const { return name(); } 2431 virtual RawString* DictionaryName() const { return name(); }
2423 2432
2424 RawArray* imports() const { return raw_ptr()->imports_; } 2433 RawArray* imports() const { return raw_ptr()->imports_; }
2425 intptr_t num_imports() const { return raw_ptr()->num_imports_; } 2434 intptr_t num_imports() const { return raw_ptr()->num_imports_; }
2426 2435
2427 bool ContainsLibrary(const Library& library) const; 2436 bool ContainsLibrary(const Library& library) const;
2428 RawLibrary* GetLibrary(int index) const; 2437 RawLibrary* GetLibrary(int index) const;
2429 void AddImport(const Namespace& import) const; 2438 void AddImport(const Namespace& import) const;
2430 RawClass* LookupLocalClass(const String& class_name) const; 2439 RawClass* LookupClass(const String& class_name,
2440 String* ambiguity_error_msg) const;
2431 2441
2432 static intptr_t InstanceSize() { 2442 static intptr_t InstanceSize() {
2433 return RoundedAllocationSize(sizeof(RawLibraryPrefix)); 2443 return RoundedAllocationSize(sizeof(RawLibraryPrefix));
2434 } 2444 }
2435 2445
2436 static RawLibraryPrefix* New(const String& name, const Namespace& import); 2446 static RawLibraryPrefix* New(const String& name, const Namespace& import);
2437 2447
2438 private: 2448 private:
2439 static const int kInitialSize = 2; 2449 static const int kInitialSize = 2;
2440 static const int kIncrementSize = 2; 2450 static const int kIncrementSize = 2;
(...skipping 3574 matching lines...) Expand 10 before | Expand all | Expand 10 after
6015 6025
6016 6026
6017 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6027 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6018 intptr_t index) { 6028 intptr_t index) {
6019 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6029 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6020 } 6030 }
6021 6031
6022 } // namespace dart 6032 } // namespace dart
6023 6033
6024 #endif // VM_OBJECT_H_ 6034 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/mirrors_api_impl.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698