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

Unified Diff: test/cctest/compiler/test-gap-resolver.cc

Issue 2090993002: Fix '[tests] Don't test moves between different reps in test-gap-resolver.cc' (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm. Created 4 years, 6 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 | « src/x87/assembler-x87.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-gap-resolver.cc
diff --git a/test/cctest/compiler/test-gap-resolver.cc b/test/cctest/compiler/test-gap-resolver.cc
index 0c771251b6e7bca754361563656e160c7812b192..f22184b2241f60f2a4f3f4014f59362978ac89d6 100644
--- a/test/cctest/compiler/test-gap-resolver.cc
+++ b/test/cctest/compiler/test-gap-resolver.cc
@@ -200,6 +200,22 @@ class ParallelMoveCreator : public HandleAndZoneScope {
InstructionOperand CreateRandomOperand(bool is_source,
MachineRepresentation rep) {
+ auto conf =
+ RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN);
+ auto GetRegisterCode = [&conf](MachineRepresentation rep, int index) {
+ switch (rep) {
+ case MachineRepresentation::kFloat32:
+ case MachineRepresentation::kFloat64:
+ return conf->RegisterConfiguration::GetAllocatableDoubleCode(index);
+ break;
+
+ default:
+ return conf->RegisterConfiguration::GetAllocatableGeneralCode(index);
+ break;
+ }
+ UNREACHABLE();
+ return static_cast<int>(Register::kCode_no_reg);
+ };
int index = rng_->NextInt(7);
// destination can't be Constant.
switch (rng_->NextInt(is_source ? 5 : 4)) {
@@ -208,15 +224,11 @@ class ParallelMoveCreator : public HandleAndZoneScope {
case 1:
return AllocatedOperand(LocationOperand::REGISTER, rep, index);
case 2:
- return ExplicitOperand(
- LocationOperand::REGISTER, rep,
- RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN)
- ->GetAllocatableGeneralCode(1));
+ return ExplicitOperand(LocationOperand::REGISTER, rep,
+ GetRegisterCode(rep, 1));
case 3:
- return ExplicitOperand(
- LocationOperand::STACK_SLOT, rep,
- RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN)
- ->GetAllocatableGeneralCode(index));
+ return ExplicitOperand(LocationOperand::STACK_SLOT, rep,
+ GetRegisterCode(rep, index));
case 4:
return ConstantOperand(index);
}
« no previous file with comments | « src/x87/assembler-x87.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698