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

Unified Diff: runtime/vm/object.cc

Issue 23445012: Mark exception handlers if they have a stacktrace specified. Do not build a stacktrace if the handl… (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 | « runtime/vm/object.h ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 26819)
+++ runtime/vm/object.cc (working copy)
@@ -8284,11 +8284,13 @@
void ExceptionHandlers::SetHandlerInfo(intptr_t try_index,
intptr_t outer_try_index,
- intptr_t handler_pc) const {
+ intptr_t handler_pc,
+ bool needs_stacktrace) const {
ASSERT((try_index >= 0) && (try_index < Length()));
RawExceptionHandlers::HandlerInfo* info = &raw_ptr()->data_[try_index];
info->outer_try_index = outer_try_index;
info->handler_pc = handler_pc;
+ info->needs_stacktrace = needs_stacktrace;
}
void ExceptionHandlers::GetHandlerInfo(
@@ -8314,6 +8316,12 @@
}
+bool ExceptionHandlers::NeedsStacktrace(intptr_t try_index) const {
+ ASSERT((try_index >= 0) && (try_index < Length()));
+ return raw_ptr()->data_[try_index].needs_stacktrace;
+}
+
+
void ExceptionHandlers::SetHandledTypes(intptr_t try_index,
const Array& handled_types) const {
ASSERT((try_index >= 0) && (try_index < Length()));
@@ -8331,6 +8339,19 @@
}
+bool ExceptionHandlers::HasCatchAll(intptr_t try_index) const {
+ ASSERT((try_index >= 0) && (try_index < Length()));
+ Array& array = Array::Handle(raw_ptr()->handled_types_data_);
+ array ^= array.At(try_index);
+ for (intptr_t i = 0; i < array.Length(); i++) {
+ if (array.At(i) == Type::DynamicType()) {
+ return true;
+ }
+ }
+ return false;
+}
+
+
void ExceptionHandlers::set_handled_types_data(const Array& value) const {
StorePointer(&raw_ptr()->handled_types_data_, value.raw());
}
@@ -8338,7 +8359,7 @@
RawExceptionHandlers* ExceptionHandlers::New(intptr_t num_handlers) {
ASSERT(Object::exception_handlers_class() != Class::null());
- if (num_handlers < 0 || num_handlers >= kMaxHandlers) {
+ if ((num_handlers < 0) || (num_handlers >= kMaxHandlers)) {
FATAL1("Fatal error in ExceptionHandlers::New(): "
"invalid num_handlers %" Pd "\n",
num_handlers);
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698