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

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

Issue 1868803002: Use symbols when looking up fields in a class (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/exceptions.h" 5 #include "vm/exceptions.h"
6 6
7 #include "platform/address_sanitizer.h" 7 #include "platform/address_sanitizer.h"
8 8
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 const Library& core_lib = Library::Handle(zone, Library::CoreLibrary()); 263 const Library& core_lib = Library::Handle(zone, Library::CoreLibrary());
264 error_class = core_lib.LookupClass(Symbols::Error()); 264 error_class = core_lib.LookupClass(Symbols::Error());
265 ASSERT(!error_class.IsNull()); 265 ASSERT(!error_class.IsNull());
266 isolate->object_store()->set_error_class(error_class); 266 isolate->object_store()->set_error_class(error_class);
267 } 267 }
268 // If instance class extends 'class Error' return '_stackTrace' field. 268 // If instance class extends 'class Error' return '_stackTrace' field.
269 Class& test_class = Class::Handle(zone, instance.clazz()); 269 Class& test_class = Class::Handle(zone, instance.clazz());
270 AbstractType& type = AbstractType::Handle(zone, AbstractType::null()); 270 AbstractType& type = AbstractType::Handle(zone, AbstractType::null());
271 while (true) { 271 while (true) {
272 if (test_class.raw() == error_class.raw()) { 272 if (test_class.raw() == error_class.raw()) {
273 return error_class.LookupInstanceField(Symbols::_stackTrace()); 273 return error_class.LookupInstanceFieldAllowPrivate(
274 Symbols::_stackTrace());
274 } 275 }
275 type = test_class.super_type(); 276 type = test_class.super_type();
276 if (type.IsNull()) return Field::null(); 277 if (type.IsNull()) return Field::null();
277 test_class = type.type_class(); 278 test_class = type.type_class();
278 } 279 }
279 UNREACHABLE(); 280 UNREACHABLE();
280 return Field::null(); 281 return Field::null();
281 } 282 }
282 283
283 284
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 } 712 }
712 713
713 return DartLibraryCalls::InstanceCreate(library, 714 return DartLibraryCalls::InstanceCreate(library,
714 *class_name, 715 *class_name,
715 *constructor_name, 716 *constructor_name,
716 arguments); 717 arguments);
717 } 718 }
718 719
719 720
720 } // namespace dart 721 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/guard_field_test.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698