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

Unified Diff: runtime/vm/object_test.cc

Issue 11883023: Collect debugging info for catch clauses (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
Index: runtime/vm/object_test.cc
===================================================================
--- runtime/vm/object_test.cc (revision 17032)
+++ runtime/vm/object_test.cc (working copy)
@@ -2732,12 +2732,12 @@
// Add an exception handler table to the code.
ExceptionHandlers& exception_handlers = ExceptionHandlers::Handle();
exception_handlers ^= ExceptionHandlers::New(kNumEntries);
- exception_handlers.SetHandlerEntry(0, 10, 20);
- exception_handlers.SetHandlerEntry(1, 20, 30);
- exception_handlers.SetHandlerEntry(2, 30, 40);
- exception_handlers.SetHandlerEntry(3, 10, 40);
- exception_handlers.SetHandlerEntry(4, 10, 80);
- exception_handlers.SetHandlerEntry(5, 80, 150);
+ exception_handlers.SetHandlerInfo(0, 10, -1, 20);
+ exception_handlers.SetHandlerInfo(1, 20, 25, 30);
+ exception_handlers.SetHandlerInfo(2, 30, 35, 40);
+ exception_handlers.SetHandlerInfo(3, 10, 15, 40);
+ exception_handlers.SetHandlerInfo(4, 10, 15, 80);
+ exception_handlers.SetHandlerInfo(5, 80, 1, 150);
extern void GenerateIncrement(Assembler* assembler);
Assembler _assembler_;
@@ -2750,8 +2750,13 @@
const ExceptionHandlers& handlers =
ExceptionHandlers::Handle(code.exception_handlers());
EXPECT_EQ(kNumEntries, handlers.Length());
+ RawExceptionHandlers::HandlerInfo info;
+ handlers.GetHandlerInfo(0, &info);
EXPECT_EQ(10, handlers.TryIndex(0));
+ EXPECT_EQ(10, info.try_index);
+ EXPECT_EQ(-1, info.outer_try_index);
EXPECT_EQ(20, handlers.HandlerPC(0));
+ EXPECT_EQ(20, info.handler_pc);
EXPECT_EQ(80, handlers.TryIndex(5));
EXPECT_EQ(150, handlers.HandlerPC(5));
}

Powered by Google App Engine
This is Rietveld 408576698