Index: src/compiler/instruction.cc |
diff --git a/src/compiler/instruction.cc b/src/compiler/instruction.cc |
index e53414bdb1ea5ce0b9aa30c28845ed055458d5b0..c4560b6e76774faa6b81ad0b092ba375f7f46cd1 100644 |
--- a/src/compiler/instruction.cc |
+++ b/src/compiler/instruction.cc |
@@ -12,7 +12,8 @@ namespace v8 { |
namespace internal { |
namespace compiler { |
-const auto GetRegConfig = RegisterConfiguration::Turbofan; |
+const RegisterConfiguration* (*GetRegConfig)() = |
+ RegisterConfiguration::Turbofan; |
FlagsCondition CommuteFlagsCondition(FlagsCondition condition) { |
switch (condition) { |
@@ -985,6 +986,21 @@ void InstructionSequence::PrintBlock(int block_id) const { |
PrintBlock(GetRegConfig(), block_id); |
} |
+const RegisterConfiguration* |
+ InstructionSequence::registerConfigurationForTesting_ = nullptr; |
+ |
+const RegisterConfiguration* |
+InstructionSequence::RegisterConfigurationForTesting() { |
+ DCHECK(registerConfigurationForTesting_ != nullptr); |
+ return registerConfigurationForTesting_; |
+} |
+ |
+void InstructionSequence::SetRegisterConfigurationForTesting( |
+ const RegisterConfiguration* regConfig) { |
+ registerConfigurationForTesting_ = regConfig; |
+ GetRegConfig = InstructionSequence::RegisterConfigurationForTesting; |
+} |
+ |
FrameStateDescriptor::FrameStateDescriptor( |
Zone* zone, FrameStateType type, BailoutId bailout_id, |
OutputFrameStateCombine state_combine, size_t parameters_count, |