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

Unified Diff: runtime/vm/assembler_arm64.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_arm64.cc
diff --git a/runtime/vm/assembler_arm64.cc b/runtime/vm/assembler_arm64.cc
index 6da9770ad9986838a68ca00b97b51422eae62494..7911896dc55ebb6558c148f423c88e404e67c01e 100644
--- a/runtime/vm/assembler_arm64.cc
+++ b/runtime/vm/assembler_arm64.cc
@@ -1376,26 +1376,25 @@ void Assembler::UpdateAllocationStatsWithSize(intptr_t cid,
void Assembler::TryAllocate(const Class& cls,
Label* failure,
Register instance_reg,
+ Register temp_reg,
regis 2014/07/23 22:29:33 Use TMP2.
Vyacheslav Egorov (Google) 2014/07/24 11:24:48 AddImmediate is using TMP2 as a scratch register o
regis 2014/07/24 17:06:07 Acknowledged.
Register pp) {
ASSERT(failure != NULL);
if (FLAG_inline_alloc) {
Heap* heap = Isolate::Current()->heap();
const intptr_t instance_size = cls.instance_size();
- LoadImmediate(instance_reg, heap->TopAddress(), pp);
- ldr(instance_reg, Address(instance_reg));
+ LoadImmediate(temp_reg, heap->NewSpaceAddress(), pp);
+ ldr(instance_reg, Address(temp_reg, Scavenger::top_offset()));
AddImmediate(instance_reg, instance_reg, instance_size, pp);
// instance_reg: potential next object start.
- LoadImmediate(TMP, heap->EndAddress(), pp);
- ldr(TMP, Address(TMP));
+ ldr(TMP, Address(temp_reg, Scavenger::end_offset()));
CompareRegisters(TMP, instance_reg);
// fail if heap end unsigned less than or equal to instance_reg.
b(failure, LS);
// 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(), pp);
- str(instance_reg, Address(TMP));
+ str(instance_reg, Address(temp_reg, Scavenger::top_offset()));
ASSERT(instance_size >= kHeapObjectTag);
AddImmediate(

Powered by Google App Engine
This is Rietveld 408576698