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

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

Issue 2930623002: [builtins] Start refactoring the Apply builtin. (Closed)
Patch Set: 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
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_Varargs(masm, masm->isolate()->builtins()->Construct());
23 }
24
20 void Builtins::Generate_ConstructForwardVarargs(MacroAssembler* masm) { 25 void Builtins::Generate_ConstructForwardVarargs(MacroAssembler* masm) {
21 Generate_ForwardVarargs(masm, masm->isolate()->builtins()->Construct()); 26 Generate_ForwardVarargs(masm, masm->isolate()->builtins()->Construct());
22 } 27 }
23 28
24 void Builtins::Generate_ConstructFunctionForwardVarargs(MacroAssembler* masm) { 29 void Builtins::Generate_ConstructFunctionForwardVarargs(MacroAssembler* masm) {
25 Generate_ForwardVarargs(masm, 30 Generate_ForwardVarargs(masm,
26 masm->isolate()->builtins()->ConstructFunction()); 31 masm->isolate()->builtins()->ConstructFunction());
27 } 32 }
28 33
34 TF_BUILTIN(ConstructWithArrayLike, CallOrConstructBuiltinsAssembler) {
35 Node* target = Parameter(ConstructWithArrayLikeDescriptor::kTarget);
36 Node* new_target = Parameter(ConstructWithArrayLikeDescriptor::kNewTarget);
37 Node* arguments_list =
38 Parameter(ConstructWithArrayLikeDescriptor::kArgumentsList);
39 Node* context = Parameter(ConstructWithArrayLikeDescriptor::kContext);
40 CallOrConstructWithArrayLike(target, new_target, arguments_list, context);
41 }
42
29 typedef compiler::Node Node; 43 typedef compiler::Node Node;
30 44
31 Node* ConstructorBuiltinsAssembler::CopyFixedArrayBase(Node* fixed_array) { 45 Node* ConstructorBuiltinsAssembler::CopyFixedArrayBase(Node* fixed_array) {
32 Label if_fixed_array(this), if_fixed_double_array(this), done(this); 46 Label if_fixed_array(this), if_fixed_double_array(this), done(this);
33 VARIABLE(result, MachineRepresentation::kTagged); 47 VARIABLE(result, MachineRepresentation::kTagged);
34 Node* capacity = LoadAndUntagFixedArrayBaseLength(fixed_array); 48 Node* capacity = LoadAndUntagFixedArrayBaseLength(fixed_array);
35 Branch(IsFixedDoubleArrayMap(LoadMap(fixed_array)), &if_fixed_double_array, 49 Branch(IsFixedDoubleArrayMap(LoadMap(fixed_array)), &if_fixed_double_array,
36 &if_fixed_array); 50 &if_fixed_array);
37 BIND(&if_fixed_double_array); 51 BIND(&if_fixed_double_array);
38 { 52 {
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 Node* boilerplate_description = 794 Node* boilerplate_description =
781 Parameter(Descriptor::kBoilerplateDescription); 795 Parameter(Descriptor::kBoilerplateDescription);
782 Node* flags = Parameter(Descriptor::kFlags); 796 Node* flags = Parameter(Descriptor::kFlags);
783 Node* context = Parameter(Descriptor::kContext); 797 Node* context = Parameter(Descriptor::kContext);
784 TailCallRuntime(Runtime::kCreateObjectLiteral, context, closure, 798 TailCallRuntime(Runtime::kCreateObjectLiteral, context, closure,
785 literals_index, boilerplate_description, flags); 799 literals_index, boilerplate_description, flags);
786 } 800 }
787 801
788 } // namespace internal 802 } // namespace internal
789 } // namespace v8 803 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698