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

Side by Side Diff: vm/class_finalizer.cc

Issue 9363048: Implement capability to use the same library prefix for multiple library imports (currently this ... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | vm/object.h » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #include "vm/class_finalizer.h" 5 #include "vm/class_finalizer.h"
6 6
7 #include "vm/flags.h" 7 #include "vm/flags.h"
8 #include "vm/heap.h" 8 #include "vm/heap.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 258
259 259
260 // Resolve unresolved_class in the library of cls. 260 // Resolve unresolved_class in the library of cls.
261 RawClass* ClassFinalizer::ResolveClass( 261 RawClass* ClassFinalizer::ResolveClass(
262 const Class& cls, const UnresolvedClass& unresolved_class) { 262 const Class& cls, const UnresolvedClass& unresolved_class) {
263 const String& class_name = String::Handle(unresolved_class.ident()); 263 const String& class_name = String::Handle(unresolved_class.ident());
264 Library& lib = Library::Handle(); 264 Library& lib = Library::Handle();
265 Class& resolved_class = Class::Handle(); 265 Class& resolved_class = Class::Handle();
266 if (unresolved_class.library_prefix() == LibraryPrefix::null()) { 266 if (unresolved_class.library_prefix() == LibraryPrefix::null()) {
267 lib = cls.library(); 267 lib = cls.library();
268 ASSERT(!lib.IsNull());
268 resolved_class = lib.LookupClass(class_name); 269 resolved_class = lib.LookupClass(class_name);
269 } else { 270 } else {
270 LibraryPrefix& lib_prefix = LibraryPrefix::Handle(); 271 LibraryPrefix& lib_prefix = LibraryPrefix::Handle();
271 lib_prefix = unresolved_class.library_prefix(); 272 lib_prefix = unresolved_class.library_prefix();
272 ASSERT(!lib_prefix.IsNull()); 273 ASSERT(!lib_prefix.IsNull());
273 lib = lib_prefix.library(); 274 resolved_class = lib_prefix.LookupLocalClass(class_name);
274 resolved_class = lib.LookupLocalClass(class_name);
275 } 275 }
276 if (resolved_class.IsNull()) { 276 if (resolved_class.IsNull()) {
277 const Script& script = Script::Handle(cls.script()); 277 const Script& script = Script::Handle(cls.script());
278 ReportError(script, unresolved_class.token_index(), 278 ReportError(script, unresolved_class.token_index(),
279 "cannot resolve class name '%s' from '%s'.\n", 279 "cannot resolve class name '%s' from '%s'.\n",
280 String::Handle(unresolved_class.Name()).ToCString(), 280 String::Handle(unresolved_class.Name()).ToCString(),
281 String::Handle(cls.Name()).ToCString()); 281 String::Handle(cls.Name()).ToCString());
282 } 282 }
283 return resolved_class.raw(); 283 return resolved_class.raw();
284 } 284 }
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 va_end(args); 1224 va_end(args);
1225 if (FLAG_warning_as_error) { 1225 if (FLAG_warning_as_error) {
1226 Isolate::Current()->long_jump_base()->Jump(1, error); 1226 Isolate::Current()->long_jump_base()->Jump(1, error);
1227 UNREACHABLE(); 1227 UNREACHABLE();
1228 } else { 1228 } else {
1229 OS::Print("%s", error.ToErrorCString()); 1229 OS::Print("%s", error.ToErrorCString());
1230 } 1230 }
1231 } 1231 }
1232 1232
1233 } // namespace dart 1233 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698