Revision: 18816
Author:   [email protected]
Date:     Fri Jan 24 11:48:35 2014 UTC
Log:      A64: Tidy up VisitForOfStatement

Small tidy up to use JumpIfRoot and a named register.

BUG=none
[email protected]

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

Modified:
 /branches/experimental/a64/src/a64/full-codegen-a64.cc

=======================================
--- /branches/experimental/a64/src/a64/full-codegen-a64.cc Thu Jan 23 18:07:26 2014 UTC +++ /branches/experimental/a64/src/a64/full-codegen-a64.cc Fri Jan 24 11:48:35 2014 UTC
@@ -1269,21 +1269,22 @@
   VisitForAccumulatorValue(stmt->assign_iterator());

   // As with for-in, skip the loop if the iterator is null or undefined.
-  __ CompareRoot(x0, Heap::kUndefinedValueRootIndex);
-  __ B(eq, loop_statement.break_label());
-  __ CompareRoot(x0, Heap::kNullValueRootIndex);
-  __ B(eq, loop_statement.break_label());
+  Register iterator = x0;
+  __ JumpIfRoot(iterator, Heap::kUndefinedValueRootIndex,
+                loop_statement.break_label());
+  __ JumpIfRoot(iterator, Heap::kNullValueRootIndex,
+                loop_statement.break_label());

   // Convert the iterator to a JS object.
   Label convert, done_convert;
-  __ JumpIfSmi(x0, &convert);
-  __ CompareObjectType(x0, x10, x11, FIRST_SPEC_OBJECT_TYPE);
+  __ JumpIfSmi(iterator, &convert);
+  __ CompareObjectType(iterator, x1, x1, FIRST_SPEC_OBJECT_TYPE);
   __ B(ge, &done_convert);
   __ Bind(&convert);
-  __ Push(x0);
+  __ Push(iterator);
   __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
   __ Bind(&done_convert);
-  __ Push(x0);
+  __ Push(iterator);

   // Loop entry.
   __ Bind(loop_statement.continue_label());

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