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

Side by Side Diff: src/builtins/setup-builtins-internal.cc

Issue 2777203007: [builtins] Introduce new TFC macro and auto-generate TFS descriptors (Closed)
Patch Set: Rebase Created 3 years, 8 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-regexp-gen.cc ('k') | src/ia32/interface-descriptors-ia32.cc » ('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 2017 the V8 project authors. All rights reserved. 1 // Copyright 2017 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/setup-isolate.h" 5 #include "src/setup-isolate.h"
6 6
7 #include "src/builtins/builtins.h" 7 #include "src/builtins/builtins.h"
8 #include "src/code-events.h" 8 #include "src/code-events.h"
9 #include "src/compiler/code-assembler.h" 9 #include "src/compiler/code-assembler.h"
10 #include "src/interface-descriptors.h" 10 #include "src/interface-descriptors.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 Builtins::BUILTIN_EXIT, kBuiltinFlags, #Name); \ 130 Builtins::BUILTIN_EXIT, kBuiltinFlags, #Name); \
131 AddBuiltin(builtins, index++, code); 131 AddBuiltin(builtins, index++, code);
132 #define BUILD_API(Name) \ 132 #define BUILD_API(Name) \
133 code = BuildAdaptor(isolate, FUNCTION_ADDR(Builtin_##Name), Builtins::EXIT, \ 133 code = BuildAdaptor(isolate, FUNCTION_ADDR(Builtin_##Name), Builtins::EXIT, \
134 kBuiltinFlags, #Name); \ 134 kBuiltinFlags, #Name); \
135 AddBuiltin(builtins, index++, code); 135 AddBuiltin(builtins, index++, code);
136 #define BUILD_TFJ(Name, Argc, ...) \ 136 #define BUILD_TFJ(Name, Argc, ...) \
137 code = BuildWithCodeStubAssemblerJS(isolate, &Builtins::Generate_##Name, \ 137 code = BuildWithCodeStubAssemblerJS(isolate, &Builtins::Generate_##Name, \
138 Argc, kBuiltinFlags, #Name); \ 138 Argc, kBuiltinFlags, #Name); \
139 AddBuiltin(builtins, index++, code); 139 AddBuiltin(builtins, index++, code);
140 #define BUILD_TFS(Name, InterfaceDescriptor, result_size) \ 140 #define BUILD_TFC(Name, InterfaceDescriptor, result_size) \
141 { InterfaceDescriptor##Descriptor descriptor(isolate); } \ 141 { InterfaceDescriptor##Descriptor descriptor(isolate); } \
142 code = BuildWithCodeStubAssemblerCS(isolate, &Builtins::Generate_##Name, \ 142 code = BuildWithCodeStubAssemblerCS(isolate, &Builtins::Generate_##Name, \
143 CallDescriptors::InterfaceDescriptor, \ 143 CallDescriptors::InterfaceDescriptor, \
144 kBuiltinFlags, #Name, result_size); \ 144 kBuiltinFlags, #Name, result_size); \
145 AddBuiltin(builtins, index++, code); 145 AddBuiltin(builtins, index++, code);
146 #define BUILD_TFS(Name, ...) \
147 /* Return size for generic TF builtins (stub linkage) is always 1. */ \
148 code = BuildWithCodeStubAssemblerCS(isolate, &Builtins::Generate_##Name, \
149 CallDescriptors::Name, kBuiltinFlags, \
150 #Name, 1); \
151 AddBuiltin(builtins, index++, code);
146 #define BUILD_TFH(Name, Kind, Extra, InterfaceDescriptor) \ 152 #define BUILD_TFH(Name, Kind, Extra, InterfaceDescriptor) \
147 { InterfaceDescriptor##Descriptor descriptor(isolate); } \ 153 { InterfaceDescriptor##Descriptor descriptor(isolate); } \
148 /* Return size for IC builtins/handlers is always 1. */ \ 154 /* Return size for IC builtins/handlers is always 1. */ \
149 code = BuildWithCodeStubAssemblerCS(isolate, &Builtins::Generate_##Name, \ 155 code = BuildWithCodeStubAssemblerCS(isolate, &Builtins::Generate_##Name, \
150 CallDescriptors::InterfaceDescriptor, \ 156 CallDescriptors::InterfaceDescriptor, \
151 Code::ComputeFlags(Code::Kind, Extra), \ 157 Code::ComputeFlags(Code::Kind, Extra), \
152 #Name, 1); \ 158 #Name, 1); \
153 AddBuiltin(builtins, index++, code); 159 AddBuiltin(builtins, index++, code);
154 #define BUILD_ASM(Name) \ 160 #define BUILD_ASM(Name) \
155 code = BuildWithMacroAssembler(isolate, Builtins::Generate_##Name, \ 161 code = BuildWithMacroAssembler(isolate, Builtins::Generate_##Name, \
156 kBuiltinFlags, #Name); \ 162 kBuiltinFlags, #Name); \
157 AddBuiltin(builtins, index++, code); 163 AddBuiltin(builtins, index++, code);
158 164
159 BUILTIN_LIST(BUILD_CPP, BUILD_API, BUILD_TFJ, BUILD_TFS, BUILD_TFH, BUILD_ASM, 165 BUILTIN_LIST(BUILD_CPP, BUILD_API, BUILD_TFJ, BUILD_TFC, BUILD_TFS, BUILD_TFH,
160 BUILD_ASM); 166 BUILD_ASM, BUILD_ASM);
161 167
162 #undef BUILD_CPP 168 #undef BUILD_CPP
163 #undef BUILD_API 169 #undef BUILD_API
164 #undef BUILD_TFJ 170 #undef BUILD_TFJ
171 #undef BUILD_TFC
165 #undef BUILD_TFS 172 #undef BUILD_TFS
166 #undef BUILD_TFH 173 #undef BUILD_TFH
167 #undef BUILD_ASM 174 #undef BUILD_ASM
168 CHECK_EQ(Builtins::builtin_count, index); 175 CHECK_EQ(Builtins::builtin_count, index);
169 176
170 #define SET_PROMISE_REJECTION_PREDICTION(Name) \ 177 #define SET_PROMISE_REJECTION_PREDICTION(Name) \
171 Code::cast(builtins->builtins_[Builtins::k##Name]) \ 178 Code::cast(builtins->builtins_[Builtins::k##Name]) \
172 ->set_is_promise_rejection(true); 179 ->set_is_promise_rejection(true);
173 180
174 BUILTIN_PROMISE_REJECTION_PREDICTION_LIST(SET_PROMISE_REJECTION_PREDICTION) 181 BUILTIN_PROMISE_REJECTION_PREDICTION_LIST(SET_PROMISE_REJECTION_PREDICTION)
(...skipping 11 matching lines...) Expand all
186 ->set_has_tagged_params(false); 193 ->set_has_tagged_params(false);
187 194
188 BUILTINS_WITH_UNTAGGED_PARAMS(SET_CODE_NON_TAGGED_PARAMS) 195 BUILTINS_WITH_UNTAGGED_PARAMS(SET_CODE_NON_TAGGED_PARAMS)
189 #undef SET_CODE_NON_TAGGED_PARAMS 196 #undef SET_CODE_NON_TAGGED_PARAMS
190 197
191 isolate->builtins()->MarkInitialized(); 198 isolate->builtins()->MarkInitialized();
192 } 199 }
193 200
194 } // namespace internal 201 } // namespace internal
195 } // namespace v8 202 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-regexp-gen.cc ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698