Reviewers: jochen, baptiste.afsa1,

Message:
PTAL, this fixes mozilla/js1_5/Regress/regress-80981

Jochen, I uploaded a new patch with a fix for MathPower.

Description:
A64: Handle Smi representation in MathAbs and fix MathPowStub.

TEST=mozilla/ecma/Expressions/11.7.1

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

SVN Base: https://v8.googlecode.com/svn/branches/experimental/a64

Affected files (+10, -8 lines):
  M src/a64/code-stubs-a64.cc
  M src/a64/lithium-a64.cc
  M src/a64/lithium-codegen-a64.cc


Index: src/a64/code-stubs-a64.cc
diff --git a/src/a64/code-stubs-a64.cc b/src/a64/code-stubs-a64.cc
index 81f4a5657d19c5db35cbb2588c0467330168036d..fdad07476649e94a5566af1477e2fca9ded9274b 100644
--- a/src/a64/code-stubs-a64.cc
+++ b/src/a64/code-stubs-a64.cc
@@ -2216,14 +2216,15 @@ void MathPowStub::Generate(MacroAssembler* masm) {
       __ Mov(lr, saved_lr);
       __ B(&done);
     }
+
+    // Handle SMI exponents.
+    __ Bind(&exponent_is_smi);
+    //  x10   base_tagged       The tagged base (input).
+    //  x11   exponent_tagged   The tagged exponent (input).
+    //  d1    base_double       The base as a double.
+    __ SmiUntag(exponent_integer, exponent_tagged);
   }

-  // Handle integer (and SMI) exponents.
-  __ Bind(&exponent_is_smi);
-  //  x10   base_tagged       The tagged base (input).
-  //  x11   exponent_tagged   The tagged exponent (input).
-  //  d1    base_double       The base as a double.
-  __ SmiUntag(exponent_integer, exponent_tagged);
   __ Bind(&exponent_is_integer);
   //  x10   base_tagged       The tagged base (input).
   //  x11   exponent_tagged   The tagged exponent (input).
Index: src/a64/lithium-a64.cc
diff --git a/src/a64/lithium-a64.cc b/src/a64/lithium-a64.cc
index efc35f83e73f7ccccd8d3fa4d5eb6b0bedab60d7..e3c8c064c62acf51689b472f0e7752fe7e757a54 100644
--- a/src/a64/lithium-a64.cc
+++ b/src/a64/lithium-a64.cc
@@ -2345,7 +2345,7 @@ LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
   switch (instr->op()) {
     case kMathAbs: {
       Representation r = instr->representation();
-      if (r.IsTagged()) {
+      if (r.IsTagged() || r.IsSmi()) {
// The tagged case might need to allocate a HeapNumber for the result,
         // so it is handled by a separate LInstruction.
         LOperand* input = UseRegister(instr->value());
Index: src/a64/lithium-codegen-a64.cc
diff --git a/src/a64/lithium-codegen-a64.cc b/src/a64/lithium-codegen-a64.cc
index ad02f5debe7627e3bef36be3516323796a329de4..aeb18d05860e2b13bd2187edb7168fe0e6075431 100644
--- a/src/a64/lithium-codegen-a64.cc
+++ b/src/a64/lithium-codegen-a64.cc
@@ -3525,7 +3525,8 @@ void LCodeGen::DoMathAbsTagged(LMathAbsTagged* instr) {
   DeferredMathAbsTagged* deferred =
       new(zone()) DeferredMathAbsTagged(this, instr);

-  ASSERT(instr->hydrogen()->value()->representation().IsTagged());
+  ASSERT(instr->hydrogen()->value()->representation().IsTagged() ||
+         instr->hydrogen()->value()->representation().IsSmi());
   Register input = ToRegister(instr->value());
   Register result_bits = ToRegister(instr->temp3());
   Register result = ToRegister(instr->result());


--
--
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