summaryrefslogtreecommitdiff
path: root/runtime/stack.cc
diff options
context:
space:
mode:
author Alex Light <allight@google.com> 2016-11-28 16:24:32 -0800
committer Alex Light <allight@google.com> 2016-12-14 13:01:27 -0800
commitd8936da27b792d1ca02e59c92456a1a53c7b9905 (patch)
tree6a593dd426e7f4a15c651dd3b872f22fb64f09ce /runtime/stack.cc
parent7c73bf3518eea7544406eadfed6946411c54a267 (diff)
Basic obsolete methods support
Add support for executing obsolete methods following redefinitions. This support includes methods that have been jitted. This does not add any additional validity checks to our redefinition functions. Note using work-arounds to ensure 916 works pending some fixes to the compiler, deoptimizer, or both. Test: ./test/run-test --host 914 Test: ./test/run-test --host 915 Test: ./test/run-test --host 916 Test: mma -j40 test-art-host Test: ART_TEST_JIT=true \ ART_TEST_INTERPRETER=true mma -j40 test-art-host Test: ./art/tools/run-jdwp-tests.sh --mode=host --variant=X64 Test: ./art/tools/run-jdwp-tests.sh --mode=host --variant=X64 --no-jit Bug: 32369913 Bug: 33630159 Change-Id: I78ef95f484146f1fb93c37fc50f56575bdab2432
Diffstat (limited to 'runtime/stack.cc')
-rw-r--r--runtime/stack.cc21
1 files changed, 19 insertions, 2 deletions
diff --git a/runtime/stack.cc b/runtime/stack.cc
index 792da88a63..726ca2f30f 100644
--- a/runtime/stack.cc
+++ b/runtime/stack.cc
@@ -614,6 +614,23 @@ std::string StackVisitor::DescribeLocation() const {
return result;
}
+static instrumentation::InstrumentationStackFrame& GetInstrumentationStackFrame(Thread* thread,
+ uint32_t depth) {
+ CHECK_LT(depth, thread->GetInstrumentationStack()->size());
+ return thread->GetInstrumentationStack()->at(depth);
+}
+
+void StackVisitor::SetMethod(ArtMethod* method) {
+ DCHECK(GetMethod() != nullptr);
+ if (cur_shadow_frame_ != nullptr) {
+ cur_shadow_frame_->SetMethod(method);
+ } else {
+ DCHECK(cur_quick_frame_ != nullptr);
+ CHECK(!IsInInlinedFrame()) << "We do not support setting inlined method's ArtMethod!";
+ *cur_quick_frame_ = method;
+ }
+}
+
static void AssertPcIsWithinQuickCode(ArtMethod* method, uintptr_t pc)
REQUIRES_SHARED(Locks::mutator_lock_) {
if (method->IsNative() || method->IsRuntimeMethod() || method->IsProxyMethod()) {
@@ -775,8 +792,8 @@ template <StackVisitor::CountTransitions kCount>
void StackVisitor::WalkStack(bool include_transitions) {
DCHECK(thread_ == Thread::Current() || thread_->IsSuspended());
CHECK_EQ(cur_depth_, 0U);
+ size_t instrumentation_stack_depth = 0;
bool exit_stubs_installed = Runtime::Current()->GetInstrumentation()->AreExitStubsInstalled();
- uint32_t instrumentation_stack_depth = 0;
size_t inlined_frames_count = 0;
for (const ManagedStack* current_fragment = thread_->GetManagedStack();
@@ -839,7 +856,7 @@ void StackVisitor::WalkStack(bool include_transitions) {
if (reinterpret_cast<uintptr_t>(GetQuickInstrumentationExitPc()) == return_pc) {
CHECK_LT(instrumentation_stack_depth, thread_->GetInstrumentationStack()->size());
const instrumentation::InstrumentationStackFrame& instrumentation_frame =
- thread_->GetInstrumentationStack()->at(instrumentation_stack_depth);
+ GetInstrumentationStackFrame(thread_, instrumentation_stack_depth);
instrumentation_stack_depth++;
if (GetMethod() ==
Runtime::Current()->GetCalleeSaveMethod(Runtime::kSaveAllCalleeSaves)) {