| 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 "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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 void InlinedFunctionsIterator::Advance() { | 397 void InlinedFunctionsIterator::Advance() { |
| 398 // Iterate over the deopt instructions and determine the inlined | 398 // Iterate over the deopt instructions and determine the inlined |
| 399 // functions if any and iterate over them. | 399 // functions if any and iterate over them. |
| 400 ASSERT(!Done()); | 400 ASSERT(!Done()); |
| 401 | 401 |
| 402 if (deopt_info_.IsNull()) { | 402 if (deopt_info_.IsNull()) { |
| 403 SetDone(); | 403 SetDone(); |
| 404 return; | 404 return; |
| 405 } | 405 } |
| 406 | 406 |
| 407 Function& func = Function::Handle(); | |
| 408 ASSERT(deopt_instructions_.length() != 0); | 407 ASSERT(deopt_instructions_.length() != 0); |
| 409 while (index_ < deopt_instructions_.length()) { | 408 while (index_ < deopt_instructions_.length()) { |
| 410 DeoptInstr* deopt_instr = deopt_instructions_[index_++]; | 409 DeoptInstr* deopt_instr = deopt_instructions_[index_++]; |
| 411 if (deopt_instr->kind() == DeoptInstr::kRetAddress) { | 410 if (deopt_instr->kind() == DeoptInstr::kRetAddress) { |
| 412 pc_ = DeoptInstr::GetRetAddress(deopt_instr, object_table_, &func); | 411 pc_ = DeoptInstr::GetRetAddress(deopt_instr, object_table_, &code_); |
| 413 code_ = func.unoptimized_code(); | 412 function_ = code_.function(); |
| 414 function_ = func.raw(); | |
| 415 return; | 413 return; |
| 416 } | 414 } |
| 417 } | 415 } |
| 418 SetDone(); | 416 SetDone(); |
| 419 } | 417 } |
| 420 | 418 |
| 421 | 419 |
| 422 // Finds the potential offset for the current function's FP if the | 420 // Finds the potential offset for the current function's FP if the |
| 423 // current frame were to be deoptimized. | 421 // current frame were to be deoptimized. |
| 424 intptr_t InlinedFunctionsIterator::GetDeoptFpOffset() const { | 422 intptr_t InlinedFunctionsIterator::GetDeoptFpOffset() const { |
| 425 ASSERT(deopt_instructions_.length() != 0); | 423 ASSERT(deopt_instructions_.length() != 0); |
| 426 for (intptr_t index = index_; | 424 for (intptr_t index = index_; |
| 427 index < deopt_instructions_.length(); | 425 index < deopt_instructions_.length(); |
| 428 index++) { | 426 index++) { |
| 429 DeoptInstr* deopt_instr = deopt_instructions_[index]; | 427 DeoptInstr* deopt_instr = deopt_instructions_[index]; |
| 430 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { | 428 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { |
| 431 return (index - num_materializations_); | 429 return (index - num_materializations_); |
| 432 } | 430 } |
| 433 } | 431 } |
| 434 UNREACHABLE(); | 432 UNREACHABLE(); |
| 435 return 0; | 433 return 0; |
| 436 } | 434 } |
| 437 | 435 |
| 438 | 436 |
| 439 } // namespace dart | 437 } // namespace dart |
| OLD | NEW |