| 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 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ | 5 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ |
| 6 #define V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ | 6 #define V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ |
| 7 | 7 |
| 8 #include "src/compiler/instruction.h" | 8 #include "src/compiler/instruction.h" |
| 9 #include "src/compiler/instruction-selector.h" | 9 #include "src/compiler/instruction-selector.h" |
| 10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 return false_block_; | 284 return false_block_; |
| 285 } | 285 } |
| 286 | 286 |
| 287 void Negate() { | 287 void Negate() { |
| 288 DCHECK(!IsNone()); | 288 DCHECK(!IsNone()); |
| 289 condition_ = NegateFlagsCondition(condition_); | 289 condition_ = NegateFlagsCondition(condition_); |
| 290 } | 290 } |
| 291 | 291 |
| 292 void Commute() { | 292 void Commute() { |
| 293 DCHECK(!IsNone()); | 293 DCHECK(!IsNone()); |
| 294 switch (condition_) { | 294 condition_ = CommuteFlagsCondition(condition_); |
| 295 case kEqual: | |
| 296 case kNotEqual: | |
| 297 case kOverflow: | |
| 298 case kNotOverflow: | |
| 299 return; | |
| 300 case kSignedLessThan: | |
| 301 condition_ = kSignedGreaterThan; | |
| 302 return; | |
| 303 case kSignedGreaterThanOrEqual: | |
| 304 condition_ = kSignedLessThanOrEqual; | |
| 305 return; | |
| 306 case kSignedLessThanOrEqual: | |
| 307 condition_ = kSignedGreaterThanOrEqual; | |
| 308 return; | |
| 309 case kSignedGreaterThan: | |
| 310 condition_ = kSignedLessThan; | |
| 311 return; | |
| 312 case kUnsignedLessThan: | |
| 313 condition_ = kUnsignedGreaterThan; | |
| 314 return; | |
| 315 case kUnsignedGreaterThanOrEqual: | |
| 316 condition_ = kUnsignedLessThanOrEqual; | |
| 317 return; | |
| 318 case kUnsignedLessThanOrEqual: | |
| 319 condition_ = kUnsignedGreaterThanOrEqual; | |
| 320 return; | |
| 321 case kUnsignedGreaterThan: | |
| 322 condition_ = kUnsignedLessThan; | |
| 323 return; | |
| 324 case kUnorderedEqual: | |
| 325 case kUnorderedNotEqual: | |
| 326 return; | |
| 327 } | |
| 328 UNREACHABLE(); | |
| 329 } | 295 } |
| 330 | 296 |
| 331 void OverwriteAndNegateIfEqual(FlagsCondition condition) { | 297 void OverwriteAndNegateIfEqual(FlagsCondition condition) { |
| 332 bool negate = condition_ == kEqual; | 298 bool negate = condition_ == kEqual; |
| 333 condition_ = condition; | 299 condition_ = condition; |
| 334 if (negate) Negate(); | 300 if (negate) Negate(); |
| 335 } | 301 } |
| 336 | 302 |
| 337 // Encodes this flags continuation into the given opcode. | 303 // Encodes this flags continuation into the given opcode. |
| 338 InstructionCode Encode(InstructionCode opcode) { | 304 InstructionCode Encode(InstructionCode opcode) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 : (frame_state_descriptor->GetTotalSize() + | 342 : (frame_state_descriptor->GetTotalSize() + |
| 377 1); // Include deopt id. | 343 1); // Include deopt id. |
| 378 } | 344 } |
| 379 }; | 345 }; |
| 380 | 346 |
| 381 } // namespace compiler | 347 } // namespace compiler |
| 382 } // namespace internal | 348 } // namespace internal |
| 383 } // namespace v8 | 349 } // namespace v8 |
| 384 | 350 |
| 385 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ | 351 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ |
| OLD | NEW |