OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/compiler/js-call-reducer.h" | 5 #include "src/compiler/js-call-reducer.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/compilation-dependencies.h" | 9 #include "src/compilation-dependencies.h" |
10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 | 488 |
489 node->RemoveInput(arity--); | 489 node->RemoveInput(arity--); |
490 | 490 |
491 // Add the actual parameters to the {node}, skipping the receiver. | 491 // Add the actual parameters to the {node}, skipping the receiver. |
492 Node* const parameters = frame_state->InputAt(kFrameStateParametersInput); | 492 Node* const parameters = frame_state->InputAt(kFrameStateParametersInput); |
493 for (int i = start_index + 1; i < state_info.parameter_count(); ++i) { | 493 for (int i = start_index + 1; i < state_info.parameter_count(); ++i) { |
494 node->InsertInput(graph()->zone(), static_cast<int>(++arity), | 494 node->InsertInput(graph()->zone(), static_cast<int>(++arity), |
495 parameters->InputAt(i)); | 495 parameters->InputAt(i)); |
496 } | 496 } |
497 | 497 |
| 498 // TODO(turbofan): Collect call counts on spread call/construct and thread it |
| 499 // through here. |
498 if (node->opcode() == IrOpcode::kJSCallWithSpread) { | 500 if (node->opcode() == IrOpcode::kJSCallWithSpread) { |
499 NodeProperties::ChangeOp( | 501 NodeProperties::ChangeOp(node, javascript()->Call(arity + 1)); |
500 node, javascript()->Call(arity + 1, 7, VectorSlotPair())); | |
501 } else { | 502 } else { |
502 NodeProperties::ChangeOp( | 503 NodeProperties::ChangeOp(node, javascript()->Construct(arity + 2)); |
503 node, javascript()->Construct(arity + 2, 7, VectorSlotPair())); | |
504 } | 504 } |
505 return Changed(node); | 505 return Changed(node); |
506 } | 506 } |
507 | 507 |
508 namespace { | 508 namespace { |
509 | 509 |
510 bool ShouldUseCallICFeedback(Node* node) { | 510 bool ShouldUseCallICFeedback(Node* node) { |
511 HeapObjectMatcher m(node); | 511 HeapObjectMatcher m(node); |
512 if (m.HasValue() || m.IsJSCreateClosure()) { | 512 if (m.HasValue() || m.IsJSCreateClosure()) { |
513 // Don't use CallIC feedback when we know the function | 513 // Don't use CallIC feedback when we know the function |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 return jsgraph()->javascript(); | 851 return jsgraph()->javascript(); |
852 } | 852 } |
853 | 853 |
854 SimplifiedOperatorBuilder* JSCallReducer::simplified() const { | 854 SimplifiedOperatorBuilder* JSCallReducer::simplified() const { |
855 return jsgraph()->simplified(); | 855 return jsgraph()->simplified(); |
856 } | 856 } |
857 | 857 |
858 } // namespace compiler | 858 } // namespace compiler |
859 } // namespace internal | 859 } // namespace internal |
860 } // namespace v8 | 860 } // namespace v8 |
OLD | NEW |