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

Unified Diff: runtime/vm/exceptions.cc

Issue 23638003: Improve performance of exception handling: quicker (and correcter) determination if the exception c… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/exceptions.cc
===================================================================
--- runtime/vm/exceptions.cc (revision 26885)
+++ runtime/vm/exceptions.cc (working copy)
@@ -378,15 +378,18 @@
ASSERT(!error_class.IsNull());
isolate->object_store()->set_error_class(error_class);
}
- const Class& instance_class = Class::Handle(isolate, instance.clazz());
- Error& malformed_type_error = Error::Handle(isolate);
- if (instance_class.IsSubtypeOf(Object::null_abstract_type_arguments(),
- error_class,
- Object::null_abstract_type_arguments(),
- &malformed_type_error)) {
- ASSERT(malformed_type_error.IsNull());
- return error_class.LookupInstanceField(Symbols::_stackTrace());
- }
+
+ Class& test_class = Class::Handle(isolate, instance.clazz());
Ivan Posva 2013/08/29 19:35:19 // Comments please.
srdjan 2013/08/29 19:37:29 Done.
+ AbstractType& type = AbstractType::Handle(isolate, AbstractType::null());
+ while (true) {
+ if (test_class.raw() == error_class.raw()) {
+ return error_class.LookupInstanceField(Symbols::_stackTrace());
+ }
+ type = test_class.super_type();
+ if (type.IsNull()) return Field::null();
+ test_class = type.type_class();
+ };
+ UNREACHABLE();
return Field::null();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698