diff options
author | 2019-12-03 14:36:42 +0000 | |
---|---|---|
committer | 2019-12-04 12:04:36 +0000 | |
commit | a00b54b74bee06c006b8bebfbef85e2801de293c (patch) | |
tree | 6edb2a96c1f89ae913e6b5f190b117cb290239e8 /runtime/thread.cc | |
parent | e571a283b73fb4621c401811f523503b3266564b (diff) |
Helpers and refactorings to prepare for interpreter optimizations (x64)
- Add data structure offsets that will be used in assembly code.
- Be explicit about a stack overflow in a fault handler.
- Move assembly helper code in asm_support so interpreter can use it.
- Support putting literals in InterpreterCache.
- Fix artHandleFillArrayDataFromCode for x64.
Bug: 119800099
Test: test.py
Change-Id: I2729f87fe5d09c04ae2e7081636f0cd89ac14c21
Diffstat (limited to 'runtime/thread.cc')
-rw-r--r-- | runtime/thread.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/thread.cc b/runtime/thread.cc index 6f0776b6b5..c78d4ec46f 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -4037,6 +4037,20 @@ void Thread::VisitRoots(RootVisitor* visitor) { for (instrumentation::InstrumentationStackFrame& frame : *GetInstrumentationStack()) { visitor->VisitRootIfNonNull(&frame.this_object_, RootInfo(kRootVMInternal, thread_id)); } + for (InterpreterCache::Entry& entry : GetInterpreterCache()->GetArray()) { + const Instruction* inst = reinterpret_cast<const Instruction*>(entry.first); + if (inst != nullptr && + (inst->Opcode() == Instruction::NEW_INSTANCE || + inst->Opcode() == Instruction::CHECK_CAST || + inst->Opcode() == Instruction::INSTANCE_OF || + inst->Opcode() == Instruction::NEW_ARRAY || + inst->Opcode() == Instruction::CONST_CLASS || + inst->Opcode() == Instruction::CONST_STRING || + inst->Opcode() == Instruction::CONST_STRING_JUMBO)) { + visitor->VisitRootIfNonNull(reinterpret_cast<mirror::Object**>(&entry.second), + RootInfo(kRootThreadObject, thread_id)); + } + } } void Thread::VisitRoots(RootVisitor* visitor, VisitRootFlags flags) { |