| 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/compilation-dependencies.h" | 6 #include "src/compilation-dependencies.h" |
| 7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
| 8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
| 9 #include "src/compiler/js-typed-lowering.h" | 9 #include "src/compiler/js-typed-lowering.h" |
| 10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
| (...skipping 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1813 | 1813 |
| 1814 // Compute flags for the call. | 1814 // Compute flags for the call. |
| 1815 CallDescriptor::Flags flags = CallDescriptor::kNeedsFrameState; | 1815 CallDescriptor::Flags flags = CallDescriptor::kNeedsFrameState; |
| 1816 if (p.tail_call_mode() == TailCallMode::kAllow) { | 1816 if (p.tail_call_mode() == TailCallMode::kAllow) { |
| 1817 flags |= CallDescriptor::kSupportsTailCalls; | 1817 flags |= CallDescriptor::kSupportsTailCalls; |
| 1818 } | 1818 } |
| 1819 | 1819 |
| 1820 if (shared->internal_formal_parameter_count() == arity || | 1820 if (shared->internal_formal_parameter_count() == arity || |
| 1821 shared->internal_formal_parameter_count() == | 1821 shared->internal_formal_parameter_count() == |
| 1822 SharedFunctionInfo::kDontAdaptArgumentsSentinel) { | 1822 SharedFunctionInfo::kDontAdaptArgumentsSentinel) { |
| 1823 Node* new_target = jsgraph()->UndefinedConstant(); |
| 1824 Node* argument_count = jsgraph()->Int32Constant(arity); |
| 1823 // Patch {node} to a direct call. | 1825 // Patch {node} to a direct call. |
| 1824 node->InsertInput(graph()->zone(), arity + 2, | 1826 node->InsertInput(graph()->zone(), arity + 2, new_target); |
| 1825 jsgraph()->Int32Constant(arity)); | 1827 node->InsertInput(graph()->zone(), arity + 3, argument_count); |
| 1826 NodeProperties::ChangeOp(node, | 1828 NodeProperties::ChangeOp(node, |
| 1827 common()->Call(Linkage::GetJSCallDescriptor( | 1829 common()->Call(Linkage::GetJSCallDescriptor( |
| 1828 graph()->zone(), false, 1 + arity, flags))); | 1830 graph()->zone(), false, 1 + arity, flags))); |
| 1829 } else { | 1831 } else { |
| 1830 // Patch {node} to an indirect call via the ArgumentsAdaptorTrampoline. | 1832 // Patch {node} to an indirect call via the ArgumentsAdaptorTrampoline. |
| 1831 Callable callable = CodeFactory::ArgumentAdaptor(isolate()); | 1833 Callable callable = CodeFactory::ArgumentAdaptor(isolate()); |
| 1832 node->InsertInput(graph()->zone(), 0, | 1834 node->InsertInput(graph()->zone(), 0, |
| 1833 jsgraph()->HeapConstant(callable.code())); | 1835 jsgraph()->HeapConstant(callable.code())); |
| 1834 node->InsertInput(graph()->zone(), 2, jsgraph()->Int32Constant(arity)); | 1836 node->InsertInput(graph()->zone(), 2, jsgraph()->Int32Constant(arity)); |
| 1835 node->InsertInput( | 1837 node->InsertInput( |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2383 } | 2385 } |
| 2384 | 2386 |
| 2385 | 2387 |
| 2386 CompilationDependencies* JSTypedLowering::dependencies() const { | 2388 CompilationDependencies* JSTypedLowering::dependencies() const { |
| 2387 return dependencies_; | 2389 return dependencies_; |
| 2388 } | 2390 } |
| 2389 | 2391 |
| 2390 } // namespace compiler | 2392 } // namespace compiler |
| 2391 } // namespace internal | 2393 } // namespace internal |
| 2392 } // namespace v8 | 2394 } // namespace v8 |
| OLD | NEW |