Index: runtime/vm/instructions_mips.cc |
diff --git a/runtime/vm/instructions_mips.cc b/runtime/vm/instructions_mips.cc |
index 1c243efd25213576bb4a0dadb2277da59ebb7200..cdb2cbe0dde2f69b37a7ea4a8655c0945782d005 100644 |
--- a/runtime/vm/instructions_mips.cc |
+++ b/runtime/vm/instructions_mips.cc |
@@ -121,6 +121,31 @@ uword InstructionPattern::DecodeLoadWordFromPool(uword end, |
} |
+bool DecodeLoadObjectFromPoolOrThread(uword pc, |
+ const Code& code, |
+ Object* obj) { |
+ ASSERT(code.ContainsInstructionAt(pc)); |
+ |
+ Instr* instr = Instr::At(pc); |
+ if ((instr->OpcodeField() == LW)) { |
+ intptr_t offset = instr->SImmField(); |
+ if (instr->RsField() == PP) { |
+ intptr_t index = ObjectPool::IndexFromOffset(offset); |
+ const ObjectPool& pool = ObjectPool::Handle(code.object_pool()); |
+ if (pool.InfoAt(index) == ObjectPool::kTaggedObject) { |
+ *obj = pool.ObjectAt(index); |
+ return true; |
+ } |
+ } else if (instr->RsField() == THR) { |
+ return Thread::ObjectAtOffset(offset, obj); |
+ } |
+ } |
+ // TODO(rmacnak): Sequence for loads beyond 16 bits. |
+ |
+ return false; |
+} |
+ |
+ |
RawICData* CallPattern::IcData() { |
if (ic_data_.IsNull()) { |
Register reg; |