Revision: 18911
Author:   [email protected]
Date:     Wed Jan 29 14:32:54 2014 UTC
Log:      A64: Handle Smi representation in MathAbs and fix MathPowStub.

TEST=mozilla/ecma/Expressions/11.7.1
[email protected], [email protected]

Review URL: https://codereview.chromium.org/149483002
http://code.google.com/p/v8/source/detail?r=18911

Modified:
 /branches/experimental/a64/src/a64/code-stubs-a64.cc
 /branches/experimental/a64/src/a64/lithium-a64.cc
 /branches/experimental/a64/src/a64/lithium-codegen-a64.cc

=======================================
--- /branches/experimental/a64/src/a64/code-stubs-a64.cc Tue Jan 28 15:50:06 2014 UTC +++ /branches/experimental/a64/src/a64/code-stubs-a64.cc Wed Jan 29 14:32:54 2014 UTC
@@ -2216,14 +2216,15 @@
       __ 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).
=======================================
--- /branches/experimental/a64/src/a64/lithium-a64.cc Tue Jan 28 17:32:54 2014 UTC +++ /branches/experimental/a64/src/a64/lithium-a64.cc Wed Jan 29 14:32:54 2014 UTC
@@ -2345,7 +2345,7 @@
   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());
=======================================
--- /branches/experimental/a64/src/a64/lithium-codegen-a64.cc Tue Jan 28 17:32:54 2014 UTC +++ /branches/experimental/a64/src/a64/lithium-codegen-a64.cc Wed Jan 29 14:32:54 2014 UTC
@@ -3525,7 +3525,8 @@
   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