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

Unified Diff: runtime/vm/debugger.cc

Issue 12179020: Fix for issues 6080 - pass in the Isolate's top context into the stub for invoking dart code from n… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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/debugger.h ('k') | runtime/vm/flow_graph_builder.cc » ('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 18232)
+++ runtime/vm/debugger.cc (working copy)
@@ -134,11 +134,9 @@
}
-ActivationFrame::ActivationFrame(uword pc, uword fp, uword sp,
- const Code& code,
- const Context& ctx)
+ActivationFrame::ActivationFrame(uword pc, uword fp, uword sp, const Code& code)
: pc_(pc), fp_(fp), sp_(sp),
- ctx_(Context::ZoneHandle(ctx.raw())),
+ ctx_(Context::ZoneHandle()),
code_(Code::ZoneHandle(code.raw())),
function_(Function::ZoneHandle(code.function())),
token_pos_(-1),
@@ -340,7 +338,7 @@
}
-RawContext* ActivationFrame::CallerContext() {
+RawContext* ActivationFrame::GetSavedContext() {
GetVarDescriptors();
intptr_t var_desc_len = var_descriptors_.Length();
for (int i = 0; i < var_desc_len; i++) {
@@ -350,8 +348,8 @@
return reinterpret_cast<RawContext*>(GetLocalVarValue(var_info.index));
}
}
- // Caller uses same context chain.
- return ctx_.raw();
+ UNREACHABLE();
+ return Context::null();
}
@@ -859,16 +857,27 @@
DebuggerStackTrace* stack_trace = new DebuggerStackTrace(8);
Context& ctx = Context::Handle(isolate->top_context());
Code& code = Code::Handle(isolate);
- DartFrameIterator iterator;
+ StackFrameIterator iterator(false);
StackFrame* frame = iterator.NextFrame();
+ bool get_saved_context = false;
while (frame != NULL) {
ASSERT(frame->IsValid());
- ASSERT(frame->IsDartFrame());
- code = frame->LookupDartCode();
- ActivationFrame* activation =
- new ActivationFrame(frame->pc(), frame->fp(), frame->sp(), code, ctx);
- ctx = activation->CallerContext();
- stack_trace->AddActivation(activation);
+ if (frame->IsDartFrame()) {
+ code = frame->LookupDartCode();
+ ActivationFrame* activation = new ActivationFrame(frame->pc(),
+ frame->fp(),
+ frame->sp(),
+ code);
+ if (get_saved_context) {
+ ctx = activation->GetSavedContext();
+ }
+ activation->SetContext(ctx);
+ stack_trace->AddActivation(activation);
+ get_saved_context = activation->function().IsClosureFunction();
+ } else if (frame->IsEntryFrame()) {
+ ctx = reinterpret_cast<EntryFrame*>(frame)->SavedContext();
+ get_saved_context = false;
+ }
frame = iterator.NextFrame();
}
return stack_trace;
« no previous file with comments | « runtime/vm/debugger.h ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698