diff options
| author | 2015-11-05 17:33:10 +0000 | |
|---|---|---|
| committer | 2015-11-05 17:33:10 +0000 | |
| commit | 4ba3766449e4c36478ed896ee6d2ad9e9ee43f74 (patch) | |
| tree | b873e9639b6c8fe8887b438e6184bcd7d7905669 /runtime/monitor.cc | |
| parent | d93223d7966bee1ae91a9e224c1dd56de1aa3f50 (diff) | |
| parent | 0f7c93322e50ff53eeba6b9ae13cf73eb0617587 (diff) | |
Merge "Minor cleanup of Monitor::VisitLocks"
Diffstat (limited to 'runtime/monitor.cc')
| -rw-r--r-- | runtime/monitor.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/runtime/monitor.cc b/runtime/monitor.cc index 81e7e6d675..da21fee3d2 100644 --- a/runtime/monitor.cc +++ b/runtime/monitor.cc @@ -27,7 +27,7 @@ #include "base/time_utils.h" #include "class_linker.h" #include "dex_file-inl.h" -#include "dex_instruction.h" +#include "dex_instruction-inl.h" #include "lock_word-inl.h" #include "mirror/class-inl.h" #include "mirror/object-inl.h" @@ -1034,15 +1034,15 @@ void Monitor::VisitLocks(StackVisitor* stack_visitor, void (*callback)(mirror::O for (uint32_t monitor_dex_pc : monitor_enter_dex_pcs) { // The verifier works in terms of the dex pcs of the monitor-enter instructions. // We want the registers used by those instructions (so we can read the values out of them). - uint16_t monitor_enter_instruction = code_item->insns_[monitor_dex_pc]; + const Instruction* monitor_enter_instruction = + Instruction::At(&code_item->insns_[monitor_dex_pc]); // Quick sanity check. - if ((monitor_enter_instruction & 0xff) != Instruction::MONITOR_ENTER) { - LOG(FATAL) << "expected monitor-enter @" << monitor_dex_pc << "; was " - << reinterpret_cast<void*>(monitor_enter_instruction); - } + CHECK_EQ(monitor_enter_instruction->Opcode(), Instruction::MONITOR_ENTER) + << "expected monitor-enter @" << monitor_dex_pc << "; was " + << reinterpret_cast<const void*>(monitor_enter_instruction); - uint16_t monitor_register = ((monitor_enter_instruction >> 8) & 0xff); + uint16_t monitor_register = monitor_enter_instruction->VRegA(); uint32_t value; bool success = stack_visitor->GetVReg(m, monitor_register, kReferenceVReg, &value); CHECK(success) << "Failed to read v" << monitor_register << " of kind " |