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

Side by Side Diff: src/builtins/builtins-definitions.h

Issue 2803853005: Inline Array.prototype.forEach in TurboFan (Closed)
Patch Set: Review feedback Created 3 years, 7 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 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 #ifndef V8_BUILTINS_BUILTINS_DEFINITIONS_H_ 5 #ifndef V8_BUILTINS_BUILTINS_DEFINITIONS_H_
6 #define V8_BUILTINS_BUILTINS_DEFINITIONS_H_ 6 #define V8_BUILTINS_BUILTINS_DEFINITIONS_H_
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 10
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 ASM(InOptimizationQueue) \ 155 ASM(InOptimizationQueue) \
156 ASM(InstantiateAsmJs) \ 156 ASM(InstantiateAsmJs) \
157 ASM(MarkCodeAsToBeExecutedOnce) \ 157 ASM(MarkCodeAsToBeExecutedOnce) \
158 ASM(MarkCodeAsExecutedOnce) \ 158 ASM(MarkCodeAsExecutedOnce) \
159 ASM(MarkCodeAsExecutedTwice) \ 159 ASM(MarkCodeAsExecutedTwice) \
160 ASM(NotifyDeoptimized) \ 160 ASM(NotifyDeoptimized) \
161 ASM(NotifySoftDeoptimized) \ 161 ASM(NotifySoftDeoptimized) \
162 ASM(NotifyLazyDeoptimized) \ 162 ASM(NotifyLazyDeoptimized) \
163 ASM(NotifyStubFailure) \ 163 ASM(NotifyStubFailure) \
164 ASM(NotifyStubFailureSaveDoubles) \ 164 ASM(NotifyStubFailureSaveDoubles) \
165 ASM(NotifyBuiltinContinuation) \
166 \
167 /* Trampolines called when returning from a deoptimization that expects */ \
168 /* to continue in a JavaScript builtin to finish the functionality of a */ \
169 /* an TF-inlined version of builtin that has side-effects. */ \
170 /* Each restores input register values that the builtin expects from a */ \
171 /* BuiltinContinuationFrame, tear down that frame, and then jump to the */ \
172 /* stashed-away builtin's address. After the trampoline completes, */ \
173 /* it appears to the called JavaScript builtin that it had been directly */ \
174 /* invoked by the frame above it. When the builtin returns, execution */ \
175 /* resumes normally in the calling frame, processing any return result */ \
176 /* from the JavaScript builtin, again as if it had called the builtin */ \
177 /* directly. */ \
178 /* There are two variants of the stub that differ in their handling of a */ \
179 /* value returned by the next frame deeper on the stack. For LAZY deopts, */ \
180 /* the return value (e.g. rax on x64) is explicitly passed as an extra */ \
181 /* stack parameter to the JavaScript builtin by the "WithResult" */ \
182 /* trampoline variant. The plain variant is used in EAGER deopt contexts */ \
183 /* and has no such special handling. */ \
184 ASM(ContinueToCodeStubBuiltin) \
185 ASM(ContinueToCodeStubBuiltinWithResult) \
186 ASM(ContinueToJavaScriptBuiltin) \
187 ASM(ContinueToJavaScriptBuiltinWithResult) \
188 \
165 ASM(OnStackReplacement) \ 189 ASM(OnStackReplacement) \
166 \ 190 \
167 /* API callback handling */ \ 191 /* API callback handling */ \
168 API(HandleApiCall) \ 192 API(HandleApiCall) \
169 API(HandleApiCallAsFunction) \ 193 API(HandleApiCallAsFunction) \
170 API(HandleApiCallAsConstructor) \ 194 API(HandleApiCallAsConstructor) \
171 \ 195 \
172 /* Adapters for Turbofan into runtime */ \ 196 /* Adapters for Turbofan into runtime */ \
173 ASM(AllocateInNewSpace) \ 197 ASM(AllocateInNewSpace) \
174 ASM(AllocateInOldSpace) \ 198 ASM(AllocateInOldSpace) \
(...skipping 21 matching lines...) Expand all
196 TFC(ToName, TypeConversion, 1) \ 220 TFC(ToName, TypeConversion, 1) \
197 TFC(NonNumberToNumber, TypeConversion, 1) \ 221 TFC(NonNumberToNumber, TypeConversion, 1) \
198 TFC(ToNumber, TypeConversion, 1) \ 222 TFC(ToNumber, TypeConversion, 1) \
199 TFC(ToString, TypeConversion, 1) \ 223 TFC(ToString, TypeConversion, 1) \
200 TFC(ToInteger, TypeConversion, 1) \ 224 TFC(ToInteger, TypeConversion, 1) \
201 TFC(ToLength, TypeConversion, 1) \ 225 TFC(ToLength, TypeConversion, 1) \
202 TFC(ClassOf, Typeof, 1) \ 226 TFC(ClassOf, Typeof, 1) \
203 TFC(Typeof, Typeof, 1) \ 227 TFC(Typeof, Typeof, 1) \
204 TFC(GetSuperConstructor, Typeof, 1) \ 228 TFC(GetSuperConstructor, Typeof, 1) \
205 \ 229 \
230 /* Type conversions continuations */ \
231 TFC(ToBooleanLazyDeoptContinuation, TypeConversionStackParameter, 1) \
232 \
206 /* Handlers */ \ 233 /* Handlers */ \
207 TFH(LoadICProtoArray, BUILTIN, kNoExtraICState, LoadICProtoArray) \ 234 TFH(LoadICProtoArray, BUILTIN, kNoExtraICState, LoadICProtoArray) \
208 TFH(LoadICProtoArrayThrowIfNonexistent, BUILTIN, kNoExtraICState, \ 235 TFH(LoadICProtoArrayThrowIfNonexistent, BUILTIN, kNoExtraICState, \
209 LoadICProtoArray) \ 236 LoadICProtoArray) \
210 TFH(KeyedLoadIC_Megamorphic, BUILTIN, kNoExtraICState, LoadWithVector) \ 237 TFH(KeyedLoadIC_Megamorphic, BUILTIN, kNoExtraICState, LoadWithVector) \
211 TFH(KeyedLoadIC_Miss, BUILTIN, kNoExtraICState, LoadWithVector) \ 238 TFH(KeyedLoadIC_Miss, BUILTIN, kNoExtraICState, LoadWithVector) \
212 TFH(KeyedLoadIC_Slow, HANDLER, Code::LOAD_IC, LoadWithVector) \ 239 TFH(KeyedLoadIC_Slow, HANDLER, Code::LOAD_IC, LoadWithVector) \
213 TFH(KeyedLoadIC_IndexedString, HANDLER, Code::LOAD_IC, LoadWithVector) \ 240 TFH(KeyedLoadIC_IndexedString, HANDLER, Code::LOAD_IC, LoadWithVector) \
214 TFH(KeyedStoreIC_Megamorphic, BUILTIN, kNoExtraICState, StoreWithVector) \ 241 TFH(KeyedStoreIC_Megamorphic, BUILTIN, kNoExtraICState, StoreWithVector) \
215 TFH(KeyedStoreIC_Megamorphic_Strict, BUILTIN, kNoExtraICState, \ 242 TFH(KeyedStoreIC_Megamorphic_Strict, BUILTIN, kNoExtraICState, \
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 CPP(ArrayShift) \ 291 CPP(ArrayShift) \
265 /* ES6 #sec-array.prototype.slice */ \ 292 /* ES6 #sec-array.prototype.slice */ \
266 CPP(ArraySlice) \ 293 CPP(ArraySlice) \
267 /* ES6 #sec-array.prototype.splice */ \ 294 /* ES6 #sec-array.prototype.splice */ \
268 CPP(ArraySplice) \ 295 CPP(ArraySplice) \
269 /* ES6 #sec-array.prototype.unshift */ \ 296 /* ES6 #sec-array.prototype.unshift */ \
270 CPP(ArrayUnshift) \ 297 CPP(ArrayUnshift) \
271 /* ES6 #sec-array.prototype.foreach */ \ 298 /* ES6 #sec-array.prototype.foreach */ \
272 TFS(ArrayForEachLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \ 299 TFS(ArrayForEachLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \
273 kObject, kInitialK, kLength, kTo) \ 300 kObject, kInitialK, kLength, kTo) \
301 TFJ(ArrayForEachLoopEagerDeoptContinuation, 4, kCallbackFn, kThisArg, \
302 kInitialK, kLength) \
303 TFJ(ArrayForEachLoopLazyDeoptContinuation, 5, kCallbackFn, kThisArg, \
304 kInitialK, kLength, kResult) \
274 TFJ(ArrayForEach, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ 305 TFJ(ArrayForEach, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
275 /* ES6 #sec-array.prototype.every */ \ 306 /* ES6 #sec-array.prototype.every */ \
276 TFS(ArrayEveryLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \ 307 TFS(ArrayEveryLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \
277 kObject, kInitialK, kLength, kTo) \ 308 kObject, kInitialK, kLength, kTo) \
278 TFJ(ArrayEvery, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ 309 TFJ(ArrayEvery, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
279 /* ES6 #sec-array.prototype.some */ \ 310 /* ES6 #sec-array.prototype.some */ \
280 TFS(ArraySomeLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \ 311 TFS(ArraySomeLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \
281 kObject, kInitialK, kLength, kTo) \ 312 kObject, kInitialK, kLength, kTo) \
282 TFJ(ArraySome, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ 313 TFJ(ArraySome, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
283 /* ES6 #sec-array.prototype.filter */ \ 314 /* ES6 #sec-array.prototype.filter */ \
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 IGNORE_BUILTIN, IGNORE_BUILTIN, V, V) 1080 IGNORE_BUILTIN, IGNORE_BUILTIN, V, V)
1050 1081
1051 #define BUILTIN_LIST_DBG(V) \ 1082 #define BUILTIN_LIST_DBG(V) \
1052 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ 1083 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \
1053 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, V) 1084 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, V)
1054 1085
1055 #define BUILTIN_LIST_TFS(V) \ 1086 #define BUILTIN_LIST_TFS(V) \
1056 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ 1087 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \
1057 V, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN) 1088 V, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN)
1058 1089
1090 #define BUILTIN_LIST_TFJ(V) \
1091 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, V, IGNORE_BUILTIN, \
1092 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN)
1093
1094 #define BUILTIN_LIST_TFC(V) \
1095 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, V, \
1096 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN)
1097
1059 #define BUILTINS_WITH_UNTAGGED_PARAMS(V) V(WasmCompileLazy) 1098 #define BUILTINS_WITH_UNTAGGED_PARAMS(V) V(WasmCompileLazy)
1060 1099
1061 } // namespace internal 1100 } // namespace internal
1062 } // namespace v8 1101 } // namespace v8
1063 1102
1064 #endif // V8_BUILTINS_BUILTINS_DEFINITIONS_H_ 1103 #endif // V8_BUILTINS_BUILTINS_DEFINITIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698