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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 REPLACE_BINARY_OP_IC_CALL(JSDivide, Token::DIV) | 82 REPLACE_BINARY_OP_IC_CALL(JSDivide, Token::DIV) |
83 REPLACE_BINARY_OP_IC_CALL(JSModulus, Token::MOD) | 83 REPLACE_BINARY_OP_IC_CALL(JSModulus, Token::MOD) |
84 #undef REPLACE_BINARY_OP_IC_CALL | 84 #undef REPLACE_BINARY_OP_IC_CALL |
85 | 85 |
86 #define REPLACE_RUNTIME_CALL(op, fun) \ | 86 #define REPLACE_RUNTIME_CALL(op, fun) \ |
87 void JSGenericLowering::Lower##op(Node* node) { \ | 87 void JSGenericLowering::Lower##op(Node* node) { \ |
88 ReplaceWithRuntimeCall(node, fun); \ | 88 ReplaceWithRuntimeCall(node, fun); \ |
89 } | 89 } |
90 REPLACE_RUNTIME_CALL(JSEqual, Runtime::kEqual) | 90 REPLACE_RUNTIME_CALL(JSEqual, Runtime::kEqual) |
91 REPLACE_RUNTIME_CALL(JSNotEqual, Runtime::kNotEqual) | 91 REPLACE_RUNTIME_CALL(JSNotEqual, Runtime::kNotEqual) |
92 REPLACE_RUNTIME_CALL(JSLessThan, Runtime::kLessThan) | |
93 REPLACE_RUNTIME_CALL(JSGreaterThan, Runtime::kGreaterThan) | |
94 REPLACE_RUNTIME_CALL(JSLessThanOrEqual, Runtime::kLessThanOrEqual) | |
95 REPLACE_RUNTIME_CALL(JSGreaterThanOrEqual, Runtime::kGreaterThanOrEqual) | |
96 REPLACE_RUNTIME_CALL(JSCreateWithContext, Runtime::kPushWithContext) | 92 REPLACE_RUNTIME_CALL(JSCreateWithContext, Runtime::kPushWithContext) |
97 REPLACE_RUNTIME_CALL(JSCreateModuleContext, Runtime::kPushModuleContext) | 93 REPLACE_RUNTIME_CALL(JSCreateModuleContext, Runtime::kPushModuleContext) |
98 REPLACE_RUNTIME_CALL(JSConvertReceiver, Runtime::kConvertReceiver) | 94 REPLACE_RUNTIME_CALL(JSConvertReceiver, Runtime::kConvertReceiver) |
99 #undef REPLACE_RUNTIME_CALL | 95 #undef REPLACE_RUNTIME_CALL |
100 | 96 |
101 #define REPLACE_STUB_CALL(Name) \ | 97 #define REPLACE_STUB_CALL(Name) \ |
102 void JSGenericLowering::LowerJS##Name(Node* node) { \ | 98 void JSGenericLowering::LowerJS##Name(Node* node) { \ |
103 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); \ | 99 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); \ |
104 Callable callable = CodeFactory::Name(isolate()); \ | 100 Callable callable = CodeFactory::Name(isolate()); \ |
105 ReplaceWithStubCall(node, callable, flags); \ | 101 ReplaceWithStubCall(node, callable, flags); \ |
106 } | 102 } |
| 103 REPLACE_STUB_CALL(LessThan) |
| 104 REPLACE_STUB_CALL(LessThanOrEqual) |
| 105 REPLACE_STUB_CALL(GreaterThan) |
| 106 REPLACE_STUB_CALL(GreaterThanOrEqual) |
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 |
111 void JSGenericLowering::ReplaceWithStubCall(Node* node, Callable callable, | 111 void JSGenericLowering::ReplaceWithStubCall(Node* node, Callable callable, |
112 CallDescriptor::Flags flags) { | 112 CallDescriptor::Flags flags) { |
113 Operator::Properties properties = node->op()->properties(); | 113 Operator::Properties properties = node->op()->properties(); |
114 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 114 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
115 isolate(), zone(), callable.descriptor(), 0, flags, properties); | 115 isolate(), zone(), callable.descriptor(), 0, flags, properties); |
116 Node* stub_code = jsgraph()->HeapConstant(callable.code()); | 116 Node* stub_code = jsgraph()->HeapConstant(callable.code()); |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 } | 776 } |
777 | 777 |
778 | 778 |
779 MachineOperatorBuilder* JSGenericLowering::machine() const { | 779 MachineOperatorBuilder* JSGenericLowering::machine() const { |
780 return jsgraph()->machine(); | 780 return jsgraph()->machine(); |
781 } | 781 } |
782 | 782 |
783 } // namespace compiler | 783 } // namespace compiler |
784 } // namespace internal | 784 } // namespace internal |
785 } // namespace v8 | 785 } // namespace v8 |
OLD | NEW |