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

Unified Diff: runtime/vm/assembler_mips.cc

Issue 410333003: Shorter TryAllocate instruction sequence on ARM/ARM64/MIPS. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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
diff --git a/runtime/vm/assembler_mips.cc b/runtime/vm/assembler_mips.cc
index 3cfcdea85b4b64a0af2e6ae6f5a72dbe19d08d5b..802dd494e93d398fe98c5c0ff5021406858a229f 100644
--- a/runtime/vm/assembler_mips.cc
+++ b/runtime/vm/assembler_mips.cc
@@ -858,20 +858,19 @@ void Assembler::TryAllocate(const Class& cls,
if (FLAG_inline_alloc) {
Heap* heap = Isolate::Current()->heap();
const intptr_t instance_size = cls.instance_size();
- LoadImmediate(instance_reg, heap->TopAddress());
- lw(instance_reg, Address(instance_reg, 0));
+
+ LoadImmediate(temp_reg, heap->NewSpaceAddress());
+ lw(instance_reg, Address(temp_reg, Scavenger::top_offset()));
AddImmediate(instance_reg, instance_size);
// instance_reg: potential next object start.
- LoadImmediate(TMP, heap->EndAddress());
- lw(TMP, Address(TMP, 0));
+ lw(TMP, Address(temp_reg, Scavenger::end_offset()));
// Fail if heap end unsigned less than or equal to instance_reg.
BranchUnsignedLessEqual(TMP, instance_reg, failure);
// Successfully allocated the object, now update top to point to
// next object start and store the class in the class field of object.
- LoadImmediate(TMP, heap->TopAddress());
- sw(instance_reg, Address(TMP, 0));
+ sw(instance_reg, Address(temp_reg, Scavenger::top_offset()));
ASSERT(instance_size >= kHeapObjectTag);
AddImmediate(instance_reg, -instance_size + kHeapObjectTag);

Powered by Google App Engine
This is Rietveld 408576698