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

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

Issue 1436493002: [builtins] Introduce specialized Call/CallFunction builtins. (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/code-stubs.h ('k') | src/compiler/js-operator.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/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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 node->InsertInput(zone(), 2, actual_construct); 536 node->InsertInput(zone(), 2, actual_construct);
537 node->InsertInput(zone(), 3, original_construct); 537 node->InsertInput(zone(), 3, original_construct);
538 node->InsertInput(zone(), 4, jsgraph()->UndefinedConstant()); 538 node->InsertInput(zone(), 4, jsgraph()->UndefinedConstant());
539 NodeProperties::ChangeOp(node, common()->Call(desc)); 539 NodeProperties::ChangeOp(node, common()->Call(desc));
540 } 540 }
541 541
542 542
543 void JSGenericLowering::LowerJSCallFunction(Node* node) { 543 void JSGenericLowering::LowerJSCallFunction(Node* node) {
544 CallFunctionParameters const& p = CallFunctionParametersOf(node->op()); 544 CallFunctionParameters const& p = CallFunctionParametersOf(node->op());
545 int const arg_count = static_cast<int>(p.arity() - 2); 545 int const arg_count = static_cast<int>(p.arity() - 2);
546 Callable callable = CodeFactory::Call(isolate()); 546 ConvertReceiverMode const mode = p.convert_mode();
547 Callable callable = CodeFactory::Call(isolate(), mode);
547 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); 548 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
548 if (p.tail_call_mode() == TailCallMode::kAllow) { 549 if (p.tail_call_mode() == TailCallMode::kAllow) {
549 flags |= CallDescriptor::kSupportsTailCalls; 550 flags |= CallDescriptor::kSupportsTailCalls;
550 } 551 }
551 CallDescriptor* desc = Linkage::GetStubCallDescriptor( 552 CallDescriptor* desc = Linkage::GetStubCallDescriptor(
552 isolate(), zone(), callable.descriptor(), arg_count + 1, flags); 553 isolate(), zone(), callable.descriptor(), arg_count + 1, flags);
553 Node* stub_code = jsgraph()->HeapConstant(callable.code()); 554 Node* stub_code = jsgraph()->HeapConstant(callable.code());
554 Node* stub_arity = jsgraph()->Int32Constant(arg_count); 555 Node* stub_arity = jsgraph()->Int32Constant(arg_count);
555 node->InsertInput(zone(), 0, stub_code); 556 node->InsertInput(zone(), 0, stub_code);
556 node->InsertInput(zone(), 2, stub_arity); 557 node->InsertInput(zone(), 2, stub_arity);
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 } 832 }
832 833
833 834
834 MachineOperatorBuilder* JSGenericLowering::machine() const { 835 MachineOperatorBuilder* JSGenericLowering::machine() const {
835 return jsgraph()->machine(); 836 return jsgraph()->machine();
836 } 837 }
837 838
838 } // namespace compiler 839 } // namespace compiler
839 } // namespace internal 840 } // namespace internal
840 } // namespace v8 841 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler/js-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698