[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}
This commit is contained in:
danno 2017-01-30 05:06:11 -08:00 committed by Commit bot
parent dedc8a2f51
commit db57a11979
2 changed files with 11 additions and 10 deletions

View File

@ -6258,7 +6258,7 @@ Node* CodeStubAssembler::CreateWeakCellInFeedbackVector(Node* feedback_vector,
return cell;
}
void CodeStubAssembler::BuildFastLoop(
Node* CodeStubAssembler::BuildFastLoop(
const CodeStubAssembler::VariableList& vars,
MachineRepresentation index_rep, Node* start_index, Node* end_index,
const FastLoopBody& body, int increment, IndexAdvanceMode mode) {
@ -6287,6 +6287,7 @@ void CodeStubAssembler::BuildFastLoop(
Branch(WordNotEqual(var.value(), end_index), &loop, &after_loop);
}
Bind(&after_loop);
return var.value();
}
void CodeStubAssembler::BuildFastFixedArrayForEach(

View File

@ -1075,16 +1075,16 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
typedef std::function<void(Node* index)> FastLoopBody;
void BuildFastLoop(const VariableList& var_list,
MachineRepresentation index_rep, Node* start_index,
Node* end_index, const FastLoopBody& body, int increment,
IndexAdvanceMode mode = IndexAdvanceMode::kPre);
Node* BuildFastLoop(const VariableList& var_list,
MachineRepresentation index_rep, Node* start_index,
Node* end_index, const FastLoopBody& body, int increment,
IndexAdvanceMode mode = IndexAdvanceMode::kPre);
void BuildFastLoop(MachineRepresentation index_rep, Node* start_index,
Node* end_index, const FastLoopBody& body, int increment,
IndexAdvanceMode mode = IndexAdvanceMode::kPre) {
BuildFastLoop(VariableList(0, zone()), index_rep, start_index, end_index,
body, increment, mode);
Node* BuildFastLoop(MachineRepresentation index_rep, Node* start_index,
Node* end_index, const FastLoopBody& body, int increment,
IndexAdvanceMode mode = IndexAdvanceMode::kPre) {
return BuildFastLoop(VariableList(0, zone()), index_rep, start_index,
end_index, body, increment, mode);
}
enum class ForEachDirection { kForward, kReverse };