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

Side by Side Diff: runtime/vm/object_test.cc

Issue 19662003: Refactor resolution code in the vm to properly handle ambiguity errors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/assembler.h" 6 #include "vm/assembler.h"
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 3205 matching lines...) Expand 10 before | Expand all | Expand 10 after
3216 static RawField* GetField(const Class& cls, const char* name) { 3216 static RawField* GetField(const Class& cls, const char* name) {
3217 const Field& field = 3217 const Field& field =
3218 Field::Handle(cls.LookupField(String::Handle(String::New(name)))); 3218 Field::Handle(cls.LookupField(String::Handle(String::New(name))));
3219 ASSERT(!field.IsNull()); 3219 ASSERT(!field.IsNull());
3220 return field.raw(); 3220 return field.raw();
3221 } 3221 }
3222 3222
3223 3223
3224 static RawClass* GetClass(const Library& lib, const char* name) { 3224 static RawClass* GetClass(const Library& lib, const char* name) {
3225 const Class& cls = 3225 const Class& cls =
3226 Class::Handle(lib.LookupClass(String::Handle(Symbols::New(name)))); 3226 Class::Handle(lib.LookupClass(String::Handle(Symbols::New(name)), NULL));
3227 ASSERT(!cls.IsNull()); 3227 ASSERT(!cls.IsNull());
3228 return cls.raw(); 3228 return cls.raw();
3229 } 3229 }
3230 3230
3231 3231
3232 static void PrintMetadata(const char* name, const Object& data) { 3232 static void PrintMetadata(const char* name, const Object& data) {
3233 if (data.IsError()) { 3233 if (data.IsError()) {
3234 OS::Print("Error in metadata evaluation for %s: '%s'\n", 3234 OS::Print("Error in metadata evaluation for %s: '%s'\n",
3235 name, 3235 name,
3236 Error::Cast(data).ToErrorCString()); 3236 Error::Cast(data).ToErrorCString());
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
3345 " b - 2 : b;\n" 3345 " b - 2 : b;\n"
3346 " }\n" 3346 " }\n"
3347 "}"; 3347 "}";
3348 TestCase::LoadTestScript(kScriptChars, NULL); 3348 TestCase::LoadTestScript(kScriptChars, NULL);
3349 EXPECT(ClassFinalizer::FinalizePendingClasses()); 3349 EXPECT(ClassFinalizer::FinalizePendingClasses());
3350 const String& name = String::Handle(String::New(TestCase::url())); 3350 const String& name = String::Handle(String::New(TestCase::url()));
3351 const Library& lib = Library::Handle(Library::LookupLibrary(name)); 3351 const Library& lib = Library::Handle(Library::LookupLibrary(name));
3352 EXPECT(!lib.IsNull()); 3352 EXPECT(!lib.IsNull());
3353 3353
3354 const Class& class_a = Class::Handle( 3354 const Class& class_a = Class::Handle(
3355 lib.LookupClass(String::Handle(Symbols::New("A")))); 3355 lib.LookupClass(String::Handle(Symbols::New("A")), NULL));
3356 const Function& test1 = Function::Handle(GetFunction(class_a, "test1")); 3356 const Function& test1 = Function::Handle(GetFunction(class_a, "test1"));
3357 const Function& test2 = Function::Handle(GetFunction(class_a, "test2")); 3357 const Function& test2 = Function::Handle(GetFunction(class_a, "test2"));
3358 const Function& test3 = Function::Handle(GetFunction(class_a, "test3")); 3358 const Function& test3 = Function::Handle(GetFunction(class_a, "test3"));
3359 const Function& test4 = Function::Handle(GetFunction(class_a, "test4")); 3359 const Function& test4 = Function::Handle(GetFunction(class_a, "test4"));
3360 const Function& test5 = Function::Handle(GetFunction(class_a, "test5")); 3360 const Function& test5 = Function::Handle(GetFunction(class_a, "test5"));
3361 const Function& test6 = Function::Handle(GetFunction(class_a, "test6")); 3361 const Function& test6 = Function::Handle(GetFunction(class_a, "test6"));
3362 const Function& test7 = Function::Handle(GetFunction(class_a, "test7")); 3362 const Function& test7 = Function::Handle(GetFunction(class_a, "test7"));
3363 EXPECT_EQ(test1.SourceFingerprint(), test2.SourceFingerprint()); 3363 EXPECT_EQ(test1.SourceFingerprint(), test2.SourceFingerprint());
3364 EXPECT_NE(test1.SourceFingerprint(), test3.SourceFingerprint()); 3364 EXPECT_NE(test1.SourceFingerprint(), test3.SourceFingerprint());
3365 EXPECT_NE(test3.SourceFingerprint(), test4.SourceFingerprint()); 3365 EXPECT_NE(test3.SourceFingerprint(), test4.SourceFingerprint());
3366 EXPECT_NE(test4.SourceFingerprint(), test5.SourceFingerprint()); 3366 EXPECT_NE(test4.SourceFingerprint(), test5.SourceFingerprint());
3367 EXPECT_NE(test5.SourceFingerprint(), test6.SourceFingerprint()); 3367 EXPECT_NE(test5.SourceFingerprint(), test6.SourceFingerprint());
3368 EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint()); 3368 EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint());
3369 } 3369 }
3370 3370
3371 } // namespace dart 3371 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698