OLD | NEW |
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 Loading... |
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(ContinueToJavaScriptBuiltin) \ |
| 185 ASM(ContinueToJavaScriptBuiltinWithResult) \ |
| 186 \ |
165 ASM(OnStackReplacement) \ | 187 ASM(OnStackReplacement) \ |
166 \ | 188 \ |
167 /* API callback handling */ \ | 189 /* API callback handling */ \ |
168 API(HandleApiCall) \ | 190 API(HandleApiCall) \ |
169 API(HandleApiCallAsFunction) \ | 191 API(HandleApiCallAsFunction) \ |
170 API(HandleApiCallAsConstructor) \ | 192 API(HandleApiCallAsConstructor) \ |
171 \ | 193 \ |
172 /* Adapters for Turbofan into runtime */ \ | 194 /* Adapters for Turbofan into runtime */ \ |
173 ASM(AllocateInNewSpace) \ | 195 ASM(AllocateInNewSpace) \ |
174 ASM(AllocateInOldSpace) \ | 196 ASM(AllocateInOldSpace) \ |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 CPP(ArrayShift) \ | 286 CPP(ArrayShift) \ |
265 /* ES6 #sec-array.prototype.slice */ \ | 287 /* ES6 #sec-array.prototype.slice */ \ |
266 CPP(ArraySlice) \ | 288 CPP(ArraySlice) \ |
267 /* ES6 #sec-array.prototype.splice */ \ | 289 /* ES6 #sec-array.prototype.splice */ \ |
268 CPP(ArraySplice) \ | 290 CPP(ArraySplice) \ |
269 /* ES6 #sec-array.prototype.unshift */ \ | 291 /* ES6 #sec-array.prototype.unshift */ \ |
270 CPP(ArrayUnshift) \ | 292 CPP(ArrayUnshift) \ |
271 /* ES6 #sec-array.prototype.foreach */ \ | 293 /* ES6 #sec-array.prototype.foreach */ \ |
272 TFS(ArrayForEachLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \ | 294 TFS(ArrayForEachLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \ |
273 kObject, kInitialK, kLength, kTo) \ | 295 kObject, kInitialK, kLength, kTo) \ |
| 296 TFJ(ArrayForEachLoopEagerDeoptContinuation, 4, kCallbackFn, kThisArg, \ |
| 297 kInitialK, kLength) \ |
| 298 TFJ(ArrayForEachLoopLazyDeoptContinuation, 5, kCallbackFn, kThisArg, \ |
| 299 kInitialK, kLength, kResult) \ |
274 TFJ(ArrayForEach, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ | 300 TFJ(ArrayForEach, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ |
275 /* ES6 #sec-array.prototype.every */ \ | 301 /* ES6 #sec-array.prototype.every */ \ |
276 TFS(ArrayEveryLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \ | 302 TFS(ArrayEveryLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \ |
277 kObject, kInitialK, kLength, kTo) \ | 303 kObject, kInitialK, kLength, kTo) \ |
278 TFJ(ArrayEvery, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ | 304 TFJ(ArrayEvery, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ |
279 /* ES6 #sec-array.prototype.some */ \ | 305 /* ES6 #sec-array.prototype.some */ \ |
280 TFS(ArraySomeLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \ | 306 TFS(ArraySomeLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \ |
281 kObject, kInitialK, kLength, kTo) \ | 307 kObject, kInitialK, kLength, kTo) \ |
282 TFJ(ArraySome, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ | 308 TFJ(ArraySome, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ |
283 /* ES6 #sec-array.prototype.filter */ \ | 309 /* ES6 #sec-array.prototype.filter */ \ |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 IGNORE_BUILTIN, IGNORE_BUILTIN, V, V) | 1075 IGNORE_BUILTIN, IGNORE_BUILTIN, V, V) |
1050 | 1076 |
1051 #define BUILTIN_LIST_DBG(V) \ | 1077 #define BUILTIN_LIST_DBG(V) \ |
1052 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ | 1078 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ |
1053 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, V) | 1079 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, V) |
1054 | 1080 |
1055 #define BUILTIN_LIST_TFS(V) \ | 1081 #define BUILTIN_LIST_TFS(V) \ |
1056 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ | 1082 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ |
1057 V, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN) | 1083 V, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN) |
1058 | 1084 |
| 1085 #define BUILTIN_LIST_TFJ(V) \ |
| 1086 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, V, IGNORE_BUILTIN, \ |
| 1087 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN) |
| 1088 |
1059 #define BUILTINS_WITH_UNTAGGED_PARAMS(V) V(WasmCompileLazy) | 1089 #define BUILTINS_WITH_UNTAGGED_PARAMS(V) V(WasmCompileLazy) |
1060 | 1090 |
1061 } // namespace internal | 1091 } // namespace internal |
1062 } // namespace v8 | 1092 } // namespace v8 |
1063 | 1093 |
1064 #endif // V8_BUILTINS_BUILTINS_DEFINITIONS_H_ | 1094 #endif // V8_BUILTINS_BUILTINS_DEFINITIONS_H_ |
OLD | NEW |