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

Unified Diff: vm/debugger.cc

Issue 12225031: Minor cleanup of activation frame creation code. Get the code object while iterating the frames as … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
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 | « vm/debugger.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « vm/debugger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698