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

Unified Diff: runtime/vm/object.cc

Issue 9233039: Store resolved library prefix in unresolved class object in order not to repeat (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 11 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/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 3699)
+++ runtime/vm/object.cc (working copy)
@@ -1749,11 +1749,11 @@
RawUnresolvedClass* UnresolvedClass::New(intptr_t token_index,
- const String& qualifier,
+ const LibraryPrefix& library_prefix,
const String& ident) {
const UnresolvedClass& type = UnresolvedClass::Handle(UnresolvedClass::New());
type.set_token_index(token_index);
- type.set_qualifier(qualifier);
+ type.set_library_prefix(library_prefix);
type.set_ident(ident);
return type.raw();
}
@@ -1779,8 +1779,9 @@
}
-void UnresolvedClass::set_qualifier(const String& qualifier) const {
- StorePointer(&raw_ptr()->qualifier_, qualifier.raw());
+void UnresolvedClass::set_library_prefix(
+ const LibraryPrefix& library_prefix) const {
+ StorePointer(&raw_ptr()->library_prefix_, library_prefix.raw());
}
@@ -1790,10 +1791,11 @@
RawString* UnresolvedClass::Name() const {
- if (qualifier() != String::null()) {
+ if (library_prefix() != LibraryPrefix::null()) {
+ const LibraryPrefix& lib_prefix = LibraryPrefix::Handle(library_prefix());
String& name = String::Handle();
- name = qualifier();
String& str = String::Handle();
+ name = lib_prefix.name(); // Qualifier.
str = String::New(".");
name = String::Concat(name, str);
str = ident();
@@ -2139,7 +2141,7 @@
RawType* Type::NewRawType(const Class& type_class) {
const AbstractTypeArguments& type_arguments =
AbstractTypeArguments::Handle(type_class.type_parameter_extends());
- return NewParameterizedType(Object::Handle(type_class.raw()), type_arguments);
+ return New(Object::Handle(type_class.raw()), type_arguments);
}
@@ -2156,12 +2158,6 @@
}
-RawType* Type::NewParameterizedType(const Object& clazz,
- const AbstractTypeArguments& arguments) {
- return Type::New(clazz, arguments);
-}
-
-
void Type::set_is_finalized() const {
ASSERT(!IsFinalized());
set_type_state(RawType::kFinalized);
@@ -5652,8 +5648,7 @@
if (num_type_arguments > 0) {
type_arguments = GetTypeArguments();
}
- const Type& type = Type::Handle(
- Type::NewParameterizedType(cls, type_arguments));
+ const Type& type = Type::Handle(Type::New(cls, type_arguments));
const String& type_name = String::Handle(type.Name());
// Calculate the size of the string.
intptr_t len = OS::SNPrint(NULL, 0, kFormat, type_name.ToCString()) + 1;
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698