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

Side by Side Diff: src/builtins/builtins-constructor-gen.cc

Issue 2930623002: [builtins] Start refactoring the Apply builtin. (Closed)
Patch Set: Address feedback. Created 3 years, 6 months 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/builtins/builtins-call-gen.cc ('k') | src/builtins/builtins-definitions.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/builtins/builtins-constructor-gen.h" 5 #include "src/builtins/builtins-constructor-gen.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/builtins/builtins-call-gen.h"
8 #include "src/builtins/builtins-constructor.h" 9 #include "src/builtins/builtins-constructor.h"
9 #include "src/builtins/builtins-utils-gen.h" 10 #include "src/builtins/builtins-utils-gen.h"
10 #include "src/builtins/builtins.h" 11 #include "src/builtins/builtins.h"
11 #include "src/code-factory.h" 12 #include "src/code-factory.h"
12 #include "src/code-stub-assembler.h" 13 #include "src/code-stub-assembler.h"
13 #include "src/counters.h" 14 #include "src/counters.h"
14 #include "src/interface-descriptors.h" 15 #include "src/interface-descriptors.h"
15 #include "src/objects-inl.h" 16 #include "src/objects-inl.h"
16 17
17 namespace v8 { 18 namespace v8 {
18 namespace internal { 19 namespace internal {
19 20
21 void Builtins::Generate_ConstructVarargs(MacroAssembler* masm) {
22 Generate_CallOrConstructVarargs(masm,
23 masm->isolate()->builtins()->Construct());
24 }
25
20 void Builtins::Generate_ConstructForwardVarargs(MacroAssembler* masm) { 26 void Builtins::Generate_ConstructForwardVarargs(MacroAssembler* masm) {
21 Generate_ForwardVarargs(masm, masm->isolate()->builtins()->Construct()); 27 Generate_CallOrConstructForwardVarargs(
28 masm, masm->isolate()->builtins()->Construct());
22 } 29 }
23 30
24 void Builtins::Generate_ConstructFunctionForwardVarargs(MacroAssembler* masm) { 31 void Builtins::Generate_ConstructFunctionForwardVarargs(MacroAssembler* masm) {
25 Generate_ForwardVarargs(masm, 32 Generate_CallOrConstructForwardVarargs(
26 masm->isolate()->builtins()->ConstructFunction()); 33 masm, masm->isolate()->builtins()->ConstructFunction());
34 }
35
36 TF_BUILTIN(ConstructWithArrayLike, CallOrConstructBuiltinsAssembler) {
37 Node* target = Parameter(ConstructWithArrayLikeDescriptor::kTarget);
38 Node* new_target = Parameter(ConstructWithArrayLikeDescriptor::kNewTarget);
39 Node* arguments_list =
40 Parameter(ConstructWithArrayLikeDescriptor::kArgumentsList);
41 Node* context = Parameter(ConstructWithArrayLikeDescriptor::kContext);
42 CallOrConstructWithArrayLike(target, new_target, arguments_list, context);
27 } 43 }
28 44
29 typedef compiler::Node Node; 45 typedef compiler::Node Node;
30 46
31 Node* ConstructorBuiltinsAssembler::CopyFixedArrayBase(Node* fixed_array) { 47 Node* ConstructorBuiltinsAssembler::CopyFixedArrayBase(Node* fixed_array) {
32 Label if_fixed_array(this), if_fixed_double_array(this), done(this); 48 Label if_fixed_array(this), if_fixed_double_array(this), done(this);
33 VARIABLE(result, MachineRepresentation::kTagged); 49 VARIABLE(result, MachineRepresentation::kTagged);
34 Node* capacity = LoadAndUntagFixedArrayBaseLength(fixed_array); 50 Node* capacity = LoadAndUntagFixedArrayBaseLength(fixed_array);
35 Branch(IsFixedDoubleArrayMap(LoadMap(fixed_array)), &if_fixed_double_array, 51 Branch(IsFixedDoubleArrayMap(LoadMap(fixed_array)), &if_fixed_double_array,
36 &if_fixed_array); 52 &if_fixed_array);
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 Node* boilerplate_description = 796 Node* boilerplate_description =
781 Parameter(Descriptor::kBoilerplateDescription); 797 Parameter(Descriptor::kBoilerplateDescription);
782 Node* flags = Parameter(Descriptor::kFlags); 798 Node* flags = Parameter(Descriptor::kFlags);
783 Node* context = Parameter(Descriptor::kContext); 799 Node* context = Parameter(Descriptor::kContext);
784 TailCallRuntime(Runtime::kCreateObjectLiteral, context, closure, 800 TailCallRuntime(Runtime::kCreateObjectLiteral, context, closure,
785 literals_index, boilerplate_description, flags); 801 literals_index, boilerplate_description, flags);
786 } 802 }
787 803
788 } // namespace internal 804 } // namespace internal
789 } // namespace v8 805 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-call-gen.cc ('k') | src/builtins/builtins-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698