| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 REPLACE_COMPARE_IC_CALL(JSGreaterThan, Token::GT) | 86 REPLACE_COMPARE_IC_CALL(JSGreaterThan, Token::GT) |
| 87 REPLACE_COMPARE_IC_CALL(JSLessThanOrEqual, Token::LTE) | 87 REPLACE_COMPARE_IC_CALL(JSLessThanOrEqual, Token::LTE) |
| 88 REPLACE_COMPARE_IC_CALL(JSGreaterThanOrEqual, Token::GTE) | 88 REPLACE_COMPARE_IC_CALL(JSGreaterThanOrEqual, Token::GTE) |
| 89 #undef REPLACE_COMPARE_IC_CALL | 89 #undef REPLACE_COMPARE_IC_CALL |
| 90 | 90 |
| 91 | 91 |
| 92 #define REPLACE_RUNTIME_CALL(op, fun) \ | 92 #define REPLACE_RUNTIME_CALL(op, fun) \ |
| 93 void JSGenericLowering::Lower##op(Node* node) { \ | 93 void JSGenericLowering::Lower##op(Node* node) { \ |
| 94 ReplaceWithRuntimeCall(node, fun); \ | 94 ReplaceWithRuntimeCall(node, fun); \ |
| 95 } | 95 } |
| 96 REPLACE_RUNTIME_CALL(JSTypeOf, Runtime::kTypeof) | |
| 97 REPLACE_RUNTIME_CALL(JSCreate, Runtime::kAbort) | 96 REPLACE_RUNTIME_CALL(JSCreate, Runtime::kAbort) |
| 98 REPLACE_RUNTIME_CALL(JSCreateFunctionContext, Runtime::kNewFunctionContext) | 97 REPLACE_RUNTIME_CALL(JSCreateFunctionContext, Runtime::kNewFunctionContext) |
| 99 REPLACE_RUNTIME_CALL(JSCreateWithContext, Runtime::kPushWithContext) | 98 REPLACE_RUNTIME_CALL(JSCreateWithContext, Runtime::kPushWithContext) |
| 100 REPLACE_RUNTIME_CALL(JSCreateBlockContext, Runtime::kPushBlockContext) | 99 REPLACE_RUNTIME_CALL(JSCreateBlockContext, Runtime::kPushBlockContext) |
| 101 REPLACE_RUNTIME_CALL(JSCreateModuleContext, Runtime::kPushModuleContext) | 100 REPLACE_RUNTIME_CALL(JSCreateModuleContext, Runtime::kPushModuleContext) |
| 102 REPLACE_RUNTIME_CALL(JSCreateScriptContext, Runtime::kNewScriptContext) | 101 REPLACE_RUNTIME_CALL(JSCreateScriptContext, Runtime::kNewScriptContext) |
| 103 #undef REPLACE_RUNTIME | 102 #undef REPLACE_RUNTIME |
| 104 | 103 |
| 105 | 104 |
| 106 #define REPLACE_UNIMPLEMENTED(op) \ | 105 #define REPLACE_UNIMPLEMENTED(op) \ |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 } | 266 } |
| 268 | 267 |
| 269 | 268 |
| 270 void JSGenericLowering::LowerJSUnaryNot(Node* node) { | 269 void JSGenericLowering::LowerJSUnaryNot(Node* node) { |
| 271 Callable callable = CodeFactory::ToBoolean( | 270 Callable callable = CodeFactory::ToBoolean( |
| 272 isolate(), ToBooleanStub::RESULT_AS_INVERSE_ODDBALL); | 271 isolate(), ToBooleanStub::RESULT_AS_INVERSE_ODDBALL); |
| 273 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); | 272 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); |
| 274 } | 273 } |
| 275 | 274 |
| 276 | 275 |
| 276 void JSGenericLowering::LowerJSTypeOf(Node* node) { |
| 277 Callable callable = CodeFactory::Typeof(isolate()); |
| 278 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); |
| 279 } |
| 280 |
| 281 |
| 277 void JSGenericLowering::LowerJSToBoolean(Node* node) { | 282 void JSGenericLowering::LowerJSToBoolean(Node* node) { |
| 278 Callable callable = | 283 Callable callable = |
| 279 CodeFactory::ToBoolean(isolate(), ToBooleanStub::RESULT_AS_ODDBALL); | 284 CodeFactory::ToBoolean(isolate(), ToBooleanStub::RESULT_AS_ODDBALL); |
| 280 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); | 285 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); |
| 281 } | 286 } |
| 282 | 287 |
| 283 | 288 |
| 284 void JSGenericLowering::LowerJSToNumber(Node* node) { | 289 void JSGenericLowering::LowerJSToNumber(Node* node) { |
| 285 Callable callable = CodeFactory::ToNumber(isolate()); | 290 Callable callable = CodeFactory::ToNumber(isolate()); |
| 286 ReplaceWithStubCall(node, callable, FlagsForNode(node)); | 291 ReplaceWithStubCall(node, callable, FlagsForNode(node)); |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 } | 575 } |
| 571 | 576 |
| 572 | 577 |
| 573 MachineOperatorBuilder* JSGenericLowering::machine() const { | 578 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 574 return jsgraph()->machine(); | 579 return jsgraph()->machine(); |
| 575 } | 580 } |
| 576 | 581 |
| 577 } // namespace compiler | 582 } // namespace compiler |
| 578 } // namespace internal | 583 } // namespace internal |
| 579 } // namespace v8 | 584 } // namespace v8 |
| OLD | NEW |