OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
6 #include "src/compiler/graph.h" | 6 #include "src/compiler/graph.h" |
7 #include "src/compiler/instruction.h" | 7 #include "src/compiler/instruction.h" |
8 #include "src/compiler/schedule.h" | 8 #include "src/compiler/schedule.h" |
9 #include "src/compiler/state-values-utils.h" | 9 #include "src/compiler/state-values-utils.h" |
10 | 10 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 namespace compiler { | 13 namespace compiler { |
14 | 14 |
15 const auto GetRegConfig = RegisterConfiguration::Turbofan; | 15 const RegisterConfiguration* (*GetRegConfig)() = |
| 16 RegisterConfiguration::Turbofan; |
16 | 17 |
17 FlagsCondition CommuteFlagsCondition(FlagsCondition condition) { | 18 FlagsCondition CommuteFlagsCondition(FlagsCondition condition) { |
18 switch (condition) { | 19 switch (condition) { |
19 case kSignedLessThan: | 20 case kSignedLessThan: |
20 return kSignedGreaterThan; | 21 return kSignedGreaterThan; |
21 case kSignedGreaterThanOrEqual: | 22 case kSignedGreaterThanOrEqual: |
22 return kSignedLessThanOrEqual; | 23 return kSignedLessThanOrEqual; |
23 case kSignedLessThanOrEqual: | 24 case kSignedLessThanOrEqual: |
24 return kSignedGreaterThanOrEqual; | 25 return kSignedGreaterThanOrEqual; |
25 case kSignedGreaterThan: | 26 case kSignedGreaterThan: |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 const InstructionBlock* block = InstructionBlockAt(rpo); | 975 const InstructionBlock* block = InstructionBlockAt(rpo); |
975 CHECK(block->rpo_number() == rpo); | 976 CHECK(block->rpo_number() == rpo); |
976 PrintableInstructionBlock printable_block = {config, block, this}; | 977 PrintableInstructionBlock printable_block = {config, block, this}; |
977 os << printable_block << std::endl; | 978 os << printable_block << std::endl; |
978 } | 979 } |
979 | 980 |
980 void InstructionSequence::PrintBlock(int block_id) const { | 981 void InstructionSequence::PrintBlock(int block_id) const { |
981 PrintBlock(GetRegConfig(), block_id); | 982 PrintBlock(GetRegConfig(), block_id); |
982 } | 983 } |
983 | 984 |
| 985 const RegisterConfiguration* |
| 986 InstructionSequence::GetRegisterConfigurationForTesting() { |
| 987 return GetRegConfig(); |
| 988 } |
| 989 |
984 FrameStateDescriptor::FrameStateDescriptor( | 990 FrameStateDescriptor::FrameStateDescriptor( |
985 Zone* zone, FrameStateType type, BailoutId bailout_id, | 991 Zone* zone, FrameStateType type, BailoutId bailout_id, |
986 OutputFrameStateCombine state_combine, size_t parameters_count, | 992 OutputFrameStateCombine state_combine, size_t parameters_count, |
987 size_t locals_count, size_t stack_count, | 993 size_t locals_count, size_t stack_count, |
988 MaybeHandle<SharedFunctionInfo> shared_info, | 994 MaybeHandle<SharedFunctionInfo> shared_info, |
989 FrameStateDescriptor* outer_state) | 995 FrameStateDescriptor* outer_state) |
990 : type_(type), | 996 : type_(type), |
991 bailout_id_(bailout_id), | 997 bailout_id_(bailout_id), |
992 frame_state_combine_(state_combine), | 998 frame_state_combine_(state_combine), |
993 parameters_count_(parameters_count), | 999 parameters_count_(parameters_count), |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 for (int i = 0; i < code.InstructionBlockCount(); i++) { | 1072 for (int i = 0; i < code.InstructionBlockCount(); i++) { |
1067 printable_block.block_ = code.InstructionBlockAt(RpoNumber::FromInt(i)); | 1073 printable_block.block_ = code.InstructionBlockAt(RpoNumber::FromInt(i)); |
1068 os << printable_block; | 1074 os << printable_block; |
1069 } | 1075 } |
1070 return os; | 1076 return os; |
1071 } | 1077 } |
1072 | 1078 |
1073 } // namespace compiler | 1079 } // namespace compiler |
1074 } // namespace internal | 1080 } // namespace internal |
1075 } // namespace v8 | 1081 } // namespace v8 |
OLD | NEW |