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

Unified Diff: test/cctest/compiler/test-instruction.cc

Issue 893913004: [turbofan] push virtual register field down to InstructionOperand (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
Index: test/cctest/compiler/test-instruction.cc
diff --git a/test/cctest/compiler/test-instruction.cc b/test/cctest/compiler/test-instruction.cc
index a884d28c18ed7b519c670a7032e2048e2198d245..da460d1a0f027a1d6c43575fd3c37cf2fdc40376 100644
--- a/test/cctest/compiler/test-instruction.cc
+++ b/test/cctest/compiler/test-instruction.cc
@@ -90,10 +90,7 @@ class InstructionTester : public HandleAndZoneScope {
}
UnallocatedOperand* NewUnallocated(int vreg) {
- UnallocatedOperand* unallocated =
- new (zone()) UnallocatedOperand(UnallocatedOperand::ANY);
- unallocated->set_virtual_register(vreg);
- return unallocated;
+ return new (zone()) UnallocatedOperand(UnallocatedOperand::ANY, vreg);
}
InstructionBlock* BlockAt(BasicBlock* block) {
@@ -298,23 +295,36 @@ TEST(InstructionOperands) {
CHECK_EQ(0, static_cast<int>(i->TempCount()));
}
+ int vreg = 15;
InstructionOperand* outputs[] = {
- new (&zone) UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER),
- new (&zone) UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER),
- new (&zone) UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER),
- new (&zone) UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER)};
+ new (&zone)
+ UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER, vreg),
+ new (&zone)
+ UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER, vreg),
+ new (&zone)
+ UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER, vreg),
+ new (&zone)
+ UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER, vreg)};
InstructionOperand* inputs[] = {
- new (&zone) UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER),
- new (&zone) UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER),
- new (&zone) UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER),
- new (&zone) UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER)};
+ new (&zone)
+ UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER, vreg),
+ new (&zone)
+ UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER, vreg),
+ new (&zone)
+ UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER, vreg),
+ new (&zone)
+ UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER, vreg)};
InstructionOperand* temps[] = {
- new (&zone) UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER),
- new (&zone) UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER),
- new (&zone) UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER),
- new (&zone) UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER)};
+ new (&zone)
+ UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER, vreg),
+ new (&zone)
+ UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER, vreg),
+ new (&zone)
+ UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER, vreg),
+ new (&zone)
+ UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER, vreg)};
for (size_t i = 0; i < arraysize(outputs); i++) {
for (size_t j = 0; j < arraysize(inputs); j++) {
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | test/unittests/compiler/instruction-sequence-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698