OLD | NEW |
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 "platform/memory_sanitizer.h" | 7 #include "platform/memory_sanitizer.h" |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/deopt_instructions.h" | 9 #include "vm/deopt_instructions.h" |
10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 | 427 |
428 | 428 |
429 InlinedFunctionsIterator::InlinedFunctionsIterator(const Code& code, uword pc) | 429 InlinedFunctionsIterator::InlinedFunctionsIterator(const Code& code, uword pc) |
430 : index_(0), | 430 : index_(0), |
431 num_materializations_(0), | 431 num_materializations_(0), |
432 code_(Code::Handle(code.raw())), | 432 code_(Code::Handle(code.raw())), |
433 deopt_info_(TypedData::Handle()), | 433 deopt_info_(TypedData::Handle()), |
434 function_(Function::Handle()), | 434 function_(Function::Handle()), |
435 pc_(pc), | 435 pc_(pc), |
436 deopt_instructions_(), | 436 deopt_instructions_(), |
437 object_table_(Array::Handle()) { | 437 object_table_(ObjectPool::Handle()) { |
438 ASSERT(code_.is_optimized()); | 438 ASSERT(code_.is_optimized()); |
439 ASSERT(pc_ != 0); | 439 ASSERT(pc_ != 0); |
440 ASSERT(code.ContainsInstructionAt(pc)); | 440 ASSERT(code.ContainsInstructionAt(pc)); |
441 ICData::DeoptReasonId deopt_reason = ICData::kDeoptUnknown; | 441 ICData::DeoptReasonId deopt_reason = ICData::kDeoptUnknown; |
442 uint32_t deopt_flags = 0; | 442 uint32_t deopt_flags = 0; |
443 deopt_info_ = code_.GetDeoptInfoAtPc(pc, &deopt_reason, &deopt_flags); | 443 deopt_info_ = code_.GetDeoptInfoAtPc(pc, &deopt_reason, &deopt_flags); |
444 if (deopt_info_.IsNull()) { | 444 if (deopt_info_.IsNull()) { |
445 // This is the case when a call without deopt info in optimized code | 445 // This is the case when a call without deopt info in optimized code |
446 // throws an exception. (e.g. in the parameter copying prologue). | 446 // throws an exception. (e.g. in the parameter copying prologue). |
447 // In that case there won't be any inlined frames. | 447 // In that case there won't be any inlined frames. |
448 function_ = code_.function(); | 448 function_ = code_.function(); |
449 } else { | 449 } else { |
450 // Unpack deopt info into instructions (translate away suffixes). | 450 // Unpack deopt info into instructions (translate away suffixes). |
451 const Array& deopt_table = Array::Handle(code_.deopt_info_array()); | 451 const Array& deopt_table = Array::Handle(code_.deopt_info_array()); |
452 ASSERT(!deopt_table.IsNull()); | 452 ASSERT(!deopt_table.IsNull()); |
453 DeoptInfo::Unpack(deopt_table, deopt_info_, &deopt_instructions_); | 453 DeoptInfo::Unpack(deopt_table, deopt_info_, &deopt_instructions_); |
454 num_materializations_ = DeoptInfo::NumMaterializations(deopt_instructions_); | 454 num_materializations_ = DeoptInfo::NumMaterializations(deopt_instructions_); |
455 object_table_ = code_.ObjectPool(); | 455 object_table_ = code_.GetObjectPool(); |
456 Advance(); | 456 Advance(); |
457 } | 457 } |
458 } | 458 } |
459 | 459 |
460 | 460 |
461 void InlinedFunctionsIterator::Advance() { | 461 void InlinedFunctionsIterator::Advance() { |
462 // Iterate over the deopt instructions and determine the inlined | 462 // Iterate over the deopt instructions and determine the inlined |
463 // functions if any and iterate over them. | 463 // functions if any and iterate over them. |
464 ASSERT(!Done()); | 464 ASSERT(!Done()); |
465 | 465 |
(...skipping 26 matching lines...) Expand all Loading... |
492 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { | 492 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { |
493 return (index - num_materializations_); | 493 return (index - num_materializations_); |
494 } | 494 } |
495 } | 495 } |
496 UNREACHABLE(); | 496 UNREACHABLE(); |
497 return 0; | 497 return 0; |
498 } | 498 } |
499 | 499 |
500 | 500 |
501 } // namespace dart | 501 } // namespace dart |
OLD | NEW |