Reviewers: m.m.capewell, ulan,

Description:
A64: Update DoAllocate() to use a W register for the size

Inputs should always be 32bit

BUG=none
[email protected],[email protected]
LOG=n

Please review this at https://codereview.chromium.org/167123004/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+5, -4 lines):
  M src/a64/lithium-codegen-a64.cc
  M src/a64/macro-assembler-a64.cc


Index: src/a64/lithium-codegen-a64.cc
diff --git a/src/a64/lithium-codegen-a64.cc b/src/a64/lithium-codegen-a64.cc
index 40ef5c6f124501e42e5c4c05735718a84eaa2627..63f540636a28fd6ae1a18821837c05eac6fa1a3b 100644
--- a/src/a64/lithium-codegen-a64.cc
+++ b/src/a64/lithium-codegen-a64.cc
@@ -1505,7 +1505,7 @@ void LCodeGen::DoAllocate(LAllocate* instr) {
     int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
     __ Allocate(size, result, temp1, temp2, deferred->entry(), flags);
   } else {
-    Register size = ToRegister(instr->size());
+    Register size = ToRegister32(instr->size());
     __ Allocate(size, result, temp1, temp2, deferred->entry(), flags);
   }

@@ -1516,7 +1516,7 @@ void LCodeGen::DoAllocate(LAllocate* instr) {
       int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
       __ Mov(temp1, size - kPointerSize);
     } else {
-      __ Sub(temp1, ToRegister(instr->size()), kPointerSize);
+      __ Sub(temp1, ToRegister32(instr->size()), kPointerSize);
     }
     __ Sub(result, result, kHeapObjectTag);

@@ -1545,7 +1545,8 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
   if (instr->size()->IsConstantOperand()) {
     __ Mov(size, Operand(ToSmi(LConstantOperand::cast(instr->size()))));
   } else {
-    __ SmiTag(size, ToRegister(instr->size()));
+    __ Mov(x10, ToRegister32(instr->size()));
+    __ SmiTag(size, x10);
   }
   int flags = AllocateDoubleAlignFlag::encode(
       instr->hydrogen()->MustAllocateDoubleAligned());
Index: src/a64/macro-assembler-a64.cc
diff --git a/src/a64/macro-assembler-a64.cc b/src/a64/macro-assembler-a64.cc
index 1e8da54314a5fa2434071cb051a8281126f38301..e3561a160e7906e16aeb71357cb8014a562eb952 100644
--- a/src/a64/macro-assembler-a64.cc
+++ b/src/a64/macro-assembler-a64.cc
@@ -3071,7 +3071,7 @@ void MacroAssembler::Allocate(Register object_size,
   }

ASSERT(!AreAliased(object_size, result, scratch1, scratch2, Tmp0(), Tmp1())); - ASSERT(object_size.Is64Bits() && result.Is64Bits() && scratch1.Is64Bits() &&
+  ASSERT(result.Is64Bits() && scratch1.Is64Bits() &&
          scratch2.Is64Bits() && Tmp0().Is64Bits() && Tmp1().Is64Bits());

   // Check relative positions of allocation top and limit addresses.


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to