| OLD | NEW |
| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 } | 56 } |
| 57 // Fall-through. | 57 // Fall-through. |
| 58 default: | 58 default: |
| 59 // Nothing to see. | 59 // Nothing to see. |
| 60 return NoChange(); | 60 return NoChange(); |
| 61 } | 61 } |
| 62 return Changed(node); | 62 return Changed(node); |
| 63 } | 63 } |
| 64 | 64 |
| 65 | 65 |
| 66 #define REPLACE_BINARY_OP_IC_CALL(op, token) \ | 66 #define REPLACE_BINARY_OP_IC_CALL(Op, token) \ |
| 67 void JSGenericLowering::Lower##op(Node* node) { \ | 67 void JSGenericLowering::Lower##Op(Node* node) { \ |
| 68 BinaryOperationParameters const& p = \ |
| 69 BinaryOperationParametersOf(node->op()); \ |
| 68 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); \ | 70 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); \ |
| 69 ReplaceWithStubCall(node, CodeFactory::BinaryOpIC( \ | 71 ReplaceWithStubCall(node, \ |
| 70 isolate(), token, \ | 72 CodeFactory::BinaryOpIC(isolate(), token, \ |
| 71 strength(OpParameter<LanguageMode>(node))), \ | 73 strength(p.language_mode())), \ |
| 72 CallDescriptor::kPatchableCallSiteWithNop | flags); \ | 74 CallDescriptor::kPatchableCallSiteWithNop | flags); \ |
| 73 } | 75 } |
| 74 REPLACE_BINARY_OP_IC_CALL(JSBitwiseOr, Token::BIT_OR) | 76 REPLACE_BINARY_OP_IC_CALL(JSBitwiseOr, Token::BIT_OR) |
| 75 REPLACE_BINARY_OP_IC_CALL(JSBitwiseXor, Token::BIT_XOR) | 77 REPLACE_BINARY_OP_IC_CALL(JSBitwiseXor, Token::BIT_XOR) |
| 76 REPLACE_BINARY_OP_IC_CALL(JSBitwiseAnd, Token::BIT_AND) | 78 REPLACE_BINARY_OP_IC_CALL(JSBitwiseAnd, Token::BIT_AND) |
| 77 REPLACE_BINARY_OP_IC_CALL(JSShiftLeft, Token::SHL) | 79 REPLACE_BINARY_OP_IC_CALL(JSShiftLeft, Token::SHL) |
| 78 REPLACE_BINARY_OP_IC_CALL(JSShiftRight, Token::SAR) | 80 REPLACE_BINARY_OP_IC_CALL(JSShiftRight, Token::SAR) |
| 79 REPLACE_BINARY_OP_IC_CALL(JSShiftRightLogical, Token::SHR) | 81 REPLACE_BINARY_OP_IC_CALL(JSShiftRightLogical, Token::SHR) |
| 80 REPLACE_BINARY_OP_IC_CALL(JSAdd, Token::ADD) | 82 REPLACE_BINARY_OP_IC_CALL(JSAdd, Token::ADD) |
| 81 REPLACE_BINARY_OP_IC_CALL(JSSubtract, Token::SUB) | 83 REPLACE_BINARY_OP_IC_CALL(JSSubtract, Token::SUB) |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 } | 892 } |
| 891 | 893 |
| 892 | 894 |
| 893 MachineOperatorBuilder* JSGenericLowering::machine() const { | 895 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 894 return jsgraph()->machine(); | 896 return jsgraph()->machine(); |
| 895 } | 897 } |
| 896 | 898 |
| 897 } // namespace compiler | 899 } // namespace compiler |
| 898 } // namespace internal | 900 } // namespace internal |
| 899 } // namespace v8 | 901 } // namespace v8 |
| OLD | NEW |