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

Unified Diff: runtime/vm/instructions_mips.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_mips.h ('k') | runtime/vm/instructions_x64.h » ('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 3e8cbe807cc00790f77d5aa7ec759e9252f534fa..34a5c3a460970d7bb805e91314a6d6fd98c195cb 100644
--- a/runtime/vm/instructions_mips.cc
+++ b/runtime/vm/instructions_mips.cc
@@ -13,7 +13,7 @@
namespace dart {
CallPattern::CallPattern(uword pc, const Code& code)
- : object_pool_(Array::Handle(code.ObjectPool())),
+ : object_pool_(ObjectPool::Handle(code.GetObjectPool())),
end_(pc),
args_desc_load_end_(0),
ic_data_load_end_(0),
@@ -39,7 +39,7 @@ CallPattern::CallPattern(uword pc, const Code& code)
// and the loaded object in the output parameters 'reg' and 'obj'
// respectively.
uword InstructionPattern::DecodeLoadObject(uword end,
- const Array& object_pool,
+ const ObjectPool& object_pool,
Register* reg,
Object* obj) {
uword start = 0;
@@ -47,7 +47,7 @@ uword InstructionPattern::DecodeLoadObject(uword end,
if (instr->OpcodeField() == LW) {
intptr_t index = 0;
start = DecodeLoadWordFromPool(end, reg, &index);
- *obj = object_pool.At(index);
+ *obj = object_pool.ObjectAt(index);
} else {
intptr_t value = 0;
start = DecodeLoadWordImmediate(end, reg, &value);
@@ -154,20 +154,12 @@ RawArray* CallPattern::ClosureArgumentsDescriptor() {
uword CallPattern::TargetAddress() const {
- ASSERT(target_address_pool_index_ >= 0);
- const Object& target_address =
- Object::Handle(object_pool_.At(target_address_pool_index_));
- ASSERT(target_address.IsSmi());
- // The address is stored in the object array as a RawSmi.
- return reinterpret_cast<uword>(target_address.raw());
+ return object_pool_.RawValueAt(target_address_pool_index_);
}
void CallPattern::SetTargetAddress(uword target_address) const {
- ASSERT(Utils::IsAligned(target_address, 4));
- // The address is stored in the object array as a RawSmi.
- const Smi& smi = Smi::Handle(reinterpret_cast<RawSmi*>(target_address));
- object_pool_.SetAt(target_address_pool_index_, smi);
+ object_pool_.SetRawValueAt(target_address_pool_index_, target_address);
// No need to flush the instruction cache, since the code is not modified.
}
« no previous file with comments | « runtime/vm/instructions_mips.h ('k') | runtime/vm/instructions_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698