Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: src/compiler/js-typed-lowering.cc

Issue 1461973002: [turbofan] Make new.target explicit in JSCallDescriptor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | src/compiler/linkage.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | src/compiler/linkage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698