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

Side by Side Diff: src/compiler/instruction-selector-impl.h

Issue 2202803003: [turbofan] Fix invalid comparison operator narrowing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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
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 #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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 } 379 }
380 380
381 void Overwrite(FlagsCondition condition) { condition_ = condition; } 381 void Overwrite(FlagsCondition condition) { condition_ = condition; }
382 382
383 void OverwriteAndNegateIfEqual(FlagsCondition condition) { 383 void OverwriteAndNegateIfEqual(FlagsCondition condition) {
384 bool negate = condition_ == kEqual; 384 bool negate = condition_ == kEqual;
385 condition_ = condition; 385 condition_ = condition;
386 if (negate) Negate(); 386 if (negate) Negate();
387 } 387 }
388 388
389 void OverwriteUnsignedIfSigned() {
390 switch (condition_) {
391 case kSignedLessThan:
392 condition_ = kUnsignedLessThan;
393 break;
394 case kSignedLessThanOrEqual:
395 condition_ = kUnsignedLessThanOrEqual;
396 break;
397 case kSignedGreaterThan:
398 condition_ = kUnsignedGreaterThan;
399 break;
400 case kSignedGreaterThanOrEqual:
401 condition_ = kUnsignedGreaterThanOrEqual;
402 break;
403 default:
404 break;
405 }
406 }
407
389 // Encodes this flags continuation into the given opcode. 408 // Encodes this flags continuation into the given opcode.
390 InstructionCode Encode(InstructionCode opcode) { 409 InstructionCode Encode(InstructionCode opcode) {
391 opcode |= FlagsModeField::encode(mode_); 410 opcode |= FlagsModeField::encode(mode_);
392 if (mode_ != kFlags_none) { 411 if (mode_ != kFlags_none) {
393 opcode |= FlagsConditionField::encode(condition_); 412 opcode |= FlagsConditionField::encode(condition_);
394 } 413 }
395 return opcode; 414 return opcode;
396 } 415 }
397 416
398 private: 417 private:
(...skipping 19 matching lines...) Expand all
418 // or mode_ == kFlags_set. 437 // or mode_ == kFlags_set.
419 BasicBlock* true_block_; // Only valid if mode_ == kFlags_branch. 438 BasicBlock* true_block_; // Only valid if mode_ == kFlags_branch.
420 BasicBlock* false_block_; // Only valid if mode_ == kFlags_branch. 439 BasicBlock* false_block_; // Only valid if mode_ == kFlags_branch.
421 }; 440 };
422 441
423 } // namespace compiler 442 } // namespace compiler
424 } // namespace internal 443 } // namespace internal
425 } // namespace v8 444 } // namespace v8
426 445
427 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ 446 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
OLDNEW
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698