Chromium Code Reviews| Index: runtime/vm/instructions_arm64.cc |
| diff --git a/runtime/vm/instructions_arm64.cc b/runtime/vm/instructions_arm64.cc |
| index 62b3ff224b97eea38d1c06a94e3c9d5031e4ecea..ed7444c201d7cbe842b33822442bcc4810ca0917 100644 |
| --- a/runtime/vm/instructions_arm64.cc |
| +++ b/runtime/vm/instructions_arm64.cc |
| @@ -329,6 +329,45 @@ void CallPattern::InsertDeoptCallAt(uword pc, uword target_address) { |
| } |
| +SwitchableCallPattern::SwitchableCallPattern(uword pc, const Code& code) |
| + : object_pool_(ObjectPool::Handle(code.GetObjectPool())), |
| + cache_pool_index_(-1), |
| + stub_pool_index_(-1) { |
| + ASSERT(code.ContainsInstructionAt(pc)); |
| + // Last instruction: blr x1. |
|
Florian Schneider
2015/11/04 01:27:10
s/x1/r1/
rmacnak
2015/11/04 01:50:22
Done.
|
| + ASSERT(*(reinterpret_cast<uint32_t*>(pc) - 1) == 0xd63f0020); |
| + |
| + Register reg; |
| + uword stub_load_end = |
| + InstructionPattern::DecodeLoadWordFromPool(pc - 3 * Instr::kInstrSize, |
| + ®, |
| + &stub_pool_index_); |
| + ASSERT(reg == CODE_REG); |
| + InstructionPattern::DecodeLoadWordFromPool(stub_load_end, |
| + ®, |
| + &cache_pool_index_); |
| + ASSERT(reg == R5); |
| +} |
| + |
| + |
| +RawObject* SwitchableCallPattern::cache() const { |
| + return reinterpret_cast<RawCode*>( |
| + object_pool_.ObjectAt(cache_pool_index_)); |
| +} |
| + |
| + |
| +void SwitchableCallPattern::SetCache(const MegamorphicCache& cache) const { |
| + ASSERT(Object::Handle(object_pool_.ObjectAt(cache_pool_index_)).IsICData()); |
| + object_pool_.SetObjectAt(cache_pool_index_, cache); |
| +} |
| + |
| + |
| +void SwitchableCallPattern::SetLookupStub(const Code& lookup_stub) const { |
| + ASSERT(Object::Handle(object_pool_.ObjectAt(stub_pool_index_)).IsCode()); |
| + object_pool_.SetObjectAt(stub_pool_index_, lookup_stub); |
| +} |
| + |
| + |
| ReturnPattern::ReturnPattern(uword pc) |
| : pc_(pc) { |
| } |