| OLD | NEW |
| 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 24 matching lines...) Expand all Loading... |
| 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(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("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("B")))); | 49 lib.LookupClass(String::Handle(Symbols::New(thread, "B")))); |
| 50 EXPECT(!class_b.IsNull()); | 50 EXPECT(!class_b.IsNull()); |
| 51 | 51 |
| 52 const Class& class_c = Class::Handle( | 52 const Class& class_c = Class::Handle( |
| 53 lib.LookupClass(String::Handle(Symbols::New("C")))); | 53 lib.LookupClass(String::Handle(Symbols::New(thread, "C")))); |
| 54 EXPECT(!class_c.IsNull()); | 54 EXPECT(!class_c.IsNull()); |
| 55 | 55 |
| 56 const Class& class_d = Class::Handle( | 56 const Class& class_d = Class::Handle( |
| 57 lib.LookupClass(String::Handle(Symbols::New("D")))); | 57 lib.LookupClass(String::Handle(Symbols::New(thread, "D")))); |
| 58 EXPECT(!class_d.IsNull()); | 58 EXPECT(!class_d.IsNull()); |
| 59 | 59 |
| 60 const String& function_foo_name = String::Handle(String::New("foo")); | 60 const String& function_foo_name = String::Handle(String::New("foo")); |
| 61 const String& function_bar_name = String::Handle(String::New("bar")); | 61 const String& function_bar_name = String::Handle(String::New("bar")); |
| 62 | 62 |
| 63 const Function& class_a_foo = | 63 const Function& class_a_foo = |
| 64 Function::Handle(class_a.LookupDynamicFunction(function_foo_name)); | 64 Function::Handle(class_a.LookupDynamicFunction(function_foo_name)); |
| 65 EXPECT(!class_a_foo.IsNull()); | 65 EXPECT(!class_a_foo.IsNull()); |
| 66 | 66 |
| 67 const Function& class_a_bar = | 67 const Function& class_a_bar = |
| (...skipping 29 matching lines...) Expand all Loading... |
| 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 |
| OLD | NEW |