diff options
author | 2016-02-19 12:43:12 +0000 | |
---|---|---|
committer | 2016-02-19 12:43:12 +0000 | |
commit | b52de2427700ebdecc904aa2f3f59a079319abd5 (patch) | |
tree | 1dda0a3061f62bfd2dd13a9dad0fac75d41c2d51 /runtime/quick_exception_handler.cc | |
parent | 52d9c2f0c584877e9c7f9e859d8068b3a2ccb12f (diff) |
Fix braino in single frame deopt.
handler_method_header_ is actually the OatQuickMethodHeader
of the caller of the method that is deoptimizing (as we will
resume at its call site). We should use the OatQuickMethodHeader
of the method that is deoptimizing and pass it to the code cache
to invalidate the method.
Change-Id: I2b61a96b8415e9477e3ac902c54a314aeb0811a0
Diffstat (limited to 'runtime/quick_exception_handler.cc')
-rw-r--r-- | runtime/quick_exception_handler.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc index dd384c7586..2dfa860dcb 100644 --- a/runtime/quick_exception_handler.cc +++ b/runtime/quick_exception_handler.cc @@ -290,13 +290,18 @@ class DeoptimizeStackVisitor FINAL : public StackVisitor { stacked_shadow_frame_pushed_(false), single_frame_deopt_(single_frame), single_frame_done_(false), - single_frame_deopt_method_(nullptr) { + single_frame_deopt_method_(nullptr), + single_frame_deopt_quick_method_header_(nullptr) { } ArtMethod* GetSingleFrameDeoptMethod() const { return single_frame_deopt_method_; } + const OatQuickMethodHeader* GetSingleFrameDeoptQuickMethodHeader() const { + return single_frame_deopt_quick_method_header_; + } + bool VisitFrame() OVERRIDE SHARED_REQUIRES(Locks::mutator_lock_) { exception_handler_->SetHandlerFrameDepth(GetFrameDepth()); ArtMethod* method = GetMethod(); @@ -368,6 +373,7 @@ class DeoptimizeStackVisitor FINAL : public StackVisitor { exception_handler_->SetHandlerQuickArg0(reinterpret_cast<uintptr_t>(method)); single_frame_done_ = true; single_frame_deopt_method_ = method; + single_frame_deopt_quick_method_header_ = GetCurrentOatQuickMethodHeader(); } return true; } @@ -603,6 +609,7 @@ class DeoptimizeStackVisitor FINAL : public StackVisitor { const bool single_frame_deopt_; bool single_frame_done_; ArtMethod* single_frame_deopt_method_; + const OatQuickMethodHeader* single_frame_deopt_quick_method_header_; DISALLOW_COPY_AND_ASSIGN(DeoptimizeStackVisitor); }; @@ -636,7 +643,7 @@ void QuickExceptionHandler::DeoptimizeSingleFrame() { DCHECK(deopt_method != nullptr); if (Runtime::Current()->UseJit()) { Runtime::Current()->GetJit()->GetCodeCache()->InvalidateCompiledCodeFor( - deopt_method, handler_method_header_); + deopt_method, visitor.GetSingleFrameDeoptQuickMethodHeader()); } else { // Transfer the code to interpreter. Runtime::Current()->GetInstrumentation()->UpdateMethodsCode( |