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

Unified Diff: runtime/vm/object.h

Issue 135123011: Introduce cache of resolved names in library (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 32384)
+++ runtime/vm/object.h (working copy)
@@ -2599,7 +2599,6 @@
void AddObject(const Object& obj, const String& name) const;
void ReplaceObject(const Object& obj, const String& name) const;
RawObject* LookupReExport(const String& name) const;
- RawObject* LookupObject(const String& name) const;
RawObject* LookupObjectAllowPrivate(const String& name) const;
RawObject* LookupLocalObjectAllowPrivate(const String& name) const;
RawObject* LookupLocalObject(const String& name) const;
@@ -2615,6 +2614,15 @@
RawScript* LookupScript(const String& url) const;
RawArray* LoadedScripts() const;
+ // Resolve name in the scope of this library. First check the cache
+ // of already resolved names for this library. Then look in the
+ // local dictionary for the unmangled name N, the getter name get:N
+ // and setter name set:N.
+ // If the local dictionary contains no entry for these names,
+ // look in the scopes of all libraries that are imported
+ // without a library prefix.
+ RawObject* ResolveName(const String& name) const;
+
void AddAnonymousClass(const Class& cls) const;
void AddExport(const Namespace& ns) const;
@@ -2723,6 +2731,15 @@
RawGrowableObjectArray* metadata() const { return raw_ptr()->metadata_; }
RawArray* dictionary() const { return raw_ptr()->dictionary_; }
void InitClassDictionary() const;
+
+ RawArray* resolved_names() const { return raw_ptr()->resolved_names_; }
+ void InitResolvedNamesCache(intptr_t size) const;
+ void GrowResolvedNamesCache() const;
+ bool LookupResolvedNamesCache(const String& name, Object* obj) const;
+ void AddToResolvedNamesCache(const String& name, const Object& obj) const;
+ void InvalidateResolvedName(const String& name) const;
+ void InvalidateResolvedNamesCache() const;
+
void InitImportList() const;
void GrowDictionary(const Array& dict, intptr_t dict_size) const;
static RawLibrary* NewLibraryHelper(const String& url,
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698