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

Unified Diff: runtime/vm/object.h

Issue 264743010: Don't remap class/type names in the vm service. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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/disassembler_ia32.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
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 232df72aecec9e468326069a9ad6ebe310270d5e..3c5d1ee50993af5738910e3a913f157d1752d95d 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -495,7 +495,41 @@ class Object {
// Different kinds of name visibility.
enum NameVisibility {
+ // Internal names are the true names of classes, fields,
+ // etc. inside the vm. These names include privacy suffixes,
+ // getter prefixes, and trailing dots on unnamed constructors.
+ //
+ // The names of core implementation classes (like _OneByteString)
+ // are preserved as well.
+ //
+ // e.g.
+ // private getter - get:foo@6be832b
+ // private constructor - _MyClass@6b3832b.
+ // private named constructor - _MyClass@6b3832b.named
+ // core impl class name shown - _OneByteString
kInternalName = 0,
+
+ // Pretty names drop privacy suffixes, getter prefixes, and
+ // trailing dots on unnamed constructors. These names are used in
+ // the vm service.
+ //
+ // e.g.
+ // get:foo@6be832b -> foo
+ // _MyClass@6b3832b. -> _MyClass
+ // _MyClass@6b3832b.named -> _MyClass.named
+ // _OneByteString -> _OneByteString (not remapped)
+ kPrettyName,
+
+ // User visible names are appropriate for reporting type errors
+ // directly to programmers. The names have been "prettied" and
+ // the names of core implementation classes are remapped to their
+ // public interface names.
+ //
+ // e.g.
+ // get:foo@6be832b -> foo
+ // _MyClass@6b3832b. -> _MyClass
+ // _MyClass@6b3832b.named -> _MyClass.named
+ // _OneByteString -> String (remapped)
kUserVisibleName
};
@@ -705,6 +739,7 @@ class Class : public Object {
}
RawString* Name() const;
+ RawString* PrettyName() const;
RawString* UserVisibleName() const;
virtual RawString* DictionaryName() const { return Name(); }
@@ -1155,7 +1190,9 @@ class Class : public Object {
class CycleFreeBit : public BitField<bool, kCycleFreeBit, 1> {};
void set_name(const String& value) const;
+ void set_pretty_name(const String& value) const;
void set_user_name(const String& value) const;
+ RawString* GeneratePrettyName() const;
RawString* GenerateUserVisibleName() const;
void set_signature_function(const Function& value) const;
void set_signature_type(const AbstractType& value) const;
@@ -1273,6 +1310,12 @@ class TypeArguments : public Object {
return SubvectorName(0, Length(), kInternalName);
}
+ // The name of this type argument vector, e.g. "<T, dynamic, List<T>, Smi>".
+ // Names of internal classes are not mapped to their public interfaces.
+ RawString* PrettyName() const {
+ return SubvectorName(0, Length(), kPrettyName);
+ }
+
// The name of this type argument vector, e.g. "<T, dynamic, List<T>, int>".
// Names of internal classes are mapped to their public interfaces.
RawString* UserVisibleName() const {
@@ -1463,7 +1506,9 @@ class PatchClass : public Object {
class Function : public Object {
public:
RawString* name() const { return raw_ptr()->name_; }
+ RawString* PrettyName() const;
RawString* UserVisibleName() const;
+ RawString* QualifiedPrettyName() const;
RawString* QualifiedUserVisibleName() const;
virtual RawString* DictionaryName() const { return name(); }
@@ -1477,6 +1522,12 @@ class Function : public Object {
return BuildSignature(instantiate, kInternalName, TypeArguments::Handle());
}
+ RawString* PrettySignature() const {
+ const bool instantiate = false;
+ return BuildSignature(
+ instantiate, kPrettyName, TypeArguments::Handle());
+ }
+
// Build a string of the form '(T, {b: B, c: C}) => R' representing the
// user visible signature of the given function. In this example, T and R are
// type parameters of class C, the owner of the function.
@@ -2095,6 +2146,7 @@ class RedirectionData: public Object {
class Field : public Object {
public:
RawString* name() const { return raw_ptr()->name_; }
+ RawString* PrettyName() const;
RawString* UserVisibleName() const;
virtual RawString* DictionaryName() const { return name(); }
@@ -3610,7 +3662,7 @@ class Code : public Object {
RawArray* ExtractTypeFeedbackArray() const;
RawString* Name() const;
- RawString* UserName() const;
+ RawString* PrettyName() const;
int64_t compile_timestamp() const {
return raw_ptr()->compile_timestamp_;
@@ -4296,6 +4348,10 @@ class AbstractType : public Instance {
return BuildName(kInternalName);
}
+ virtual RawString* PrettyName() const {
+ return BuildName(kPrettyName);
+ }
+
// The name of this type, including the names of its type arguments, if any.
// Names of internal classes are mapped to their public interfaces.
virtual RawString* UserVisibleName() const {
« no previous file with comments | « runtime/vm/disassembler_ia32.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698