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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 if (deopt_instr->kind() == DeoptInstr::kRetAddress) { | 389 if (deopt_instr->kind() == DeoptInstr::kRetAddress) { |
390 pc_ = DeoptInstr::GetRetAddress(deopt_instr, object_table_, &func); | 390 pc_ = DeoptInstr::GetRetAddress(deopt_instr, object_table_, &func); |
391 code_ = func.unoptimized_code(); | 391 code_ = func.unoptimized_code(); |
392 function_ = func.raw(); | 392 function_ = func.raw(); |
393 return; | 393 return; |
394 } | 394 } |
395 } | 395 } |
396 SetDone(); | 396 SetDone(); |
397 } | 397 } |
398 | 398 |
| 399 |
| 400 // Finds the potential offset for the current function's FP if the |
| 401 // current frame were to be deoptimized. |
| 402 intptr_t InlinedFunctionsIterator::GetDeoptFpOffset() const { |
| 403 ASSERT(deopt_instructions_.length() != 0); |
| 404 for (intptr_t index = index_; |
| 405 index < deopt_instructions_.length(); |
| 406 index++) { |
| 407 DeoptInstr* deopt_instr = deopt_instructions_[index]; |
| 408 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { |
| 409 return index; |
| 410 } |
| 411 } |
| 412 UNREACHABLE(); |
| 413 return 0; |
| 414 } |
| 415 |
| 416 |
399 } // namespace dart | 417 } // namespace dart |
OLD | NEW |