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

Unified Diff: runtime/vm/instructions_x64.cc

Issue 1147303002: Support untagged object pool entries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rebased Created 5 years, 7 months 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_x64.cc
diff --git a/runtime/vm/instructions_x64.cc b/runtime/vm/instructions_x64.cc
index f4a0632291fa22618a38b049d1b397c8a315eaf6..6e9858473429111bb4e439fbcf1757690c848215 100644
--- a/runtime/vm/instructions_x64.cc
+++ b/runtime/vm/instructions_x64.cc
@@ -13,13 +13,12 @@ namespace dart {
intptr_t InstructionPattern::IndexFromPPLoad(uword start) {
int32_t offset = *reinterpret_cast<int32_t*>(start);
- offset += kHeapObjectTag;
- return (offset - Array::data_offset()) / kWordSize;
+ return ObjectPool::IndexFromOffset(offset);
}
intptr_t InstructionPattern::OffsetFromPPIndex(intptr_t index) {
- intptr_t offset = Array::element_offset(index);
+ intptr_t offset = ObjectPool::element_offset(index);
return offset - kHeapObjectTag;
}
@@ -40,15 +39,14 @@ bool InstructionPattern::TestBytesWith(const int* data, int num_bytes) const {
uword JumpPattern::TargetAddress() const {
ASSERT(IsValid());
int index = InstructionPattern::IndexFromPPLoad(start() + 3);
- return reinterpret_cast<uword>(object_pool_.At(index));
+ return object_pool_.RawValueAt(index);
}
void JumpPattern::SetTargetAddress(uword target) const {
ASSERT(IsValid());
int index = InstructionPattern::IndexFromPPLoad(start() + 3);
- const Smi& smi = Smi::Handle(reinterpret_cast<RawSmi*>(target));
- object_pool_.SetAt(index, smi);
+ object_pool_.SetRawValueAt(index, target);
// No need to flush the instruction cache, since the code is not modified.
}

Powered by Google App Engine
This is Rietveld 408576698