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

Unified Diff: runtime/vm/assembler_mips.cc

Issue 12703028: Adds Stop to MIPS. Starts on MIPS call patcher. (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
Index: runtime/vm/assembler_mips.cc
===================================================================
--- runtime/vm/assembler_mips.cc (revision 20488)
+++ runtime/vm/assembler_mips.cc (working copy)
@@ -56,6 +56,53 @@
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));
+ }
+}
+
+
+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();
regis 2013/03/25 23:03:40 You should sync. You will notice that we allocate
zra 2013/03/25 23:39:17 Done.
+ }
+ for (int i = 0; i < object_pool_.Length(); i++) {
+ if (object_pool_.At(i) == obj.raw()) {
+ return i;
+ }
+ }
+ object_pool_.Add(obj);
regis 2013/03/25 23:03:40 ditto
zra 2013/03/25 23:39:17 Done.
+ 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();
regis 2013/03/25 23:03:40 ditto
zra 2013/03/25 23:39:17 Done.
+ }
+ 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);
regis 2013/03/25 23:03:40 ditto
zra 2013/03/25 23:39:17 Done.
+ return object_pool_.Length() - 1;
+}
+
} // namespace dart
#endif // defined TARGET_ARCH_MIPS

Powered by Google App Engine
This is Rietveld 408576698