Chromium Code Reviews| Index: vm/debugger.cc |
| =================================================================== |
| --- vm/debugger.cc (revision 18152) |
| +++ vm/debugger.cc (working copy) |
| @@ -135,11 +135,12 @@ |
| ActivationFrame::ActivationFrame(uword pc, uword fp, uword sp, |
| + const Code& code, |
| const Context& ctx) |
| : pc_(pc), fp_(fp), sp_(sp), |
| ctx_(Context::ZoneHandle(ctx.raw())), |
| - function_(Function::ZoneHandle()), |
| - code_(Code::ZoneHandle()), |
| + code_(Code::ZoneHandle(code.raw())), |
| + function_(Function::ZoneHandle(code.function())), |
| token_pos_(-1), |
| pc_desc_index_(-1), |
| line_number_(-1), |
| @@ -152,19 +153,13 @@ |
| const Code& ActivationFrame::DartCode() { |
|
hausner
2013/02/06 01:22:15
As discussed offline, this can now be a simple acc
siva
2013/02/06 01:41:43
Done.
|
| - if (code_.IsNull()) { |
| - Isolate* isolate = Isolate::Current(); |
| - ASSERT(isolate != NULL); |
| - code_ = Code::LookupCode(pc_); |
| - } |
| + ASSERT(!code_.IsNull()); |
| return code_; |
| } |
| const Function& ActivationFrame::DartFunction() { |
|
hausner
2013/02/06 01:22:15
Ditto, turn into function().
siva
2013/02/06 01:41:43
Done.
|
| - if (function_.IsNull()) { |
| - function_ = DartCode().function(); |
| - } |
| + ASSERT(!function_.IsNull()); |
| return function_; |
| } |
| @@ -880,15 +875,18 @@ |
| DebuggerStackTrace* Debugger::CollectStackTrace() { |
| + Isolate* isolate = Isolate::Current(); |
| DebuggerStackTrace* stack_trace = new DebuggerStackTrace(8); |
| - Context& ctx = Context::Handle(Isolate::Current()->top_context()); |
| + Context& ctx = Context::Handle(isolate->top_context()); |
| + Code& code = Code::Handle(isolate); |
| DartFrameIterator iterator; |
| StackFrame* frame = iterator.NextFrame(); |
| while (frame != NULL) { |
| ASSERT(frame->IsValid()); |
| ASSERT(frame->IsDartFrame()); |
| + code = frame->LookupDartCode(); |
| ActivationFrame* activation = |
| - new ActivationFrame(frame->pc(), frame->fp(), frame->sp(), ctx); |
| + new ActivationFrame(frame->pc(), frame->fp(), frame->sp(), code, ctx); |
| ctx = activation->CallerContext(); |
| stack_trace->AddActivation(activation); |
| frame = iterator.NextFrame(); |