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

Unified Diff: src/a64/full-codegen-a64.cc

Issue 146703002: A64: Tidy up VisitForOfStatement (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/full-codegen-a64.cc
diff --git a/src/a64/full-codegen-a64.cc b/src/a64/full-codegen-a64.cc
index 8c55bfabada69d9408c6e5e057075b1790865cfc..14b2065684d39ac410651d242e6031cbcf77e649 100644
--- a/src/a64/full-codegen-a64.cc
+++ b/src/a64/full-codegen-a64.cc
@@ -1269,21 +1269,22 @@ void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) {
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());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698