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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector-impl.h
diff --git a/src/compiler/instruction-selector-impl.h b/src/compiler/instruction-selector-impl.h
index 83d18c3fc053af9f8f891a1a2f2da2088ee756cb..25d8a99e866c2f8dfe995ca7f5c050a23910d3f7 100644
--- a/src/compiler/instruction-selector-impl.h
+++ b/src/compiler/instruction-selector-impl.h
@@ -386,6 +386,25 @@ class FlagsContinuation final {
if (negate) Negate();
}
+ void OverwriteUnsignedIfSigned() {
+ switch (condition_) {
+ case kSignedLessThan:
+ condition_ = kUnsignedLessThan;
+ break;
+ case kSignedLessThanOrEqual:
+ condition_ = kUnsignedLessThanOrEqual;
+ break;
+ case kSignedGreaterThan:
+ condition_ = kUnsignedGreaterThan;
+ break;
+ case kSignedGreaterThanOrEqual:
+ condition_ = kUnsignedGreaterThanOrEqual;
+ break;
+ default:
+ break;
+ }
+ }
+
// Encodes this flags continuation into the given opcode.
InstructionCode Encode(InstructionCode opcode) {
opcode |= FlagsModeField::encode(mode_);
« 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