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

Unified Diff: runtime/vm/object.h

Issue 10945020: Add virtual method to Object to ease dictionary code (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « no previous file | 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 12576)
+++ runtime/vm/object.h (working copy)
@@ -189,6 +189,13 @@
}
}
+ // Returns the name that is used to identify an object in the
+ // namespace dictionary.
+ // Object::DictionaryName() returns String::null(). Only subclasses
+ // of Object that need to be entered in the library and library prefix
+ // namespaces need to provide an implementation.
+ virtual RawString* DictionaryName() const;
+
bool IsNew() const { return raw()->IsNewObject(); }
bool IsOld() const { return raw()->IsOldObject(); }
@@ -459,9 +466,10 @@
}
RawString* Name() const;
-
RawString* UserVisibleName() const;
+ virtual RawString* DictionaryName() const { return Name(); }
+
RawScript* script() const { return raw_ptr()->script_; }
void set_script(const Script& value) const;
@@ -1336,6 +1344,7 @@
RawString* name() const { return raw_ptr()->name_; }
RawString* UserVisibleName() const;
RawString* QualifiedUserVisibleName() const;
+ virtual RawString* DictionaryName() const { return name(); }
// Build a string of the form '<T, R>(T, [b: B, c: C]) => R' representing the
// internal signature of the given function.
@@ -1757,6 +1766,7 @@
public:
RawString* name() const { return raw_ptr()->name_; }
RawString* UserVisibleName() const;
+ virtual RawString* DictionaryName() const { return name(); }
bool is_static() const { return StaticBit::decode(raw_ptr()->kind_bits_); }
bool is_final() const { return FinalBit::decode(raw_ptr()->kind_bits_); }
@@ -2176,6 +2186,8 @@
class LibraryPrefix : public Object {
public:
RawString* name() const { return raw_ptr()->name_; }
+ virtual RawString* DictionaryName() const { return name(); }
+
RawArray* libraries() const { return raw_ptr()->libraries_; }
intptr_t num_libs() const { return raw_ptr()->num_libs_; }
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698