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

Unified Diff: runtime/vm/instructions_arm.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
Index: runtime/vm/instructions_arm.cc
diff --git a/runtime/vm/instructions_arm.cc b/runtime/vm/instructions_arm.cc
index de74bd5ed29840218bf220b2d6751deb595eff54..3222aa676afb12389de26cb4dc459954f4e1a663 100644
--- a/runtime/vm/instructions_arm.cc
+++ b/runtime/vm/instructions_arm.cc
@@ -180,7 +180,7 @@ uword InstructionPattern::DecodeLoadWordFromPool(uword end,
uword start = end - Instr::kInstrSize;
int32_t instr = Instr::At(start)->InstructionBits();
intptr_t offset = 0;
- if ((instr & 0xffff0000) == (0xe5950000 | (PP << 16))) {
+ if ((instr & 0xffff0000) == (0xe5900000 | (PP << 16))) {
Cutch 2015/11/12 17:33:52 How about a kConst for these patterns?
rmacnak 2015/11/12 21:50:46 Extracted as IsLoadWithOffset
// ldr reg, [pp, #+offset]
offset = instr & 0xfff;
*reg = static_cast<Register>((instr & 0xf000) >> 12);
@@ -206,6 +206,32 @@ uword InstructionPattern::DecodeLoadWordFromPool(uword end,
}
+bool DecodeLoadObjectFromPoolOrThread(uword pc,
+ const Code& code,
+ Object* obj) {
+ ASSERT(code.ContainsInstructionAt(pc));
+
+ int32_t instr = Instr::At(pc)->InstructionBits();
+ if ((instr & 0xffff0000) == (0xe5900000 | (PP << 16))) {
+ // ldr reg, [pp, #+offset]
+ intptr_t offset = instr & 0xfff;
+ 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 & 0xffff0000) == (0xe5900000 | (THR << 16))) {
+ // ldr reg, [thr, #+offset]
+ intptr_t offset = instr & 0xfff;
+ return Thread::ObjectAtOffset(offset, obj);
+ }
+ // TODO(rmacnak): Sequence for loads beyond 12 bits.
+
+ return false;
+}
+
+
RawICData* CallPattern::IcData() {
if (ic_data_.IsNull()) {
Register reg;

Powered by Google App Engine
This is Rietveld 408576698