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

Side by Side Diff: runtime/vm/stack_frame.cc

Issue 23494026: Change inlined stack frame iterator to use code and pc instead of frame. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/stack_frame.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/stack_frame.h" 5 #include "vm/stack_frame.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/deopt_instructions.h" 8 #include "vm/deopt_instructions.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 ASSERT(!frames_.HasNext()); 336 ASSERT(!frames_.HasNext());
337 entry_.sp_ = frames_.sp_; 337 entry_.sp_ = frames_.sp_;
338 entry_.fp_ = frames_.fp_; 338 entry_.fp_ = frames_.fp_;
339 entry_.pc_ = frames_.pc_; 339 entry_.pc_ = frames_.pc_;
340 SetupNextExitFrameData(); // Setup data for next exit frame in chain. 340 SetupNextExitFrameData(); // Setup data for next exit frame in chain.
341 ASSERT(entry_.IsValid()); 341 ASSERT(entry_.IsValid());
342 return &entry_; 342 return &entry_;
343 } 343 }
344 344
345 345
346 InlinedFunctionsIterator::InlinedFunctionsIterator(StackFrame* frame) 346 InlinedFunctionsIterator::InlinedFunctionsIterator(const Code& code, uword pc)
347 : index_(0), 347 : index_(0),
348 code_(Code::Handle()), 348 code_(Code::Handle(code.raw())),
349 deopt_info_(DeoptInfo::Handle()), 349 deopt_info_(DeoptInfo::Handle()),
350 function_(Function::Handle()), 350 function_(Function::Handle()),
351 pc_(0), 351 pc_(pc),
352 deopt_instructions_(), 352 deopt_instructions_(),
353 object_table_(Array::Handle()) { 353 object_table_(Array::Handle()) {
siva 2013/09/04 19:32:42 Need an assertion here to ensure that the passed i
srdjan 2013/09/04 19:36:03 Done.
354 ASSERT(frame != NULL);
355 code_ = frame->LookupDartCode();
356 ASSERT(code_.is_optimized()); 354 ASSERT(code_.is_optimized());
357 intptr_t deopt_reason = kDeoptUnknown; 355 intptr_t deopt_reason = kDeoptUnknown;
358 deopt_info_ = code_.GetDeoptInfoAtPc(frame->pc(), &deopt_reason); 356 deopt_info_ = code_.GetDeoptInfoAtPc(pc, &deopt_reason);
359 if (deopt_info_.IsNull()) { 357 if (deopt_info_.IsNull()) {
360 // This is the case when a call without deopt info in optimized code 358 // This is the case when a call without deopt info in optimized code
361 // throws an exception. (e.g. in the parameter copying prologue). 359 // throws an exception. (e.g. in the parameter copying prologue).
362 // In that case there won't be any inlined frames. 360 // In that case there won't be any inlined frames.
363 function_ = code_.function(); 361 function_ = code_.function();
364 pc_ = frame->pc();
365 ASSERT(pc_ != 0); 362 ASSERT(pc_ != 0);
366 } else { 363 } else {
367 // Unpack deopt info into instructions (translate away suffixes). 364 // Unpack deopt info into instructions (translate away suffixes).
368 const Array& deopt_table = Array::Handle(code_.deopt_info_array()); 365 const Array& deopt_table = Array::Handle(code_.deopt_info_array());
369 ASSERT(!deopt_table.IsNull()); 366 ASSERT(!deopt_table.IsNull());
370 deopt_info_.ToInstructions(deopt_table, &deopt_instructions_); 367 deopt_info_.ToInstructions(deopt_table, &deopt_instructions_);
371 object_table_ = code_.object_table(); 368 object_table_ = code_.object_table();
372 Advance(); 369 Advance();
373 } 370 }
374 } 371 }
(...skipping 17 matching lines...) Expand all
392 pc_ = DeoptInstr::GetRetAddress(deopt_instr, object_table_, &func); 389 pc_ = DeoptInstr::GetRetAddress(deopt_instr, object_table_, &func);
393 code_ = func.unoptimized_code(); 390 code_ = func.unoptimized_code();
394 function_ = func.raw(); 391 function_ = func.raw();
395 return; 392 return;
396 } 393 }
397 } 394 }
398 SetDone(); 395 SetDone();
399 } 396 }
400 397
401 } // namespace dart 398 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/stack_frame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698