Chromium Code Reviews| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 default: | 42 default: |
| 43 // Nothing to see. | 43 // Nothing to see. |
| 44 return NoChange(); | 44 return NoChange(); |
| 45 } | 45 } |
| 46 return Changed(node); | 46 return Changed(node); |
| 47 } | 47 } |
| 48 #define REPLACE_RUNTIME_CALL(op, fun) \ | 48 #define REPLACE_RUNTIME_CALL(op, fun) \ |
| 49 void JSGenericLowering::Lower##op(Node* node) { \ | 49 void JSGenericLowering::Lower##op(Node* node) { \ |
| 50 ReplaceWithRuntimeCall(node, fun); \ | 50 ReplaceWithRuntimeCall(node, fun); \ |
| 51 } | 51 } |
| 52 REPLACE_RUNTIME_CALL(JSCreateWithContext, Runtime::kPushWithContext) | |
| 53 REPLACE_RUNTIME_CALL(JSConvertReceiver, Runtime::kConvertReceiver) | 52 REPLACE_RUNTIME_CALL(JSConvertReceiver, Runtime::kConvertReceiver) |
|
Michael Starzinger
2016/09/05 12:10:39
suggestion: I know this is not part of your change
| |
| 54 #undef REPLACE_RUNTIME_CALL | 53 #undef REPLACE_RUNTIME_CALL |
| 55 | 54 |
| 56 #define REPLACE_STUB_CALL(Name) \ | 55 #define REPLACE_STUB_CALL(Name) \ |
| 57 void JSGenericLowering::LowerJS##Name(Node* node) { \ | 56 void JSGenericLowering::LowerJS##Name(Node* node) { \ |
| 58 CallDescriptor::Flags flags = FrameStateFlagForCall(node); \ | 57 CallDescriptor::Flags flags = FrameStateFlagForCall(node); \ |
| 59 Callable callable = CodeFactory::Name(isolate()); \ | 58 Callable callable = CodeFactory::Name(isolate()); \ |
| 60 ReplaceWithStubCall(node, callable, flags); \ | 59 ReplaceWithStubCall(node, callable, flags); \ |
| 61 } | 60 } |
| 62 REPLACE_STUB_CALL(Add) | 61 REPLACE_STUB_CALL(Add) |
| 63 REPLACE_STUB_CALL(Subtract) | 62 REPLACE_STUB_CALL(Subtract) |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 511 void JSGenericLowering::LowerJSCreateCatchContext(Node* node) { | 510 void JSGenericLowering::LowerJSCreateCatchContext(Node* node) { |
| 512 const CreateCatchContextParameters& parameters = | 511 const CreateCatchContextParameters& parameters = |
| 513 CreateCatchContextParametersOf(node->op()); | 512 CreateCatchContextParametersOf(node->op()); |
| 514 node->InsertInput(zone(), 0, | 513 node->InsertInput(zone(), 0, |
| 515 jsgraph()->HeapConstant(parameters.catch_name())); | 514 jsgraph()->HeapConstant(parameters.catch_name())); |
| 516 node->InsertInput(zone(), 2, | 515 node->InsertInput(zone(), 2, |
| 517 jsgraph()->HeapConstant(parameters.scope_info())); | 516 jsgraph()->HeapConstant(parameters.scope_info())); |
| 518 ReplaceWithRuntimeCall(node, Runtime::kPushCatchContext); | 517 ReplaceWithRuntimeCall(node, Runtime::kPushCatchContext); |
| 519 } | 518 } |
| 520 | 519 |
| 520 void JSGenericLowering::LowerJSCreateWithContext(Node* node) { | |
| 521 Handle<ScopeInfo> scope_info = OpParameter<Handle<ScopeInfo>>(node); | |
| 522 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(scope_info)); | |
| 523 ReplaceWithRuntimeCall(node, Runtime::kPushWithContext); | |
| 524 } | |
| 521 | 525 |
| 522 void JSGenericLowering::LowerJSCreateBlockContext(Node* node) { | 526 void JSGenericLowering::LowerJSCreateBlockContext(Node* node) { |
| 523 Handle<ScopeInfo> scope_info = OpParameter<Handle<ScopeInfo>>(node); | 527 Handle<ScopeInfo> scope_info = OpParameter<Handle<ScopeInfo>>(node); |
| 524 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(scope_info)); | 528 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(scope_info)); |
| 525 ReplaceWithRuntimeCall(node, Runtime::kPushBlockContext); | 529 ReplaceWithRuntimeCall(node, Runtime::kPushBlockContext); |
| 526 } | 530 } |
| 527 | 531 |
| 528 | 532 |
| 529 void JSGenericLowering::LowerJSCreateScriptContext(Node* node) { | 533 void JSGenericLowering::LowerJSCreateScriptContext(Node* node) { |
| 530 Handle<ScopeInfo> scope_info = OpParameter<Handle<ScopeInfo>>(node); | 534 Handle<ScopeInfo> scope_info = OpParameter<Handle<ScopeInfo>>(node); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 677 } | 681 } |
| 678 | 682 |
| 679 | 683 |
| 680 MachineOperatorBuilder* JSGenericLowering::machine() const { | 684 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 681 return jsgraph()->machine(); | 685 return jsgraph()->machine(); |
| 682 } | 686 } |
| 683 | 687 |
| 684 } // namespace compiler | 688 } // namespace compiler |
| 685 } // namespace internal | 689 } // namespace internal |
| 686 } // namespace v8 | 690 } // namespace v8 |
| OLD | NEW |