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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 | 513 |
514 // Extract feedback from the {node} using the CallICNexus. | 514 // Extract feedback from the {node} using the CallICNexus. |
515 if (!p.feedback().IsValid()) return NoChange(); | 515 if (!p.feedback().IsValid()) return NoChange(); |
516 CallICNexus nexus(p.feedback().vector(), p.feedback().slot()); | 516 CallICNexus nexus(p.feedback().vector(), p.feedback().slot()); |
517 if (nexus.IsUninitialized()) { | 517 if (nexus.IsUninitialized()) { |
518 // TODO(turbofan): Tail-calling to a CallIC stub is not supported. | 518 // TODO(turbofan): Tail-calling to a CallIC stub is not supported. |
519 if (p.tail_call_mode() == TailCallMode::kAllow) return NoChange(); | 519 if (p.tail_call_mode() == TailCallMode::kAllow) return NoChange(); |
520 | 520 |
521 // Insert a CallIC here to collect feedback for uninitialized calls. | 521 // Insert a CallIC here to collect feedback for uninitialized calls. |
522 int const arg_count = static_cast<int>(p.arity() - 2); | 522 int const arg_count = static_cast<int>(p.arity() - 2); |
523 Callable callable = | 523 Callable callable = CodeFactory::CallIC(isolate(), p.convert_mode()); |
524 CodeFactory::CallICInOptimizedCode(isolate(), p.convert_mode()); | |
525 CallDescriptor::Flags flags = CallDescriptor::kNeedsFrameState; | 524 CallDescriptor::Flags flags = CallDescriptor::kNeedsFrameState; |
526 CallDescriptor const* const desc = Linkage::GetStubCallDescriptor( | 525 CallDescriptor const* const desc = Linkage::GetStubCallDescriptor( |
527 isolate(), graph()->zone(), callable.descriptor(), arg_count + 1, | 526 isolate(), graph()->zone(), callable.descriptor(), arg_count + 1, |
528 flags); | 527 flags); |
529 Node* stub_code = jsgraph()->HeapConstant(callable.code()); | 528 Node* stub_code = jsgraph()->HeapConstant(callable.code()); |
530 Node* stub_arity = jsgraph()->Constant(arg_count); | 529 Node* stub_arity = jsgraph()->Constant(arg_count); |
531 Node* slot_index = | 530 Node* slot_index = |
532 jsgraph()->Constant(TypeFeedbackVector::GetIndex(p.feedback().slot())); | 531 jsgraph()->Constant(TypeFeedbackVector::GetIndex(p.feedback().slot())); |
533 Node* feedback_vector = jsgraph()->HeapConstant(p.feedback().vector()); | 532 Node* feedback_vector = jsgraph()->HeapConstant(p.feedback().vector()); |
534 node->InsertInput(graph()->zone(), 0, stub_code); | 533 node->InsertInput(graph()->zone(), 0, stub_code); |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 return jsgraph()->javascript(); | 782 return jsgraph()->javascript(); |
784 } | 783 } |
785 | 784 |
786 SimplifiedOperatorBuilder* JSCallReducer::simplified() const { | 785 SimplifiedOperatorBuilder* JSCallReducer::simplified() const { |
787 return jsgraph()->simplified(); | 786 return jsgraph()->simplified(); |
788 } | 787 } |
789 | 788 |
790 } // namespace compiler | 789 } // namespace compiler |
791 } // namespace internal | 790 } // namespace internal |
792 } // namespace v8 | 791 } // namespace v8 |
OLD | NEW |