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

Unified Diff: runtime/vm/assembler_arm.cc

Issue 13070003: Do not use object pool for VM heap objects on ARM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 | « no previous file | runtime/vm/instructions_arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_arm.cc
===================================================================
--- runtime/vm/assembler_arm.cc (revision 20482)
+++ runtime/vm/assembler_arm.cc (working copy)
@@ -1262,20 +1262,24 @@
void Assembler::LoadObject(Register rd, const Object& object) {
- // Since objects in the VM heap are never relocated, test instead
- // if (object.IsSmi() || object.InVMHeap()) {
- // and modify the decoding code in CallPattern to understand movt, movw.
- if (object.IsNull() ||
- object.IsSmi() ||
- (object.raw() == Bool::True().raw()) ||
- (object.raw() == Bool::False().raw())) {
- // This object is never relocated; do not use object pool.
+ // Smi's and VM heap objects are never relocated; do not use object pool.
+ if (object.IsSmi()) {
LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw()));
- return;
+ } else if (object.InVMHeap()) {
+ // Make sure that class CallPattern is able to decode this load immediate.
+ const int32_t object_raw = reinterpret_cast<int32_t>(object.raw());
+ movw(rd, Utils::Low16Bits(object_raw));
+ const uint16_t value_high = Utils::High16Bits(object_raw);
+ if (value_high != 0) {
+ movt(rd, value_high);
+ }
+ } else {
+ // Make sure that class CallPattern is able to decode this load from the
+ // object pool.
+ const int32_t offset =
+ Array::data_offset() + 4*AddObject(object) - kHeapObjectTag;
+ LoadWordFromPoolOffset(rd, offset);
}
- const int32_t offset =
- Array::data_offset() + 4*AddObject(object) - kHeapObjectTag;
- LoadWordFromPoolOffset(rd, offset);
}
@@ -1483,7 +1487,7 @@
mvn(rd, shifter_op, cond);
} else {
movw(rd, Utils::Low16Bits(value), cond);
- uint16_t value_high = Utils::High16Bits(value);
+ const uint16_t value_high = Utils::High16Bits(value);
if (value_high != 0) {
movt(rd, value_high, cond);
}
@@ -1677,7 +1681,7 @@
sub(rd, rn, ShifterOperand(IP), cond);
} else {
movw(IP, Utils::Low16Bits(value), cond);
- uint16_t value_high = Utils::High16Bits(value);
+ const uint16_t value_high = Utils::High16Bits(value);
if (value_high != 0) {
movt(IP, value_high, cond);
}
@@ -1704,7 +1708,7 @@
subs(rd, rn, ShifterOperand(IP), cond);
} else {
movw(IP, Utils::Low16Bits(value), cond);
- uint16_t value_high = Utils::High16Bits(value);
+ const uint16_t value_high = Utils::High16Bits(value);
if (value_high != 0) {
movt(IP, value_high, cond);
}
@@ -1731,7 +1735,7 @@
sbc(rd, rn, ShifterOperand(IP), cond);
} else {
movw(IP, Utils::Low16Bits(value), cond);
- uint16_t value_high = Utils::High16Bits(value);
+ const uint16_t value_high = Utils::High16Bits(value);
if (value_high != 0) {
movt(IP, value_high, cond);
}
@@ -1934,14 +1938,14 @@
if (object_pool_.IsNull()) {
// The object pool cannot be used in the vm isolate.
ASSERT(Isolate::Current() != Dart::vm_isolate());
- object_pool_ = GrowableObjectArray::New();
+ object_pool_ = GrowableObjectArray::New(Heap::kOld);
}
for (int i = 0; i < object_pool_.Length(); i++) {
if (object_pool_.At(i) == obj.raw()) {
return i;
}
}
- object_pool_.Add(obj);
+ object_pool_.Add(obj, Heap::kOld);
return object_pool_.Length() - 1;
}
@@ -1950,7 +1954,7 @@
if (object_pool_.IsNull()) {
// The object pool cannot be used in the vm isolate.
ASSERT(Isolate::Current() != Dart::vm_isolate());
- object_pool_ = GrowableObjectArray::New();
+ object_pool_ = GrowableObjectArray::New(Heap::kOld);
}
const word address = label->address();
ASSERT(Utils::IsAligned(address, 4));
@@ -1958,7 +1962,7 @@
const Smi& smi = Smi::Handle(Smi::New(address >> kSmiTagShift));
// Do not reuse an existing entry, since each reference may be patched
// independently.
- object_pool_.Add(smi);
+ object_pool_.Add(smi, Heap::kOld);
return object_pool_.Length() - 1;
}
« no previous file with comments | « no previous file | runtime/vm/instructions_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698