Commit db57a119 authored by danno's avatar danno Committed by Commit bot

[csa] Return last value from BuildFastLoop to allow chaining sequential loops

Review-Url: https://codereview.chromium.org/2657293002
Cr-Commit-Position: refs/heads/master@{#42774}
parent dedc8a2f
...@@ -6258,7 +6258,7 @@ Node* CodeStubAssembler::CreateWeakCellInFeedbackVector(Node* feedback_vector, ...@@ -6258,7 +6258,7 @@ Node* CodeStubAssembler::CreateWeakCellInFeedbackVector(Node* feedback_vector,
return cell; return cell;
} }
void CodeStubAssembler::BuildFastLoop( Node* CodeStubAssembler::BuildFastLoop(
const CodeStubAssembler::VariableList& vars, const CodeStubAssembler::VariableList& vars,
MachineRepresentation index_rep, Node* start_index, Node* end_index, MachineRepresentation index_rep, Node* start_index, Node* end_index,
const FastLoopBody& body, int increment, IndexAdvanceMode mode) { const FastLoopBody& body, int increment, IndexAdvanceMode mode) {
...@@ -6287,6 +6287,7 @@ void CodeStubAssembler::BuildFastLoop( ...@@ -6287,6 +6287,7 @@ void CodeStubAssembler::BuildFastLoop(
Branch(WordNotEqual(var.value(), end_index), &loop, &after_loop); Branch(WordNotEqual(var.value(), end_index), &loop, &after_loop);
} }
Bind(&after_loop); Bind(&after_loop);
return var.value();
} }
void CodeStubAssembler::BuildFastFixedArrayForEach( void CodeStubAssembler::BuildFastFixedArrayForEach(
......
...@@ -1075,16 +1075,16 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { ...@@ -1075,16 +1075,16 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
typedef std::function<void(Node* index)> FastLoopBody; typedef std::function<void(Node* index)> FastLoopBody;
void BuildFastLoop(const VariableList& var_list, Node* BuildFastLoop(const VariableList& var_list,
MachineRepresentation index_rep, Node* start_index, MachineRepresentation index_rep, Node* start_index,
Node* end_index, const FastLoopBody& body, int increment, Node* end_index, const FastLoopBody& body, int increment,
IndexAdvanceMode mode = IndexAdvanceMode::kPre); IndexAdvanceMode mode = IndexAdvanceMode::kPre);
void BuildFastLoop(MachineRepresentation index_rep, Node* start_index, Node* BuildFastLoop(MachineRepresentation index_rep, Node* start_index,
Node* end_index, const FastLoopBody& body, int increment, Node* end_index, const FastLoopBody& body, int increment,
IndexAdvanceMode mode = IndexAdvanceMode::kPre) { IndexAdvanceMode mode = IndexAdvanceMode::kPre) {
BuildFastLoop(VariableList(0, zone()), index_rep, start_index, end_index, return BuildFastLoop(VariableList(0, zone()), index_rep, start_index,
body, increment, mode); end_index, body, increment, mode);
} }
enum class ForEachDirection { kForward, kReverse }; enum class ForEachDirection { kForward, kReverse };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment