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

Unified Diff: test/unittests/compiler/instruction-sequence-unittest.cc

Issue 910753002: [turbofan] remove one level of indirection in phi inputs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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
Index: test/unittests/compiler/instruction-sequence-unittest.cc
diff --git a/test/unittests/compiler/instruction-sequence-unittest.cc b/test/unittests/compiler/instruction-sequence-unittest.cc
index dceefaf008aec6498316f6414eb80d8a9b9067ef..001fb11d1381e24fa005aa9f3de6818ff4de16ff 100644
--- a/test/unittests/compiler/instruction-sequence-unittest.cc
+++ b/test/unittests/compiler/instruction-sequence-unittest.cc
@@ -155,20 +155,35 @@ PhiInstruction* InstructionSequenceTest::Phi(VReg incoming_vreg_0,
VReg incoming_vreg_1,
VReg incoming_vreg_2,
VReg incoming_vreg_3) {
- auto phi = new (zone()) PhiInstruction(zone(), NewReg().value_, 10);
VReg inputs[] = {incoming_vreg_0, incoming_vreg_1, incoming_vreg_2,
incoming_vreg_3};
- for (size_t i = 0; i < arraysize(inputs); ++i) {
- if (inputs[i].value_ == kNoValue) break;
- Extend(phi, inputs[i]);
+ size_t input_count = 0;
+ for (; input_count < arraysize(inputs); ++input_count) {
+ if (inputs[input_count].value_ == kNoValue) break;
}
+ CHECK(input_count > 0);
+ auto phi = new (zone()) PhiInstruction(zone(), NewReg().value_, input_count);
+ for (size_t i = 0; i < input_count; ++i) {
+ SetInput(phi, i, inputs[i]);
+ }
+ current_block_->AddPhi(phi);
+ return phi;
+}
+
+
+PhiInstruction* InstructionSequenceTest::Phi(VReg incoming_vreg_0,
+ size_t input_count) {
+ auto phi = new (zone()) PhiInstruction(zone(), NewReg().value_, input_count);
+ SetInput(phi, 0, incoming_vreg_0);
current_block_->AddPhi(phi);
return phi;
}
-void InstructionSequenceTest::Extend(PhiInstruction* phi, VReg vreg) {
- phi->Extend(zone(), vreg.value_);
+void InstructionSequenceTest::SetInput(PhiInstruction* phi, size_t input,
+ VReg vreg) {
+ CHECK(vreg.value_ != kNoValue);
+ phi->SetInput(input, vreg.value_);
}
« no previous file with comments | « test/unittests/compiler/instruction-sequence-unittest.h ('k') | test/unittests/compiler/register-allocator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698