diff options
| author | 2015-12-04 12:14:38 +0000 | |
|---|---|---|
| committer | 2015-12-04 12:14:38 +0000 | |
| commit | 099f2713ce4ed284c94239cc22d3a8c8d9cfe868 (patch) | |
| tree | 085738568288f978e1386edd25b7a28a988674c8 /runtime/quick_exception_handler.cc | |
| parent | 352c36e96e05d630aa3d570e66a4d9b645a96c37 (diff) | |
| parent | 73be1e8f8609708f6624bb297c9628de44fd8b6f (diff) | |
Merge "Inline monomorphic calls."
Diffstat (limited to 'runtime/quick_exception_handler.cc')
| -rw-r--r-- | runtime/quick_exception_handler.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc index 1552318c1e..9cb37eed58 100644 --- a/runtime/quick_exception_handler.cc +++ b/runtime/quick_exception_handler.cc @@ -283,7 +283,12 @@ class DeoptimizeStackVisitor FINAL : public StackVisitor { prev_shadow_frame_(nullptr), stacked_shadow_frame_pushed_(false), single_frame_deopt_(single_frame), - single_frame_done_(false) { + single_frame_done_(false), + single_frame_deopt_method_(nullptr) { + } + + ArtMethod* GetSingleFrameDeoptMethod() const { + return single_frame_deopt_method_; } bool VisitFrame() OVERRIDE SHARED_REQUIRES(Locks::mutator_lock_) { @@ -356,6 +361,7 @@ class DeoptimizeStackVisitor FINAL : public StackVisitor { // Single-frame deopt ends at the first non-inlined frame and needs to store that method. exception_handler_->SetHandlerQuickArg0(reinterpret_cast<uintptr_t>(method)); single_frame_done_ = true; + single_frame_deopt_method_ = method; } return true; } @@ -586,6 +592,7 @@ class DeoptimizeStackVisitor FINAL : public StackVisitor { bool stacked_shadow_frame_pushed_; const bool single_frame_deopt_; bool single_frame_done_; + ArtMethod* single_frame_deopt_method_; DISALLOW_COPY_AND_ASSIGN(DeoptimizeStackVisitor); }; @@ -614,6 +621,14 @@ void QuickExceptionHandler::DeoptimizeSingleFrame() { DeoptimizeStackVisitor visitor(self_, context_, this, true); visitor.WalkStack(true); + // Compiled code made an explicit deoptimization. Transfer the code + // to interpreter and clear the counter to JIT the method again. + ArtMethod* deopt_method = visitor.GetSingleFrameDeoptMethod(); + DCHECK(deopt_method != nullptr); + deopt_method->ClearCounter(); + Runtime::Current()->GetInstrumentation()->UpdateMethodsCode( + deopt_method, GetQuickToInterpreterBridge()); + // PC needs to be of the quick-to-interpreter bridge. int32_t offset; #ifdef __LP64__ |