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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 ASM(InOptimizationQueue) \ | 150 ASM(InOptimizationQueue) \ |
151 ASM(InstantiateAsmJs) \ | 151 ASM(InstantiateAsmJs) \ |
152 ASM(MarkCodeAsToBeExecutedOnce) \ | 152 ASM(MarkCodeAsToBeExecutedOnce) \ |
153 ASM(MarkCodeAsExecutedOnce) \ | 153 ASM(MarkCodeAsExecutedOnce) \ |
154 ASM(MarkCodeAsExecutedTwice) \ | 154 ASM(MarkCodeAsExecutedTwice) \ |
155 ASM(NotifyDeoptimized) \ | 155 ASM(NotifyDeoptimized) \ |
156 ASM(NotifySoftDeoptimized) \ | 156 ASM(NotifySoftDeoptimized) \ |
157 ASM(NotifyLazyDeoptimized) \ | 157 ASM(NotifyLazyDeoptimized) \ |
158 ASM(NotifyStubFailure) \ | 158 ASM(NotifyStubFailure) \ |
159 ASM(NotifyStubFailureSaveDoubles) \ | 159 ASM(NotifyStubFailureSaveDoubles) \ |
| 160 ASM(NotifyBuiltinContinuation) \ |
| 161 \ |
| 162 /* Trampolines called when returning from a deoptimization that expects */ \ |
| 163 /* to continue in a JavaScript builtin to finish the functionality of a */ \ |
| 164 /* an TF-inlined version of builtin that has side-effects. */ \ |
| 165 /* */ \ |
| 166 /* The trampolines work as follows: */ \ |
| 167 /* 1. Trampoline restores input register values that */ \ |
| 168 /* the builtin expects from a BuiltinContinuationFrame. */ \ |
| 169 /* 2. Trampoline tears down BuiltinContinuationFrame. */ \ |
| 170 /* 3. Trampoline jumps to the builtin's address. */ \ |
| 171 /* 4. Builtin executes as if invoked by the frame above it. */ \ |
| 172 /* 5. When the builtin returns, execution resumes normally in the */ \ |
| 173 /* calling frame, processing any return result from the JavaScript */ \ |
| 174 /* builtin as if it had called the builtin directly. */ \ |
| 175 /* */ \ |
| 176 /* There are two variants of the stub that differ in their handling of a */ \ |
| 177 /* value returned by the next frame deeper on the stack. For LAZY deopts, */ \ |
| 178 /* the return value (e.g. rax on x64) is explicitly passed as an extra */ \ |
| 179 /* stack parameter to the JavaScript builtin by the "WithResult" */ \ |
| 180 /* trampoline variant. The plain variant is used in EAGER deopt contexts */ \ |
| 181 /* and has no such special handling. */ \ |
| 182 ASM(ContinueToCodeStubBuiltin) \ |
| 183 ASM(ContinueToCodeStubBuiltinWithResult) \ |
| 184 ASM(ContinueToJavaScriptBuiltin) \ |
| 185 ASM(ContinueToJavaScriptBuiltinWithResult) \ |
| 186 \ |
160 ASM(OnStackReplacement) \ | 187 ASM(OnStackReplacement) \ |
161 \ | 188 \ |
162 /* API callback handling */ \ | 189 /* API callback handling */ \ |
163 API(HandleApiCall) \ | 190 API(HandleApiCall) \ |
164 API(HandleApiCallAsFunction) \ | 191 API(HandleApiCallAsFunction) \ |
165 API(HandleApiCallAsConstructor) \ | 192 API(HandleApiCallAsConstructor) \ |
166 \ | 193 \ |
167 /* Adapters for Turbofan into runtime */ \ | 194 /* Adapters for Turbofan into runtime */ \ |
168 ASM(AllocateInNewSpace) \ | 195 ASM(AllocateInNewSpace) \ |
169 ASM(AllocateInOldSpace) \ | 196 ASM(AllocateInOldSpace) \ |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 TFJ(FastArrayShift, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ | 288 TFJ(FastArrayShift, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ |
262 /* ES6 #sec-array.prototype.slice */ \ | 289 /* ES6 #sec-array.prototype.slice */ \ |
263 CPP(ArraySlice) \ | 290 CPP(ArraySlice) \ |
264 /* ES6 #sec-array.prototype.splice */ \ | 291 /* ES6 #sec-array.prototype.splice */ \ |
265 CPP(ArraySplice) \ | 292 CPP(ArraySplice) \ |
266 /* ES6 #sec-array.prototype.unshift */ \ | 293 /* ES6 #sec-array.prototype.unshift */ \ |
267 CPP(ArrayUnshift) \ | 294 CPP(ArrayUnshift) \ |
268 /* ES6 #sec-array.prototype.foreach */ \ | 295 /* ES6 #sec-array.prototype.foreach */ \ |
269 TFS(ArrayForEachLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \ | 296 TFS(ArrayForEachLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \ |
270 kObject, kInitialK, kLength, kTo) \ | 297 kObject, kInitialK, kLength, kTo) \ |
| 298 TFJ(ArrayForEachLoopEagerDeoptContinuation, 4, kCallbackFn, kThisArg, \ |
| 299 kInitialK, kLength) \ |
| 300 TFJ(ArrayForEachLoopLazyDeoptContinuation, 5, kCallbackFn, kThisArg, \ |
| 301 kInitialK, kLength, kResult) \ |
271 TFJ(ArrayForEach, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ | 302 TFJ(ArrayForEach, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ |
272 /* ES6 #sec-array.prototype.every */ \ | 303 /* ES6 #sec-array.prototype.every */ \ |
273 TFS(ArrayEveryLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \ | 304 TFS(ArrayEveryLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \ |
274 kObject, kInitialK, kLength, kTo) \ | 305 kObject, kInitialK, kLength, kTo) \ |
275 TFJ(ArrayEvery, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ | 306 TFJ(ArrayEvery, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ |
276 /* ES6 #sec-array.prototype.some */ \ | 307 /* ES6 #sec-array.prototype.some */ \ |
277 TFS(ArraySomeLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \ | 308 TFS(ArraySomeLoopContinuation, kReceiver, kCallbackFn, kThisArg, kArray, \ |
278 kObject, kInitialK, kLength, kTo) \ | 309 kObject, kInitialK, kLength, kTo) \ |
279 TFJ(ArraySome, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ | 310 TFJ(ArraySome, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ |
280 /* ES6 #sec-array.prototype.filter */ \ | 311 /* ES6 #sec-array.prototype.filter */ \ |
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 IGNORE_BUILTIN, IGNORE_BUILTIN, V, V) | 1090 IGNORE_BUILTIN, IGNORE_BUILTIN, V, V) |
1060 | 1091 |
1061 #define BUILTIN_LIST_DBG(V) \ | 1092 #define BUILTIN_LIST_DBG(V) \ |
1062 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ | 1093 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ |
1063 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, V) | 1094 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, V) |
1064 | 1095 |
1065 #define BUILTIN_LIST_TFS(V) \ | 1096 #define BUILTIN_LIST_TFS(V) \ |
1066 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ | 1097 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ |
1067 V, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN) | 1098 V, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN) |
1068 | 1099 |
| 1100 #define BUILTIN_LIST_TFJ(V) \ |
| 1101 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, V, IGNORE_BUILTIN, \ |
| 1102 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN) |
| 1103 |
| 1104 #define BUILTIN_LIST_TFC(V) \ |
| 1105 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, V, \ |
| 1106 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN) |
| 1107 |
1069 #define BUILTINS_WITH_UNTAGGED_PARAMS(V) V(WasmCompileLazy) | 1108 #define BUILTINS_WITH_UNTAGGED_PARAMS(V) V(WasmCompileLazy) |
1070 | 1109 |
1071 } // namespace internal | 1110 } // namespace internal |
1072 } // namespace v8 | 1111 } // namespace v8 |
1073 | 1112 |
1074 #endif // V8_BUILTINS_BUILTINS_DEFINITIONS_H_ | 1113 #endif // V8_BUILTINS_BUILTINS_DEFINITIONS_H_ |
OLD | NEW |