Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(823)

Unified Diff: runtime/vm/instructions_mips.cc

Issue 1439893002: - Annotate instructions that load objects from the ObjectPool or Thread. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/instructions_ia32.cc ('k') | runtime/vm/instructions_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « runtime/vm/instructions_ia32.cc ('k') | runtime/vm/instructions_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698