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

Side by Side Diff: src/compiler/js-generic-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/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/code-stubs.h" 6 #include "src/code-stubs.h"
7 #include "src/compiler/common-operator.h" 7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/js-generic-lowering.h" 8 #include "src/compiler/js-generic-lowering.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/machine-operator.h" 10 #include "src/compiler/machine-operator.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 default: 49 default:
50 // Nothing to see. 50 // Nothing to see.
51 return NoChange(); 51 return NoChange();
52 } 52 }
53 return Changed(node); 53 return Changed(node);
54 } 54 }
55 55
56 56
57 #define REPLACE_BINARY_OP_IC_CALL(op, token) \ 57 #define REPLACE_BINARY_OP_IC_CALL(op, token) \
58 void JSGenericLowering::Lower##op(Node* node) { \ 58 void JSGenericLowering::Lower##op(Node* node) { \
59 ReplaceWithStubCall(node, CodeFactory::BinaryOpIC(isolate(), token), \ 59 ReplaceWithStubCall(node, CodeFactory::BinaryOpIC(isolate(), token, \
60 OpParameter<LanguageMode>(node)), \
60 CallDescriptor::kPatchableCallSiteWithNop); \ 61 CallDescriptor::kPatchableCallSiteWithNop); \
61 } 62 }
62 REPLACE_BINARY_OP_IC_CALL(JSBitwiseOr, Token::BIT_OR) 63 REPLACE_BINARY_OP_IC_CALL(JSBitwiseOr, Token::BIT_OR)
63 REPLACE_BINARY_OP_IC_CALL(JSBitwiseXor, Token::BIT_XOR) 64 REPLACE_BINARY_OP_IC_CALL(JSBitwiseXor, Token::BIT_XOR)
64 REPLACE_BINARY_OP_IC_CALL(JSBitwiseAnd, Token::BIT_AND) 65 REPLACE_BINARY_OP_IC_CALL(JSBitwiseAnd, Token::BIT_AND)
65 REPLACE_BINARY_OP_IC_CALL(JSShiftLeft, Token::SHL) 66 REPLACE_BINARY_OP_IC_CALL(JSShiftLeft, Token::SHL)
66 REPLACE_BINARY_OP_IC_CALL(JSShiftRight, Token::SAR) 67 REPLACE_BINARY_OP_IC_CALL(JSShiftRight, Token::SAR)
67 REPLACE_BINARY_OP_IC_CALL(JSShiftRightLogical, Token::SHR) 68 REPLACE_BINARY_OP_IC_CALL(JSShiftRightLogical, Token::SHR)
68 REPLACE_BINARY_OP_IC_CALL(JSAdd, Token::ADD) 69 REPLACE_BINARY_OP_IC_CALL(JSAdd, Token::ADD)
69 REPLACE_BINARY_OP_IC_CALL(JSSubtract, Token::SUB) 70 REPLACE_BINARY_OP_IC_CALL(JSSubtract, Token::SUB)
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 } 548 }
548 549
549 550
550 MachineOperatorBuilder* JSGenericLowering::machine() const { 551 MachineOperatorBuilder* JSGenericLowering::machine() const {
551 return jsgraph()->machine(); 552 return jsgraph()->machine();
552 } 553 }
553 554
554 } // namespace compiler 555 } // namespace compiler
555 } // namespace internal 556 } // namespace internal
556 } // namespace v8 557 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/js-operator.h » ('j') | src/ic/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698