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

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

Issue 1955453002: - Use a map to lookup libraries by URL. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix precompiler handling. Created 4 years, 7 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
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/cha.h" 6 #include "vm/cha.h"
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #include "vm/symbols.h" 9 #include "vm/symbols.h"
10 #include "vm/unit_test.h" 10 #include "vm/unit_test.h"
(...skipping 20 matching lines...) Expand all
31 " foo() { }" 31 " foo() { }"
32 "}\n" 32 "}\n"
33 "class D extends A {" 33 "class D extends A {"
34 " foo() { }" 34 " foo() { }"
35 " bar() { }" 35 " bar() { }"
36 "}\n"; 36 "}\n";
37 37
38 TestCase::LoadTestScript(kScriptChars, NULL); 38 TestCase::LoadTestScript(kScriptChars, NULL);
39 EXPECT(ClassFinalizer::ProcessPendingClasses()); 39 EXPECT(ClassFinalizer::ProcessPendingClasses());
40 const String& name = String::Handle(String::New(TestCase::url())); 40 const String& name = String::Handle(String::New(TestCase::url()));
41 const Library& lib = Library::Handle(Library::LookupLibrary(name)); 41 const Library& lib = Library::Handle(Library::LookupLibrary(thread, name));
42 EXPECT(!lib.IsNull()); 42 EXPECT(!lib.IsNull());
43 43
44 const Class& class_a = Class::Handle( 44 const Class& class_a = Class::Handle(
45 lib.LookupClass(String::Handle(Symbols::New(thread, "A")))); 45 lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
46 EXPECT(!class_a.IsNull()); 46 EXPECT(!class_a.IsNull());
47 47
48 const Class& class_b = Class::Handle( 48 const Class& class_b = Class::Handle(
49 lib.LookupClass(String::Handle(Symbols::New(thread, "B")))); 49 lib.LookupClass(String::Handle(Symbols::New(thread, "B"))));
50 EXPECT(!class_b.IsNull()); 50 EXPECT(!class_b.IsNull());
51 51
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 EXPECT(!ContainsCid(cha.leaf_classes(), class_b.id())); 97 EXPECT(!ContainsCid(cha.leaf_classes(), class_b.id()));
98 EXPECT(ContainsCid(cha.leaf_classes(), class_c.id())); 98 EXPECT(ContainsCid(cha.leaf_classes(), class_c.id()));
99 EXPECT(ContainsCid(cha.leaf_classes(), class_d.id())); 99 EXPECT(ContainsCid(cha.leaf_classes(), class_d.id()));
100 100
101 const Class& closure_class = 101 const Class& closure_class =
102 Class::Handle(Isolate::Current()->object_store()->closure_class()); 102 Class::Handle(Isolate::Current()->object_store()->closure_class());
103 EXPECT(!cha.HasSubclasses(closure_class.id())); 103 EXPECT(!cha.HasSubclasses(closure_class.id()));
104 } 104 }
105 105
106 } // namespace dart 106 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698