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

Unified Diff: runtime/vm/instructions_x64.cc

Issue 1175523002: Object pool with support for untagged entries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « runtime/vm/instructions_x64.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/instructions_x64.cc
diff --git a/runtime/vm/instructions_x64.cc b/runtime/vm/instructions_x64.cc
index 98ffcd96c3c62fa8622256c1bef5d43fcc716865..51128dd23901b88e6fcec7c2b64b5a5b046c8ad4 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.
}
« no previous file with comments | « runtime/vm/instructions_x64.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698