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

Side by Side Diff: runtime/vm/guard_field_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/flow_graph_builder_test.cc ('k') | runtime/vm/heap_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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "vm/dart_api_impl.h" 5 #include "vm/dart_api_impl.h"
6 #include "vm/dart_api_state.h" 6 #include "vm/dart_api_state.h"
7 #include "vm/object.h" 7 #include "vm/object.h"
8 #include "vm/unit_test.h" 8 #include "vm/unit_test.h"
9 9
10 namespace dart { 10 namespace dart {
11 11
12 RawField* LookupField(Dart_Handle library, const char* class_name, 12 RawField* LookupField(Dart_Handle library, const char* class_name,
13 const char* field_name) { 13 const char* field_name) {
14 RawLibrary* raw_library = Library::RawCast(Api::UnwrapHandle(library)); 14 RawLibrary* raw_library = Library::RawCast(Api::UnwrapHandle(library));
15 Library& lib = Library::ZoneHandle(raw_library); 15 Library& lib = Library::ZoneHandle(raw_library);
16 const String& classname = String::Handle(Symbols::New(class_name)); 16 const String& classname = String::Handle(Symbols::New(Thread::Current(),
17 class_name));
17 Class& cls = Class::Handle(lib.LookupClass(classname)); 18 Class& cls = Class::Handle(lib.LookupClass(classname));
18 EXPECT(!cls.IsNull()); // No ambiguity error expected. 19 EXPECT(!cls.IsNull()); // No ambiguity error expected.
19 20
20 String& fieldname = String::Handle(String::New(field_name)); 21 String& fieldname = String::Handle(String::New(field_name));
21 Field& field = 22 Field& field =
22 Field::ZoneHandle(cls.LookupInstanceFieldAllowPrivate(fieldname)); 23 Field::ZoneHandle(cls.LookupInstanceFieldAllowPrivate(fieldname));
23 EXPECT(!field.IsNull()); 24 EXPECT(!field.IsNull());
24 return field.raw(); 25 return field.raw();
25 } 26 }
26 27
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); 274 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
274 EXPECT_VALID(result); 275 EXPECT_VALID(result);
275 Field& f3 = Field::ZoneHandle(LookupField(lib, "A", "f3")); 276 Field& f3 = Field::ZoneHandle(LookupField(lib, "A", "f3"));
276 const intptr_t no_length = Field::kNoFixedLength; 277 const intptr_t no_length = Field::kNoFixedLength;
277 EXPECT_EQ(no_length, f3.guarded_list_length()); 278 EXPECT_EQ(no_length, f3.guarded_list_length());
278 EXPECT_EQ(kTypedDataFloat32ArrayCid, f3.guarded_cid()); 279 EXPECT_EQ(kTypedDataFloat32ArrayCid, f3.guarded_cid());
279 EXPECT_EQ(false, f3.is_nullable()); 280 EXPECT_EQ(false, f3.is_nullable());
280 } 281 }
281 282
282 } // namespace dart 283 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder_test.cc ('k') | runtime/vm/heap_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698