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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); \ | 69 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); \ |
70 ReplaceWithStubCall(node, CodeFactory::BinaryOpIC(isolate(), token), \ | 70 ReplaceWithStubCall(node, CodeFactory::BinaryOpIC(isolate(), token), \ |
71 CallDescriptor::kPatchableCallSiteWithNop | flags); \ | 71 CallDescriptor::kPatchableCallSiteWithNop | flags); \ |
72 } | 72 } |
73 REPLACE_BINARY_OP_IC_CALL(JSBitwiseOr, Token::BIT_OR) | 73 REPLACE_BINARY_OP_IC_CALL(JSBitwiseOr, Token::BIT_OR) |
74 REPLACE_BINARY_OP_IC_CALL(JSBitwiseXor, Token::BIT_XOR) | 74 REPLACE_BINARY_OP_IC_CALL(JSBitwiseXor, Token::BIT_XOR) |
75 REPLACE_BINARY_OP_IC_CALL(JSBitwiseAnd, Token::BIT_AND) | 75 REPLACE_BINARY_OP_IC_CALL(JSBitwiseAnd, Token::BIT_AND) |
76 REPLACE_BINARY_OP_IC_CALL(JSShiftLeft, Token::SHL) | 76 REPLACE_BINARY_OP_IC_CALL(JSShiftLeft, Token::SHL) |
77 REPLACE_BINARY_OP_IC_CALL(JSShiftRight, Token::SAR) | 77 REPLACE_BINARY_OP_IC_CALL(JSShiftRight, Token::SAR) |
78 REPLACE_BINARY_OP_IC_CALL(JSShiftRightLogical, Token::SHR) | 78 REPLACE_BINARY_OP_IC_CALL(JSShiftRightLogical, Token::SHR) |
79 REPLACE_BINARY_OP_IC_CALL(JSAdd, Token::ADD) | |
80 REPLACE_BINARY_OP_IC_CALL(JSSubtract, Token::SUB) | |
81 REPLACE_BINARY_OP_IC_CALL(JSMultiply, Token::MUL) | 79 REPLACE_BINARY_OP_IC_CALL(JSMultiply, Token::MUL) |
82 REPLACE_BINARY_OP_IC_CALL(JSDivide, Token::DIV) | 80 REPLACE_BINARY_OP_IC_CALL(JSDivide, Token::DIV) |
83 REPLACE_BINARY_OP_IC_CALL(JSModulus, Token::MOD) | 81 REPLACE_BINARY_OP_IC_CALL(JSModulus, Token::MOD) |
84 #undef REPLACE_BINARY_OP_IC_CALL | 82 #undef REPLACE_BINARY_OP_IC_CALL |
85 | 83 |
86 #define REPLACE_RUNTIME_CALL(op, fun) \ | 84 #define REPLACE_RUNTIME_CALL(op, fun) \ |
87 void JSGenericLowering::Lower##op(Node* node) { \ | 85 void JSGenericLowering::Lower##op(Node* node) { \ |
88 ReplaceWithRuntimeCall(node, fun); \ | 86 ReplaceWithRuntimeCall(node, fun); \ |
89 } | 87 } |
90 REPLACE_RUNTIME_CALL(JSCreateWithContext, Runtime::kPushWithContext) | 88 REPLACE_RUNTIME_CALL(JSCreateWithContext, Runtime::kPushWithContext) |
91 REPLACE_RUNTIME_CALL(JSCreateModuleContext, Runtime::kPushModuleContext) | 89 REPLACE_RUNTIME_CALL(JSCreateModuleContext, Runtime::kPushModuleContext) |
92 REPLACE_RUNTIME_CALL(JSConvertReceiver, Runtime::kConvertReceiver) | 90 REPLACE_RUNTIME_CALL(JSConvertReceiver, Runtime::kConvertReceiver) |
93 #undef REPLACE_RUNTIME_CALL | 91 #undef REPLACE_RUNTIME_CALL |
94 | 92 |
95 #define REPLACE_STUB_CALL(Name) \ | 93 #define REPLACE_STUB_CALL(Name) \ |
96 void JSGenericLowering::LowerJS##Name(Node* node) { \ | 94 void JSGenericLowering::LowerJS##Name(Node* node) { \ |
97 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); \ | 95 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); \ |
98 Callable callable = CodeFactory::Name(isolate()); \ | 96 Callable callable = CodeFactory::Name(isolate()); \ |
99 ReplaceWithStubCall(node, callable, flags); \ | 97 ReplaceWithStubCall(node, callable, flags); \ |
100 } | 98 } |
| 99 REPLACE_STUB_CALL(Add) |
| 100 REPLACE_STUB_CALL(Subtract) |
101 REPLACE_STUB_CALL(LessThan) | 101 REPLACE_STUB_CALL(LessThan) |
102 REPLACE_STUB_CALL(LessThanOrEqual) | 102 REPLACE_STUB_CALL(LessThanOrEqual) |
103 REPLACE_STUB_CALL(GreaterThan) | 103 REPLACE_STUB_CALL(GreaterThan) |
104 REPLACE_STUB_CALL(GreaterThanOrEqual) | 104 REPLACE_STUB_CALL(GreaterThanOrEqual) |
105 REPLACE_STUB_CALL(Equal) | 105 REPLACE_STUB_CALL(Equal) |
106 REPLACE_STUB_CALL(NotEqual) | 106 REPLACE_STUB_CALL(NotEqual) |
107 REPLACE_STUB_CALL(StrictEqual) | 107 REPLACE_STUB_CALL(StrictEqual) |
108 REPLACE_STUB_CALL(StrictNotEqual) | 108 REPLACE_STUB_CALL(StrictNotEqual) |
109 #undef REPLACE_STUB_CALL | 109 #undef REPLACE_STUB_CALL |
110 | 110 |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 } | 774 } |
775 | 775 |
776 | 776 |
777 MachineOperatorBuilder* JSGenericLowering::machine() const { | 777 MachineOperatorBuilder* JSGenericLowering::machine() const { |
778 return jsgraph()->machine(); | 778 return jsgraph()->machine(); |
779 } | 779 } |
780 | 780 |
781 } // namespace compiler | 781 } // namespace compiler |
782 } // namespace internal | 782 } // namespace internal |
783 } // namespace v8 | 783 } // namespace v8 |
OLD | NEW |