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

Side by Side Diff: src/compiler/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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "src/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/compiler/access-builder.h" 6 #include "src/compiler/access-builder.h"
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/js-typed-lowering.h" 8 #include "src/compiler/js-typed-lowering.h"
9 #include "src/compiler/linkage.h" 9 #include "src/compiler/linkage.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 break; 463 break;
464 case IrOpcode::kJSGreaterThanOrEqual: 464 case IrOpcode::kJSGreaterThanOrEqual:
465 stringOp = simplified()->StringLessThanOrEqual(); 465 stringOp = simplified()->StringLessThanOrEqual();
466 r.SwapInputs(); // a >= b => b <= a 466 r.SwapInputs(); // a >= b => b <= a
467 break; 467 break;
468 default: 468 default:
469 return NoChange(); 469 return NoChange();
470 } 470 }
471 return r.ChangeToPureOperator(stringOp); 471 return r.ChangeToPureOperator(stringOp);
472 } 472 }
473 if (r.IsStrong() && !r.BothInputsAre(Type::Number())) {
474 return NoChange();
475 }
473 #if 0 476 #if 0
474 // TODO(turbofan): General ToNumber disabled for now because: 477 // TODO(turbofan): General ToNumber disabled for now because:
475 // a) The inserted ToNumber operation screws up observability of valueOf. 478 // a) The inserted ToNumber operation screws up observability of valueOf.
476 // b) Deoptimization at ToNumber doesn't have corresponding bailout id. 479 // b) Deoptimization at ToNumber doesn't have corresponding bailout id.
477 Type* maybe_string = Type::Union(Type::String(), Type::Receiver(), zone()); 480 Type* maybe_string = Type::Union(Type::String(), Type::Receiver(), zone());
478 if (r.OneInputCannotBe(maybe_string)) { 481 if (r.OneInputCannotBe(maybe_string)) {
479 // If one input cannot be a string, then emit a number comparison. 482 // If one input cannot be a string, then emit a number comparison.
480 ... 483 ...
481 } 484 }
482 #endif 485 #endif
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 } 1313 }
1311 1314
1312 1315
1313 MachineOperatorBuilder* JSTypedLowering::machine() const { 1316 MachineOperatorBuilder* JSTypedLowering::machine() const {
1314 return jsgraph()->machine(); 1317 return jsgraph()->machine();
1315 } 1318 }
1316 1319
1317 } // namespace compiler 1320 } // namespace compiler
1318 } // namespace internal 1321 } // namespace internal
1319 } // namespace v8 1322 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698