Chromium Code Reviews| Index: runtime/vm/assembler_mips.cc |
| =================================================================== |
| --- runtime/vm/assembler_mips.cc (revision 20488) |
| +++ runtime/vm/assembler_mips.cc (working copy) |
| @@ -9,7 +9,7 @@ |
| namespace dart { |
| -DEFINE_FLAG(bool, print_stop_message, true, "Print stop message."); |
| +DEFINE_FLAG(bool, print_stop_message, false, "Print stop message."); |
| void Assembler::InitializeMemoryWithBreakpoints(uword data, int length) { |
| @@ -56,6 +56,65 @@ |
| return (((instr & kBranchOffsetMask) << 16) >> 14); |
| } |
| + |
| +void Assembler::LoadWordFromPoolOffset(Register rd, int32_t offset) { |
| + ASSERT(rd != PP); |
| + if (Address::CanHoldOffset(offset)) { |
| + lw(rd, Address(PP, offset)); |
| + } else { |
| + LoadImmediate(rd, offset); |
| + addu(rd, rd, PP); |
| + lw(rd, Address(rd)); |
|
regis
2013/03/26 00:49:06
I think you can do slightly better here, by using
zra
2013/03/26 17:29:07
Done.
|
| + } |
| +} |
| + |
| + |
| +int32_t Assembler::AddObject(const Object& obj) { |
| + ASSERT(obj.IsNotTemporaryScopedHandle()); |
| + ASSERT(obj.IsOld()); |
| + if (object_pool_.IsNull()) { |
| + // The object pool cannot be used in the vm isolate. |
| + ASSERT(Isolate::Current() != Dart::vm_isolate()); |
| + 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, Heap::kOld); |
| + return object_pool_.Length() - 1; |
| +} |
| + |
| + |
| +int32_t Assembler::AddExternalLabel(const ExternalLabel* label) { |
| + if (object_pool_.IsNull()) { |
| + // The object pool cannot be used in the vm isolate. |
| + ASSERT(Isolate::Current() != Dart::vm_isolate()); |
| + object_pool_ = GrowableObjectArray::New(Heap::kOld); |
| + } |
| + const word address = label->address(); |
| + ASSERT(Utils::IsAligned(address, 4)); |
| + // The address is stored in the object array as a RawSmi. |
| + 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, Heap::kOld); |
| + return object_pool_.Length() - 1; |
| +} |
| + |
| + |
| +void Assembler::Stop(const char* message) { |
| + if (FLAG_print_stop_message) { |
| + UNIMPLEMENTED(); |
| + } |
| + Label stop; |
| + b(&stop); |
| + Emit(reinterpret_cast<int32_t>(message)); |
| + Bind(&stop); |
| + break_(Instr::kStopMessageCode); |
| +} |
| + |
| } // namespace dart |
| #endif // defined TARGET_ARCH_MIPS |