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

Unified Diff: vm/exceptions.cc

Issue 10824128: Eagerly get the function and code corresponding to the frame elements in a stack trace so that we w… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 5 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 | vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/exceptions.cc
===================================================================
--- vm/exceptions.cc (revision 10127)
+++ vm/exceptions.cc (working copy)
@@ -27,13 +27,21 @@
static bool FindExceptionHandler(uword* handler_pc,
uword* handler_sp,
uword* handler_fp,
- GrowableArray<uword>* stack_frame_pcs) {
+ GrowableArray<uword>* stack_frame_pcs,
+ const GrowableObjectArray& func_list,
+ const GrowableObjectArray& code_list) {
Ivan Posva 2012/08/03 20:49:53 How about this: FindExceptionHandler(... const
StackFrameIterator frames(StackFrameIterator::kDontValidateFrames);
StackFrame* frame = frames.NextFrame();
ASSERT(frame != NULL);
+ Function& func = Function::Handle();
+ Code& code = Code::Handle();
while (!frame->IsEntryFrame()) {
if (frame->IsDartFrame()) {
stack_frame_pcs->Add(frame->pc());
+ func = frame->LookupDartFunction();
+ code = frame->LookupDartCode();
+ func_list.Add(func);
+ code_list.Add(code);
if (frame->FindExceptionHandler(handler_pc)) {
*handler_sp = frame->sp();
*handler_fp = frame->fp();
@@ -136,20 +144,26 @@
uword handler_sp = 0;
uword handler_fp = 0;
GrowableArray<uword> stack_frame_pcs;
+ const GrowableObjectArray& func_list =
+ GrowableObjectArray::Handle(GrowableObjectArray::New());
+ const GrowableObjectArray& code_list =
+ GrowableObjectArray::Handle(GrowableObjectArray::New());
bool handler_exists = FindExceptionHandler(&handler_pc,
&handler_sp,
&handler_fp,
- &stack_frame_pcs);
+ &stack_frame_pcs,
+ func_list,
+ code_list);
// TODO(5411263): At some point we can optimize by figuring out if a
// stack trace is needed based on whether the catch code specifies a
// stack trace object or there is a rethrow in the catch clause.
Stacktrace& stacktrace = Stacktrace::Handle();
if (!stack_frame_pcs.is_empty()) {
if (existing_stacktrace.IsNull()) {
- stacktrace = Stacktrace::New(stack_frame_pcs);
+ stacktrace = Stacktrace::New(stack_frame_pcs, func_list, code_list);
} else {
stacktrace ^= existing_stacktrace.raw();
- stacktrace.Append(stack_frame_pcs);
+ stacktrace.Append(stack_frame_pcs, func_list, code_list);
}
} else {
stacktrace ^= existing_stacktrace.raw();
« no previous file with comments | « no previous file | vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698