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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 void Negate() { | 347 void Negate() { |
348 DCHECK(!IsNone()); | 348 DCHECK(!IsNone()); |
349 condition_ = NegateFlagsCondition(condition_); | 349 condition_ = NegateFlagsCondition(condition_); |
350 } | 350 } |
351 | 351 |
352 void Commute() { | 352 void Commute() { |
353 DCHECK(!IsNone()); | 353 DCHECK(!IsNone()); |
354 condition_ = CommuteFlagsCondition(condition_); | 354 condition_ = CommuteFlagsCondition(condition_); |
355 } | 355 } |
356 | 356 |
| 357 void Overwrite(FlagsCondition condition) { condition_ = condition; } |
| 358 |
357 void OverwriteAndNegateIfEqual(FlagsCondition condition) { | 359 void OverwriteAndNegateIfEqual(FlagsCondition condition) { |
358 bool negate = condition_ == kEqual; | 360 bool negate = condition_ == kEqual; |
359 condition_ = condition; | 361 condition_ = condition; |
360 if (negate) Negate(); | 362 if (negate) Negate(); |
361 } | 363 } |
362 | 364 |
363 // Encodes this flags continuation into the given opcode. | 365 // Encodes this flags continuation into the given opcode. |
364 InstructionCode Encode(InstructionCode opcode) { | 366 InstructionCode Encode(InstructionCode opcode) { |
365 opcode |= FlagsModeField::encode(mode_); | 367 opcode |= FlagsModeField::encode(mode_); |
366 if (mode_ != kFlags_none) { | 368 if (mode_ != kFlags_none) { |
(...skipping 17 matching lines...) Expand all Loading... |
384 // or mode_ == kFlags_set. | 386 // or mode_ == kFlags_set. |
385 BasicBlock* true_block_; // Only valid if mode_ == kFlags_branch. | 387 BasicBlock* true_block_; // Only valid if mode_ == kFlags_branch. |
386 BasicBlock* false_block_; // Only valid if mode_ == kFlags_branch. | 388 BasicBlock* false_block_; // Only valid if mode_ == kFlags_branch. |
387 }; | 389 }; |
388 | 390 |
389 } // namespace compiler | 391 } // namespace compiler |
390 } // namespace internal | 392 } // namespace internal |
391 } // namespace v8 | 393 } // namespace v8 |
392 | 394 |
393 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ | 395 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ |
OLD | NEW |