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

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

Issue 1870343002: - Refactor Symbol allocation to expect a thread parameter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review feedback. Created 4 years, 8 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
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/code_descriptors_test.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/class_finalizer.h" 6 #include "vm/class_finalizer.h"
7 #include "vm/symbols.h" 7 #include "vm/symbols.h"
8 #include "vm/unit_test.h" 8 #include "vm/unit_test.h"
9 9
10 namespace dart { 10 namespace dart {
11 11
12 12
13 static RawClass* CreateTestClass(const char* name) { 13 static RawClass* CreateTestClass(const char* name) {
14 const String& class_name = String::Handle(Symbols::New(name)); 14 const String& class_name = String::Handle(Symbols::New(Thread::Current(),
15 name));
15 const Script& script = Script::Handle(); 16 const Script& script = Script::Handle();
16 const Class& cls = Class::Handle( 17 const Class& cls = Class::Handle(
17 Class::New(class_name, script, TokenPosition::kNoSource)); 18 Class::New(class_name, script, TokenPosition::kNoSource));
18 cls.set_interfaces(Object::empty_array()); 19 cls.set_interfaces(Object::empty_array());
19 cls.SetFunctions(Object::empty_array()); 20 cls.SetFunctions(Object::empty_array());
20 cls.SetFields(Object::empty_array()); 21 cls.SetFields(Object::empty_array());
21 return cls.raw(); 22 return cls.raw();
22 } 23 }
23 24
24 25
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // Create a cycle. 68 // Create a cycle.
68 classes[0]->set_super_type( 69 classes[0]->set_super_type(
69 Type::Handle(Type::NewNonParameterizedType(*classes[1]))); 70 Type::Handle(Type::NewNonParameterizedType(*classes[1])));
70 classes[1]->set_super_type( 71 classes[1]->set_super_type(
71 Type::Handle(Type::NewNonParameterizedType(*classes[0]))); 72 Type::Handle(Type::NewNonParameterizedType(*classes[0])));
72 EXPECT(!ClassFinalizer::ProcessPendingClasses()); 73 EXPECT(!ClassFinalizer::ProcessPendingClasses());
73 } 74 }
74 75
75 76
76 static RawLibrary* NewLib(const char* url_chars) { 77 static RawLibrary* NewLib(const char* url_chars) {
77 String& url = String::ZoneHandle(Symbols::New(url_chars)); 78 String& url = String::ZoneHandle(Symbols::New(Thread::Current(), url_chars));
78 return Library::New(url); 79 return Library::New(url);
79 } 80 }
80 81
81 82
82 TEST_CASE(ClassFinalize_Resolve) { 83 TEST_CASE(ClassFinalize_Resolve) {
83 Zone* zone = thread->zone(); 84 Zone* zone = thread->zone();
84 Isolate* isolate = thread->isolate(); 85 Isolate* isolate = thread->isolate();
85 ObjectStore* object_store = isolate->object_store(); 86 ObjectStore* object_store = isolate->object_store();
86 const GrowableObjectArray& pending_classes = 87 const GrowableObjectArray& pending_classes =
87 GrowableObjectArray::Handle(zone, object_store->pending_classes()); 88 GrowableObjectArray::Handle(zone, object_store->pending_classes());
(...skipping 11 matching lines...) Expand all
99 TokenPosition::kNoSource)); 100 TokenPosition::kNoSource));
100 const TypeArguments& type_arguments = TypeArguments::Handle(); 101 const TypeArguments& type_arguments = TypeArguments::Handle();
101 rhb.set_super_type(Type::Handle( 102 rhb.set_super_type(Type::Handle(
102 Type::New(Object::Handle(unresolved.raw()), 103 Type::New(Object::Handle(unresolved.raw()),
103 type_arguments, 104 type_arguments,
104 TokenPosition::kNoSource))); 105 TokenPosition::kNoSource)));
105 EXPECT(ClassFinalizer::ProcessPendingClasses()); 106 EXPECT(ClassFinalizer::ProcessPendingClasses());
106 } 107 }
107 108
108 } // namespace dart 109 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/code_descriptors_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698