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

Side by Side Diff: src/compiler/instruction.cc

Issue 2595293002: MIPS: Reland of `Fix bad RegisterConfiguration usage in InstructionSequence unit tests` (Closed)
Patch Set: Address code review remarks Created 3 years, 12 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 unified diff | Download patch
« no previous file with comments | « src/compiler/instruction.h ('k') | test/unittests/compiler/instruction-sequence-unittest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 const InstructionBlock* block = InstructionBlockAt(rpo); 979 const InstructionBlock* block = InstructionBlockAt(rpo);
979 CHECK(block->rpo_number() == rpo); 980 CHECK(block->rpo_number() == rpo);
980 PrintableInstructionBlock printable_block = {config, block, this}; 981 PrintableInstructionBlock printable_block = {config, block, this};
981 os << printable_block << std::endl; 982 os << printable_block << std::endl;
982 } 983 }
983 984
984 void InstructionSequence::PrintBlock(int block_id) const { 985 void InstructionSequence::PrintBlock(int block_id) const {
985 PrintBlock(GetRegConfig(), block_id); 986 PrintBlock(GetRegConfig(), block_id);
986 } 987 }
987 988
989 const RegisterConfiguration*
990 InstructionSequence::registerConfigurationForTesting_ = nullptr;
991
992 const RegisterConfiguration*
993 InstructionSequence::RegisterConfigurationForTesting() {
994 DCHECK(registerConfigurationForTesting_ != nullptr);
995 return registerConfigurationForTesting_;
996 }
997
998 void InstructionSequence::SetRegisterConfigurationForTesting(
999 const RegisterConfiguration* regConfig) {
1000 registerConfigurationForTesting_ = regConfig;
1001 GetRegConfig = InstructionSequence::RegisterConfigurationForTesting;
1002 }
1003
988 FrameStateDescriptor::FrameStateDescriptor( 1004 FrameStateDescriptor::FrameStateDescriptor(
989 Zone* zone, FrameStateType type, BailoutId bailout_id, 1005 Zone* zone, FrameStateType type, BailoutId bailout_id,
990 OutputFrameStateCombine state_combine, size_t parameters_count, 1006 OutputFrameStateCombine state_combine, size_t parameters_count,
991 size_t locals_count, size_t stack_count, 1007 size_t locals_count, size_t stack_count,
992 MaybeHandle<SharedFunctionInfo> shared_info, 1008 MaybeHandle<SharedFunctionInfo> shared_info,
993 FrameStateDescriptor* outer_state) 1009 FrameStateDescriptor* outer_state)
994 : type_(type), 1010 : type_(type),
995 bailout_id_(bailout_id), 1011 bailout_id_(bailout_id),
996 frame_state_combine_(state_combine), 1012 frame_state_combine_(state_combine),
997 parameters_count_(parameters_count), 1013 parameters_count_(parameters_count),
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 for (int i = 0; i < code.InstructionBlockCount(); i++) { 1086 for (int i = 0; i < code.InstructionBlockCount(); i++) {
1071 printable_block.block_ = code.InstructionBlockAt(RpoNumber::FromInt(i)); 1087 printable_block.block_ = code.InstructionBlockAt(RpoNumber::FromInt(i));
1072 os << printable_block; 1088 os << printable_block;
1073 } 1089 }
1074 return os; 1090 return os;
1075 } 1091 }
1076 1092
1077 } // namespace compiler 1093 } // namespace compiler
1078 } // namespace internal 1094 } // namespace internal
1079 } // namespace v8 1095 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/instruction.h ('k') | test/unittests/compiler/instruction-sequence-unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698