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

Unified Diff: runtime/vm/debugger.cc

Issue 11970024: Simplify exception handler table (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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/code_descriptors.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
===================================================================
--- runtime/vm/debugger.cc (revision 17167)
+++ runtime/vm/debugger.cc (working copy)
@@ -378,20 +378,6 @@
}
-// TODO(hausner): Eliminate this helper function by sorting the
-// ExceptionHandlers entries by try_index and eliminating
-// the try_index field altogether.
-static intptr_t FindTryIndex(const ExceptionHandlers& handlers,
- intptr_t try_index) {
- intptr_t len = handlers.Length();
- for (int i = 0; i < len; i++) {
- if (handlers.TryIndex(i) == try_index) return i;
- }
- UNREACHABLE();
- return -1;
-}
-
-
ActivationFrame* DebuggerStackTrace::GetHandlerFrame(
const Instance& exc_obj) const {
ExceptionHandlers& handlers = ExceptionHandlers::Handle();
@@ -407,11 +393,10 @@
ASSERT(!handlers.IsNull());
intptr_t num_handlers_checked = 0;
while (try_index >= 0) {
- intptr_t i = FindTryIndex(handlers, try_index);
// Detect circles in the exception handler data.
num_handlers_checked++;
ASSERT(num_handlers_checked <= handlers.Length());
- handled_types = handlers.GetHandledTypes(i);
+ handled_types = handlers.GetHandledTypes(try_index);
const intptr_t num_types = handled_types.Length();
for (int k = 0; k < num_types; k++) {
type ^= handled_types.At(k);
@@ -424,7 +409,7 @@
return frame;
}
}
- try_index = handlers.OuterTryIndex(i);
+ try_index = handlers.OuterTryIndex(try_index);
}
}
return NULL;
« no previous file with comments | « runtime/vm/code_descriptors.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698