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

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

Issue 1016973002: Move CHA state keeping from Isolate to Thread. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 9 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 | « runtime/vm/cha.cc ('k') | runtime/vm/compiler.cc » ('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) 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 EXPECT(!class_c_foo.IsNull()); 73 EXPECT(!class_c_foo.IsNull());
74 74
75 const Function& class_d_foo = 75 const Function& class_d_foo =
76 Function::Handle(class_d.LookupDynamicFunction(function_foo_name)); 76 Function::Handle(class_d.LookupDynamicFunction(function_foo_name));
77 EXPECT(!class_d_foo.IsNull()); 77 EXPECT(!class_d_foo.IsNull());
78 78
79 const Function& class_d_bar = 79 const Function& class_d_bar =
80 Function::Handle(class_d.LookupDynamicFunction(function_bar_name)); 80 Function::Handle(class_d.LookupDynamicFunction(function_bar_name));
81 EXPECT(!class_d_bar.IsNull()); 81 EXPECT(!class_d_bar.IsNull());
82 82
83 CHA cha(Isolate::Current()); 83 CHA cha(Thread::Current());
84 84
85 EXPECT(cha.HasSubclasses(kInstanceCid)); 85 EXPECT(cha.HasSubclasses(kInstanceCid));
86 EXPECT(!cha.HasSubclasses(kSmiCid)); 86 EXPECT(!cha.HasSubclasses(kSmiCid));
87 EXPECT(!cha.HasSubclasses(kNullCid)); 87 EXPECT(!cha.HasSubclasses(kNullCid));
88 88
89 EXPECT(cha.HasSubclasses(class_a)); 89 EXPECT(cha.HasSubclasses(class_a));
90 EXPECT(cha.HasSubclasses(class_b)); 90 EXPECT(cha.HasSubclasses(class_b));
91 EXPECT(!cha.HasSubclasses(class_c)); 91 EXPECT(!cha.HasSubclasses(class_c));
92 EXPECT(!cha.HasSubclasses(class_d)); 92 EXPECT(!cha.HasSubclasses(class_d));
93 93
94 EXPECT(!ContainsCid(cha.leaf_classes(), class_a.id())); 94 EXPECT(!ContainsCid(cha.leaf_classes(), class_a.id()));
95 EXPECT(!ContainsCid(cha.leaf_classes(), class_b.id())); 95 EXPECT(!ContainsCid(cha.leaf_classes(), class_b.id()));
96 EXPECT(ContainsCid(cha.leaf_classes(), class_c.id())); 96 EXPECT(ContainsCid(cha.leaf_classes(), class_c.id()));
97 EXPECT(ContainsCid(cha.leaf_classes(), class_d.id())); 97 EXPECT(ContainsCid(cha.leaf_classes(), class_d.id()));
98 98
99 const Class& function_impl_class = 99 const Class& function_impl_class =
100 Class::Handle(Type::Handle(Isolate::Current()->object_store()-> 100 Class::Handle(Type::Handle(Isolate::Current()->object_store()->
101 function_impl_type()).type_class()); 101 function_impl_type()).type_class());
102 EXPECT(cha.HasSubclasses(function_impl_class.id())); 102 EXPECT(cha.HasSubclasses(function_impl_class.id()));
103 } 103 }
104 104
105 } // namespace dart 105 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/cha.cc ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698