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

Unified Diff: test/cctest/compiler/test-js-typed-lowering.cc

Issue 1130283002: [strong] Disallow implicit conversions for comparison (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cl feedback Created 5 years, 7 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/x87/lithium-x87.h ('k') | test/mjsunit/strong/implicit-conversions.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-js-typed-lowering.cc
diff --git a/test/cctest/compiler/test-js-typed-lowering.cc b/test/cctest/compiler/test-js-typed-lowering.cc
index 92fdb6e874948fe5dce46b25086973095a75b157..99cc77e3d69852cf09f3845f81375141226c7e65 100644
--- a/test/cctest/compiler/test-js-typed-lowering.cc
+++ b/test/cctest/compiler/test-js-typed-lowering.cc
@@ -688,18 +688,20 @@ TEST_WITH_STRONG(MixedComparison1) {
for (size_t j = 0; j < arraysize(types); j++) {
Node* p1 = R.Parameter(types[j], 1);
{
- Node* cmp = R.Binop(R.javascript.LessThan(language_mode), p0, p1);
+ const Operator* less_than = R.javascript.LessThan(language_mode);
+ Node* cmp = R.Binop(less_than, p0, p1);
Node* r = R.reduce(cmp);
-
- if (!types[i]->Maybe(Type::String()) ||
- !types[j]->Maybe(Type::String())) {
- if (types[i]->Is(Type::String()) && types[j]->Is(Type::String())) {
- R.CheckPureBinop(R.simplified.StringLessThan(), r);
- } else {
- R.CheckPureBinop(R.simplified.NumberLessThan(), r);
- }
+ if (types[i]->Is(Type::String()) && types[j]->Is(Type::String())) {
+ R.CheckPureBinop(R.simplified.StringLessThan(), r);
+ } else if ((types[i]->Is(Type::Number()) &&
+ types[j]->Is(Type::Number())) ||
+ (!is_strong(language_mode) &&
+ (!types[i]->Maybe(Type::String()) ||
+ !types[j]->Maybe(Type::String())))) {
+ R.CheckPureBinop(R.simplified.NumberLessThan(), r);
} else {
- CHECK_EQ(cmp, r); // No reduction of mixed types.
+ // No reduction of mixed types.
+ CHECK_EQ(r->op(), less_than);
}
}
}
« no previous file with comments | « src/x87/lithium-x87.h ('k') | test/mjsunit/strong/implicit-conversions.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698