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

Side by Side Diff: src/compiler/js-typed-lowering.cc

Issue 1092353002: [strong] Disallow implicit conversions for binary arithmetic operations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cl feedback 5 Created 5 years, 8 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 #include "src/compiler/access-builder.h" 5 #include "src/compiler/access-builder.h"
6 #include "src/compiler/js-graph.h" 6 #include "src/compiler/js-graph.h"
7 #include "src/compiler/js-typed-lowering.h" 7 #include "src/compiler/js-typed-lowering.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 #include "src/compiler/operator-properties.h" 10 #include "src/compiler/operator-properties.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 return r.ChangeToPureOperator(simplified()->StringAdd()); 337 return r.ChangeToPureOperator(simplified()->StringAdd());
338 } 338 }
339 #endif 339 #endif
340 return NoChange(); 340 return NoChange();
341 } 341 }
342 342
343 343
344 Reduction JSTypedLowering::ReduceNumberBinop(Node* node, 344 Reduction JSTypedLowering::ReduceNumberBinop(Node* node,
345 const Operator* numberOp) { 345 const Operator* numberOp) {
346 JSBinopReduction r(this, node); 346 JSBinopReduction r(this, node);
347 if (is_strong(OpParameter<LanguageMode>(node))) {
348 if (r.left_type()->Is(Type::Number()) &&
349 (r.right_type()->Is(Type::Number()))) {
350 return r.ChangeToPureOperator(numberOp, Type::Number());
351 }
352 return NoChange();
353 }
347 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); 354 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1);
348 r.ConvertInputsToNumber(frame_state); 355 r.ConvertInputsToNumber(frame_state);
349 return r.ChangeToPureOperator(numberOp, Type::Number()); 356 return r.ChangeToPureOperator(numberOp, Type::Number());
350 } 357 }
351 358
352 359
353 Reduction JSTypedLowering::ReduceInt32Binop(Node* node, const Operator* intOp) { 360 Reduction JSTypedLowering::ReduceInt32Binop(Node* node, const Operator* intOp) {
354 JSBinopReduction r(this, node); 361 JSBinopReduction r(this, node);
355 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); 362 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1);
356 r.ConvertInputsToNumber(frame_state); 363 r.ConvertInputsToNumber(frame_state);
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 } 1076 }
1070 1077
1071 1078
1072 MachineOperatorBuilder* JSTypedLowering::machine() const { 1079 MachineOperatorBuilder* JSTypedLowering::machine() const {
1073 return jsgraph()->machine(); 1080 return jsgraph()->machine();
1074 } 1081 }
1075 1082
1076 } // namespace compiler 1083 } // namespace compiler
1077 } // namespace internal 1084 } // namespace internal
1078 } // namespace v8 1085 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-operator.cc ('k') | src/hydrogen.h » ('j') | src/ic/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698