OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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_H_ | 5 #ifndef V8_BUILTINS_H_ |
6 #define V8_BUILTINS_H_ | 6 #define V8_BUILTINS_H_ |
7 | 7 |
8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
9 #include "src/handles.h" | 9 #include "src/handles.h" |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 #define CODE_AGE_LIST(V) \ | 39 #define CODE_AGE_LIST(V) \ |
40 CODE_AGE_LIST_WITH_ARG(CODE_AGE_LIST_IGNORE_ARG, V) | 40 CODE_AGE_LIST_WITH_ARG(CODE_AGE_LIST_IGNORE_ARG, V) |
41 | 41 |
42 #define CODE_AGE_LIST_COMPLETE(V) \ | 42 #define CODE_AGE_LIST_COMPLETE(V) \ |
43 V(ToBeExecutedOnce) \ | 43 V(ToBeExecutedOnce) \ |
44 V(NotExecuted) \ | 44 V(NotExecuted) \ |
45 V(ExecutedOnce) \ | 45 V(ExecutedOnce) \ |
46 V(NoAge) \ | 46 V(NoAge) \ |
47 CODE_AGE_LIST_WITH_ARG(CODE_AGE_LIST_IGNORE_ARG, V) | 47 CODE_AGE_LIST_WITH_ARG(CODE_AGE_LIST_IGNORE_ARG, V) |
48 | 48 |
49 #define DECLARE_CODE_AGE_BUILTIN(C, V) \ | 49 #define DECLARE_CODE_AGE_BUILTIN(C, V) \ |
50 V(Make##C##CodeYoungAgainOddMarking, BUILTIN, \ | 50 V(Make##C##CodeYoungAgainOddMarking, BUILTIN, kNoExtraICState) \ |
51 UNINITIALIZED, kNoExtraICState) \ | 51 V(Make##C##CodeYoungAgainEvenMarking, BUILTIN, kNoExtraICState) |
52 V(Make##C##CodeYoungAgainEvenMarking, BUILTIN, \ | |
53 UNINITIALIZED, kNoExtraICState) | |
54 | |
55 | 52 |
56 // Define list of builtins implemented in C++. | 53 // Define list of builtins implemented in C++. |
57 #define BUILTIN_LIST_C(V) \ | 54 #define BUILTIN_LIST_C(V) \ |
58 V(Illegal, kNone) \ | 55 V(Illegal, kNone) \ |
59 \ | 56 \ |
60 V(EmptyFunction, kNone) \ | 57 V(EmptyFunction, kNone) \ |
61 \ | 58 \ |
62 V(ArrayConcat, kNone) \ | 59 V(ArrayConcat, kNone) \ |
63 V(ArrayPop, kNone) \ | 60 V(ArrayPop, kNone) \ |
64 V(ArrayPush, kNone) \ | 61 V(ArrayPush, kNone) \ |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 V(TypedArrayPrototypeBuffer, kNone) \ | 185 V(TypedArrayPrototypeBuffer, kNone) \ |
189 \ | 186 \ |
190 V(HandleApiCall, kTargetAndNewTarget) \ | 187 V(HandleApiCall, kTargetAndNewTarget) \ |
191 V(HandleApiCallAsFunction, kNone) \ | 188 V(HandleApiCallAsFunction, kNone) \ |
192 V(HandleApiCallAsConstructor, kNone) \ | 189 V(HandleApiCallAsConstructor, kNone) \ |
193 \ | 190 \ |
194 V(RestrictedFunctionPropertiesThrower, kNone) \ | 191 V(RestrictedFunctionPropertiesThrower, kNone) \ |
195 V(RestrictedStrictArgumentsPropertiesThrower, kNone) | 192 V(RestrictedStrictArgumentsPropertiesThrower, kNone) |
196 | 193 |
197 // Define list of builtins implemented in assembly. | 194 // Define list of builtins implemented in assembly. |
198 #define BUILTIN_LIST_A(V) \ | 195 #define BUILTIN_LIST_A(V) \ |
199 V(AllocateInNewSpace, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 196 V(AllocateInNewSpace, BUILTIN, kNoExtraICState) \ |
200 V(AllocateInOldSpace, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 197 V(AllocateInOldSpace, BUILTIN, kNoExtraICState) \ |
201 \ | 198 \ |
202 V(ArgumentsAdaptorTrampoline, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 199 V(ArgumentsAdaptorTrampoline, BUILTIN, kNoExtraICState) \ |
203 \ | 200 \ |
204 V(ConstructedNonConstructable, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 201 V(ConstructedNonConstructable, BUILTIN, kNoExtraICState) \ |
205 \ | 202 \ |
206 V(CallFunction_ReceiverIsNullOrUndefined, BUILTIN, UNINITIALIZED, \ | 203 V(CallFunction_ReceiverIsNullOrUndefined, BUILTIN, kNoExtraICState) \ |
207 kNoExtraICState) \ | 204 V(CallFunction_ReceiverIsNotNullOrUndefined, BUILTIN, kNoExtraICState) \ |
208 V(CallFunction_ReceiverIsNotNullOrUndefined, BUILTIN, UNINITIALIZED, \ | 205 V(CallFunction_ReceiverIsAny, BUILTIN, kNoExtraICState) \ |
209 kNoExtraICState) \ | 206 V(TailCallFunction_ReceiverIsNullOrUndefined, BUILTIN, kNoExtraICState) \ |
210 V(CallFunction_ReceiverIsAny, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 207 V(TailCallFunction_ReceiverIsNotNullOrUndefined, BUILTIN, kNoExtraICState) \ |
211 V(TailCallFunction_ReceiverIsNullOrUndefined, BUILTIN, UNINITIALIZED, \ | 208 V(TailCallFunction_ReceiverIsAny, BUILTIN, kNoExtraICState) \ |
212 kNoExtraICState) \ | 209 V(CallBoundFunction, BUILTIN, kNoExtraICState) \ |
213 V(TailCallFunction_ReceiverIsNotNullOrUndefined, BUILTIN, UNINITIALIZED, \ | 210 V(TailCallBoundFunction, BUILTIN, kNoExtraICState) \ |
214 kNoExtraICState) \ | 211 V(Call_ReceiverIsNullOrUndefined, BUILTIN, kNoExtraICState) \ |
215 V(TailCallFunction_ReceiverIsAny, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 212 V(Call_ReceiverIsNotNullOrUndefined, BUILTIN, kNoExtraICState) \ |
216 V(CallBoundFunction, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 213 V(Call_ReceiverIsAny, BUILTIN, kNoExtraICState) \ |
217 V(TailCallBoundFunction, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 214 V(TailCall_ReceiverIsNullOrUndefined, BUILTIN, kNoExtraICState) \ |
218 V(Call_ReceiverIsNullOrUndefined, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 215 V(TailCall_ReceiverIsNotNullOrUndefined, BUILTIN, kNoExtraICState) \ |
219 V(Call_ReceiverIsNotNullOrUndefined, BUILTIN, UNINITIALIZED, \ | 216 V(TailCall_ReceiverIsAny, BUILTIN, kNoExtraICState) \ |
220 kNoExtraICState) \ | 217 \ |
221 V(Call_ReceiverIsAny, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 218 V(ConstructFunction, BUILTIN, kNoExtraICState) \ |
222 V(TailCall_ReceiverIsNullOrUndefined, BUILTIN, UNINITIALIZED, \ | 219 V(ConstructBoundFunction, BUILTIN, kNoExtraICState) \ |
223 kNoExtraICState) \ | 220 V(ConstructProxy, BUILTIN, kNoExtraICState) \ |
224 V(TailCall_ReceiverIsNotNullOrUndefined, BUILTIN, UNINITIALIZED, \ | 221 V(Construct, BUILTIN, kNoExtraICState) \ |
225 kNoExtraICState) \ | 222 \ |
226 V(TailCall_ReceiverIsAny, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 223 V(StringToNumber, BUILTIN, kNoExtraICState) \ |
227 \ | 224 V(NonNumberToNumber, BUILTIN, kNoExtraICState) \ |
228 V(ConstructFunction, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 225 V(ToNumber, BUILTIN, kNoExtraICState) \ |
229 V(ConstructBoundFunction, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 226 \ |
230 V(ConstructProxy, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 227 V(Apply, BUILTIN, kNoExtraICState) \ |
231 V(Construct, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 228 \ |
232 \ | 229 V(HandleFastApiCall, BUILTIN, kNoExtraICState) \ |
233 V(StringToNumber, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 230 \ |
234 V(NonNumberToNumber, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 231 V(InOptimizationQueue, BUILTIN, kNoExtraICState) \ |
235 V(ToNumber, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 232 V(JSConstructStubGeneric, BUILTIN, kNoExtraICState) \ |
236 \ | 233 V(JSBuiltinsConstructStub, BUILTIN, kNoExtraICState) \ |
237 V(Apply, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 234 V(JSBuiltinsConstructStubForDerived, BUILTIN, kNoExtraICState) \ |
238 \ | 235 V(JSConstructStubApi, BUILTIN, kNoExtraICState) \ |
239 V(HandleFastApiCall, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 236 V(JSEntryTrampoline, BUILTIN, kNoExtraICState) \ |
240 \ | 237 V(JSConstructEntryTrampoline, BUILTIN, kNoExtraICState) \ |
241 V(InOptimizationQueue, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 238 V(ResumeGeneratorTrampoline, BUILTIN, kNoExtraICState) \ |
242 V(JSConstructStubGeneric, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 239 V(CompileLazy, BUILTIN, kNoExtraICState) \ |
243 V(JSBuiltinsConstructStub, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 240 V(CompileBaseline, BUILTIN, kNoExtraICState) \ |
244 V(JSBuiltinsConstructStubForDerived, BUILTIN, UNINITIALIZED, \ | 241 V(CompileOptimized, BUILTIN, kNoExtraICState) \ |
245 kNoExtraICState) \ | 242 V(CompileOptimizedConcurrent, BUILTIN, kNoExtraICState) \ |
246 V(JSConstructStubApi, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 243 V(NotifyDeoptimized, BUILTIN, kNoExtraICState) \ |
247 V(JSEntryTrampoline, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 244 V(NotifySoftDeoptimized, BUILTIN, kNoExtraICState) \ |
248 V(JSConstructEntryTrampoline, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 245 V(NotifyLazyDeoptimized, BUILTIN, kNoExtraICState) \ |
249 V(ResumeGeneratorTrampoline, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 246 V(NotifyStubFailure, BUILTIN, kNoExtraICState) \ |
250 V(CompileLazy, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 247 V(NotifyStubFailureSaveDoubles, BUILTIN, kNoExtraICState) \ |
251 V(CompileBaseline, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 248 \ |
252 V(CompileOptimized, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 249 V(InterpreterEntryTrampoline, BUILTIN, kNoExtraICState) \ |
253 V(CompileOptimizedConcurrent, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 250 V(InterpreterMarkBaselineOnReturn, BUILTIN, kNoExtraICState) \ |
254 V(NotifyDeoptimized, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 251 V(InterpreterPushArgsAndCall, BUILTIN, kNoExtraICState) \ |
255 V(NotifySoftDeoptimized, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 252 V(InterpreterPushArgsAndTailCall, BUILTIN, kNoExtraICState) \ |
256 V(NotifyLazyDeoptimized, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 253 V(InterpreterPushArgsAndConstruct, BUILTIN, kNoExtraICState) \ |
257 V(NotifyStubFailure, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 254 V(InterpreterEnterBytecodeDispatch, BUILTIN, kNoExtraICState) \ |
258 V(NotifyStubFailureSaveDoubles, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 255 \ |
259 \ | 256 V(LoadIC_Miss, BUILTIN, kNoExtraICState) \ |
260 V(InterpreterEntryTrampoline, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 257 V(KeyedLoadIC_Miss, BUILTIN, kNoExtraICState) \ |
261 V(InterpreterMarkBaselineOnReturn, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 258 V(StoreIC_Miss, BUILTIN, kNoExtraICState) \ |
262 V(InterpreterPushArgsAndCall, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 259 V(KeyedStoreIC_Miss, BUILTIN, kNoExtraICState) \ |
263 V(InterpreterPushArgsAndTailCall, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 260 V(LoadIC_Getter_ForDeopt, LOAD_IC, kNoExtraICState) \ |
264 V(InterpreterPushArgsAndConstruct, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 261 V(KeyedLoadIC_Megamorphic, KEYED_LOAD_IC, kNoExtraICState) \ |
265 V(InterpreterEnterBytecodeDispatch, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 262 \ |
266 \ | 263 V(StoreIC_Setter_ForDeopt, STORE_IC, StoreICState::kStrictModeState) \ |
267 V(LoadIC_Miss, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 264 \ |
268 V(KeyedLoadIC_Miss, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 265 V(StoreIC_Megamorphic, STORE_IC, kNoExtraICState) \ |
269 V(StoreIC_Miss, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 266 V(StoreIC_Megamorphic_Strict, STORE_IC, StoreICState::kStrictModeState) \ |
270 V(KeyedStoreIC_Miss, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 267 \ |
271 V(LoadIC_Getter_ForDeopt, LOAD_IC, MONOMORPHIC, kNoExtraICState) \ | 268 V(KeyedStoreIC_Megamorphic, KEYED_STORE_IC, kNoExtraICState) \ |
272 V(KeyedLoadIC_Megamorphic, KEYED_LOAD_IC, MEGAMORPHIC, kNoExtraICState) \ | 269 V(KeyedStoreIC_Megamorphic_Strict, KEYED_STORE_IC, \ |
273 \ | 270 StoreICState::kStrictModeState) \ |
274 V(StoreIC_Setter_ForDeopt, STORE_IC, MONOMORPHIC, \ | 271 \ |
275 StoreICState::kStrictModeState) \ | 272 V(DatePrototypeGetDate, BUILTIN, kNoExtraICState) \ |
276 \ | 273 V(DatePrototypeGetDay, BUILTIN, kNoExtraICState) \ |
277 V(StoreIC_Megamorphic, STORE_IC, MEGAMORPHIC, kNoExtraICState) \ | 274 V(DatePrototypeGetFullYear, BUILTIN, kNoExtraICState) \ |
278 V(StoreIC_Megamorphic_Strict, STORE_IC, MEGAMORPHIC, \ | 275 V(DatePrototypeGetHours, BUILTIN, kNoExtraICState) \ |
279 StoreICState::kStrictModeState) \ | 276 V(DatePrototypeGetMilliseconds, BUILTIN, kNoExtraICState) \ |
280 \ | 277 V(DatePrototypeGetMinutes, BUILTIN, kNoExtraICState) \ |
281 V(KeyedStoreIC_Megamorphic, KEYED_STORE_IC, MEGAMORPHIC, kNoExtraICState) \ | 278 V(DatePrototypeGetMonth, BUILTIN, kNoExtraICState) \ |
282 V(KeyedStoreIC_Megamorphic_Strict, KEYED_STORE_IC, MEGAMORPHIC, \ | 279 V(DatePrototypeGetSeconds, BUILTIN, kNoExtraICState) \ |
283 StoreICState::kStrictModeState) \ | 280 V(DatePrototypeGetTime, BUILTIN, kNoExtraICState) \ |
284 \ | 281 V(DatePrototypeGetTimezoneOffset, BUILTIN, kNoExtraICState) \ |
285 V(DatePrototypeGetDate, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 282 V(DatePrototypeGetUTCDate, BUILTIN, kNoExtraICState) \ |
286 V(DatePrototypeGetDay, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 283 V(DatePrototypeGetUTCDay, BUILTIN, kNoExtraICState) \ |
287 V(DatePrototypeGetFullYear, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 284 V(DatePrototypeGetUTCFullYear, BUILTIN, kNoExtraICState) \ |
288 V(DatePrototypeGetHours, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 285 V(DatePrototypeGetUTCHours, BUILTIN, kNoExtraICState) \ |
289 V(DatePrototypeGetMilliseconds, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 286 V(DatePrototypeGetUTCMilliseconds, BUILTIN, kNoExtraICState) \ |
290 V(DatePrototypeGetMinutes, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 287 V(DatePrototypeGetUTCMinutes, BUILTIN, kNoExtraICState) \ |
291 V(DatePrototypeGetMonth, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 288 V(DatePrototypeGetUTCMonth, BUILTIN, kNoExtraICState) \ |
292 V(DatePrototypeGetSeconds, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 289 V(DatePrototypeGetUTCSeconds, BUILTIN, kNoExtraICState) \ |
293 V(DatePrototypeGetTime, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 290 \ |
294 V(DatePrototypeGetTimezoneOffset, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 291 V(FunctionPrototypeApply, BUILTIN, kNoExtraICState) \ |
295 V(DatePrototypeGetUTCDate, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 292 V(FunctionPrototypeCall, BUILTIN, kNoExtraICState) \ |
296 V(DatePrototypeGetUTCDay, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 293 \ |
297 V(DatePrototypeGetUTCFullYear, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 294 V(ReflectApply, BUILTIN, kNoExtraICState) \ |
298 V(DatePrototypeGetUTCHours, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 295 V(ReflectConstruct, BUILTIN, kNoExtraICState) \ |
299 V(DatePrototypeGetUTCMilliseconds, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 296 \ |
300 V(DatePrototypeGetUTCMinutes, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 297 V(InternalArrayCode, BUILTIN, kNoExtraICState) \ |
301 V(DatePrototypeGetUTCMonth, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 298 V(ArrayCode, BUILTIN, kNoExtraICState) \ |
302 V(DatePrototypeGetUTCSeconds, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 299 \ |
303 \ | 300 V(MathMax, BUILTIN, kNoExtraICState) \ |
304 V(FunctionPrototypeApply, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 301 V(MathMin, BUILTIN, kNoExtraICState) \ |
305 V(FunctionPrototypeCall, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 302 \ |
306 \ | 303 V(NumberConstructor, BUILTIN, kNoExtraICState) \ |
307 V(ReflectApply, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 304 V(NumberConstructor_ConstructStub, BUILTIN, kNoExtraICState) \ |
308 V(ReflectConstruct, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 305 \ |
309 \ | 306 V(StringConstructor, BUILTIN, kNoExtraICState) \ |
310 V(InternalArrayCode, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 307 V(StringConstructor_ConstructStub, BUILTIN, kNoExtraICState) \ |
311 V(ArrayCode, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 308 \ |
312 \ | 309 V(OnStackReplacement, BUILTIN, kNoExtraICState) \ |
313 V(MathMax, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 310 V(InterruptCheck, BUILTIN, kNoExtraICState) \ |
314 V(MathMin, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 311 V(StackCheck, BUILTIN, kNoExtraICState) \ |
315 \ | 312 \ |
316 V(NumberConstructor, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 313 V(MarkCodeAsToBeExecutedOnce, BUILTIN, kNoExtraICState) \ |
317 V(NumberConstructor_ConstructStub, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 314 V(MarkCodeAsExecutedOnce, BUILTIN, kNoExtraICState) \ |
318 \ | 315 V(MarkCodeAsExecutedTwice, BUILTIN, kNoExtraICState) \ |
319 V(StringConstructor, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | |
320 V(StringConstructor_ConstructStub, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | |
321 \ | |
322 V(OnStackReplacement, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | |
323 V(InterruptCheck, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | |
324 V(StackCheck, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | |
325 \ | |
326 V(MarkCodeAsToBeExecutedOnce, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | |
327 V(MarkCodeAsExecutedOnce, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | |
328 V(MarkCodeAsExecutedTwice, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | |
329 CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, V) | 316 CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, V) |
330 | 317 |
331 // Define list of builtins implemented in TurboFan (with JS linkage). | 318 // Define list of builtins implemented in TurboFan (with JS linkage). |
332 #define BUILTIN_LIST_T(V) \ | 319 #define BUILTIN_LIST_T(V) \ |
333 V(FunctionPrototypeHasInstance, 2) \ | 320 V(FunctionPrototypeHasInstance, 2) \ |
334 V(GeneratorPrototypeNext, 2) \ | 321 V(GeneratorPrototypeNext, 2) \ |
335 V(GeneratorPrototypeReturn, 2) \ | 322 V(GeneratorPrototypeReturn, 2) \ |
336 V(GeneratorPrototypeThrow, 2) \ | 323 V(GeneratorPrototypeThrow, 2) \ |
337 V(MathCeil, 2) \ | 324 V(MathCeil, 2) \ |
338 V(MathClz32, 2) \ | 325 V(MathClz32, 2) \ |
(...skipping 16 matching lines...) Expand all Loading... |
355 // Define list of builtin handlers implemented in assembly. | 342 // Define list of builtin handlers implemented in assembly. |
356 #define BUILTIN_LIST_H(V) \ | 343 #define BUILTIN_LIST_H(V) \ |
357 V(LoadIC_Slow, LOAD_IC) \ | 344 V(LoadIC_Slow, LOAD_IC) \ |
358 V(KeyedLoadIC_Slow, KEYED_LOAD_IC) \ | 345 V(KeyedLoadIC_Slow, KEYED_LOAD_IC) \ |
359 V(StoreIC_Slow, STORE_IC) \ | 346 V(StoreIC_Slow, STORE_IC) \ |
360 V(KeyedStoreIC_Slow, KEYED_STORE_IC) \ | 347 V(KeyedStoreIC_Slow, KEYED_STORE_IC) \ |
361 V(LoadIC_Normal, LOAD_IC) \ | 348 V(LoadIC_Normal, LOAD_IC) \ |
362 V(StoreIC_Normal, STORE_IC) | 349 V(StoreIC_Normal, STORE_IC) |
363 | 350 |
364 // Define list of builtins used by the debugger implemented in assembly. | 351 // Define list of builtins used by the debugger implemented in assembly. |
365 #define BUILTIN_LIST_DEBUG_A(V) \ | 352 #define BUILTIN_LIST_DEBUG_A(V) \ |
366 V(Return_DebugBreak, BUILTIN, DEBUG_STUB, kNoExtraICState) \ | 353 V(Return_DebugBreak, BUILTIN, kNoExtraICState) \ |
367 V(Slot_DebugBreak, BUILTIN, DEBUG_STUB, kNoExtraICState) \ | 354 V(Slot_DebugBreak, BUILTIN, kNoExtraICState) \ |
368 V(FrameDropper_LiveEdit, BUILTIN, DEBUG_STUB, kNoExtraICState) | 355 V(FrameDropper_LiveEdit, BUILTIN, kNoExtraICState) |
369 | |
370 | 356 |
371 class BuiltinFunctionTable; | 357 class BuiltinFunctionTable; |
372 class ObjectVisitor; | 358 class ObjectVisitor; |
373 | 359 |
374 | 360 |
375 class Builtins { | 361 class Builtins { |
376 public: | 362 public: |
377 ~Builtins(); | 363 ~Builtins(); |
378 | 364 |
379 // Generate all builtin code objects. Should be called once during | 365 // Generate all builtin code objects. Should be called once during |
380 // isolate initialization. | 366 // isolate initialization. |
381 void SetUp(Isolate* isolate, bool create_heap_objects); | 367 void SetUp(Isolate* isolate, bool create_heap_objects); |
382 void TearDown(); | 368 void TearDown(); |
383 | 369 |
384 // Garbage collection support. | 370 // Garbage collection support. |
385 void IterateBuiltins(ObjectVisitor* v); | 371 void IterateBuiltins(ObjectVisitor* v); |
386 | 372 |
387 // Disassembler support. | 373 // Disassembler support. |
388 const char* Lookup(byte* pc); | 374 const char* Lookup(byte* pc); |
389 | 375 |
390 enum Name { | 376 enum Name { |
391 #define DEF_ENUM_C(name, ignore) k##name, | 377 #define DEF_ENUM_C(name, ignore) k##name, |
392 #define DEF_ENUM_A(name, kind, state, extra) k##name, | 378 #define DEF_ENUM_A(name, kind, extra) k##name, |
393 #define DEF_ENUM_T(name, argc) k##name, | 379 #define DEF_ENUM_T(name, argc) k##name, |
394 #define DEF_ENUM_H(name, kind) k##name, | 380 #define DEF_ENUM_H(name, kind) k##name, |
395 BUILTIN_LIST_C(DEF_ENUM_C) BUILTIN_LIST_A(DEF_ENUM_A) | 381 BUILTIN_LIST_C(DEF_ENUM_C) BUILTIN_LIST_A(DEF_ENUM_A) |
396 BUILTIN_LIST_T(DEF_ENUM_T) BUILTIN_LIST_H(DEF_ENUM_H) | 382 BUILTIN_LIST_T(DEF_ENUM_T) BUILTIN_LIST_H(DEF_ENUM_H) |
397 BUILTIN_LIST_DEBUG_A(DEF_ENUM_A) | 383 BUILTIN_LIST_DEBUG_A(DEF_ENUM_A) |
398 #undef DEF_ENUM_C | 384 #undef DEF_ENUM_C |
399 #undef DEF_ENUM_A | 385 #undef DEF_ENUM_A |
400 #undef DEF_ENUM_T | 386 #undef DEF_ENUM_T |
401 #undef DEF_ENUM_H | 387 #undef DEF_ENUM_H |
402 builtin_count | 388 builtin_count |
403 }; | 389 }; |
404 | 390 |
405 enum CFunctionId { | 391 enum CFunctionId { |
406 #define DEF_ENUM_C(name, ignore) c_##name, | 392 #define DEF_ENUM_C(name, ignore) c_##name, |
407 BUILTIN_LIST_C(DEF_ENUM_C) | 393 BUILTIN_LIST_C(DEF_ENUM_C) |
408 #undef DEF_ENUM_C | 394 #undef DEF_ENUM_C |
409 cfunction_count | 395 cfunction_count |
410 }; | 396 }; |
411 | 397 |
412 #define DECLARE_BUILTIN_ACCESSOR_C(name, ignore) Handle<Code> name(); | 398 #define DECLARE_BUILTIN_ACCESSOR_C(name, ignore) Handle<Code> name(); |
413 #define DECLARE_BUILTIN_ACCESSOR_A(name, kind, state, extra) \ | 399 #define DECLARE_BUILTIN_ACCESSOR_A(name, kind, extra) Handle<Code> name(); |
414 Handle<Code> name(); | |
415 #define DECLARE_BUILTIN_ACCESSOR_T(name, argc) Handle<Code> name(); | 400 #define DECLARE_BUILTIN_ACCESSOR_T(name, argc) Handle<Code> name(); |
416 #define DECLARE_BUILTIN_ACCESSOR_H(name, kind) Handle<Code> name(); | 401 #define DECLARE_BUILTIN_ACCESSOR_H(name, kind) Handle<Code> name(); |
417 BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C) | 402 BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C) |
418 BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A) | 403 BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A) |
419 BUILTIN_LIST_T(DECLARE_BUILTIN_ACCESSOR_T) | 404 BUILTIN_LIST_T(DECLARE_BUILTIN_ACCESSOR_T) |
420 BUILTIN_LIST_H(DECLARE_BUILTIN_ACCESSOR_H) | 405 BUILTIN_LIST_H(DECLARE_BUILTIN_ACCESSOR_H) |
421 BUILTIN_LIST_DEBUG_A(DECLARE_BUILTIN_ACCESSOR_A) | 406 BUILTIN_LIST_DEBUG_A(DECLARE_BUILTIN_ACCESSOR_A) |
422 #undef DECLARE_BUILTIN_ACCESSOR_C | 407 #undef DECLARE_BUILTIN_ACCESSOR_C |
423 #undef DECLARE_BUILTIN_ACCESSOR_A | 408 #undef DECLARE_BUILTIN_ACCESSOR_A |
424 #undef DECLARE_BUILTIN_ACCESSOR_T | 409 #undef DECLARE_BUILTIN_ACCESSOR_T |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 friend class BuiltinFunctionTable; | 720 friend class BuiltinFunctionTable; |
736 friend class Isolate; | 721 friend class Isolate; |
737 | 722 |
738 DISALLOW_COPY_AND_ASSIGN(Builtins); | 723 DISALLOW_COPY_AND_ASSIGN(Builtins); |
739 }; | 724 }; |
740 | 725 |
741 } // namespace internal | 726 } // namespace internal |
742 } // namespace v8 | 727 } // namespace v8 |
743 | 728 |
744 #endif // V8_BUILTINS_H_ | 729 #endif // V8_BUILTINS_H_ |
OLD | NEW |