| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 V(NotifyStubFailure, BUILTIN, kNoExtraICState) \ | 246 V(NotifyStubFailure, BUILTIN, kNoExtraICState) \ |
| 247 V(NotifyStubFailureSaveDoubles, BUILTIN, kNoExtraICState) \ | 247 V(NotifyStubFailureSaveDoubles, BUILTIN, kNoExtraICState) \ |
| 248 \ | 248 \ |
| 249 V(InterpreterEntryTrampoline, BUILTIN, kNoExtraICState) \ | 249 V(InterpreterEntryTrampoline, BUILTIN, kNoExtraICState) \ |
| 250 V(InterpreterMarkBaselineOnReturn, BUILTIN, kNoExtraICState) \ | 250 V(InterpreterMarkBaselineOnReturn, BUILTIN, kNoExtraICState) \ |
| 251 V(InterpreterPushArgsAndCall, BUILTIN, kNoExtraICState) \ | 251 V(InterpreterPushArgsAndCall, BUILTIN, kNoExtraICState) \ |
| 252 V(InterpreterPushArgsAndTailCall, BUILTIN, kNoExtraICState) \ | 252 V(InterpreterPushArgsAndTailCall, BUILTIN, kNoExtraICState) \ |
| 253 V(InterpreterPushArgsAndConstruct, BUILTIN, kNoExtraICState) \ | 253 V(InterpreterPushArgsAndConstruct, BUILTIN, kNoExtraICState) \ |
| 254 V(InterpreterEnterBytecodeDispatch, BUILTIN, kNoExtraICState) \ | 254 V(InterpreterEnterBytecodeDispatch, BUILTIN, kNoExtraICState) \ |
| 255 \ | 255 \ |
| 256 V(LoadIC_Miss, BUILTIN, kNoExtraICState) \ | |
| 257 V(KeyedLoadIC_Miss, BUILTIN, kNoExtraICState) \ | 256 V(KeyedLoadIC_Miss, BUILTIN, kNoExtraICState) \ |
| 258 V(StoreIC_Miss, BUILTIN, kNoExtraICState) \ | 257 V(StoreIC_Miss, BUILTIN, kNoExtraICState) \ |
| 259 V(KeyedStoreIC_Miss, BUILTIN, kNoExtraICState) \ | 258 V(KeyedStoreIC_Miss, BUILTIN, kNoExtraICState) \ |
| 260 V(LoadIC_Getter_ForDeopt, LOAD_IC, kNoExtraICState) \ | 259 V(LoadIC_Getter_ForDeopt, LOAD_IC, kNoExtraICState) \ |
| 261 V(KeyedLoadIC_Megamorphic, KEYED_LOAD_IC, kNoExtraICState) \ | 260 V(KeyedLoadIC_Megamorphic, KEYED_LOAD_IC, kNoExtraICState) \ |
| 262 \ | 261 \ |
| 263 V(StoreIC_Setter_ForDeopt, STORE_IC, StoreICState::kStrictModeState) \ | 262 V(StoreIC_Setter_ForDeopt, STORE_IC, StoreICState::kStrictModeState) \ |
| 264 \ | 263 \ |
| 265 V(StoreIC_Megamorphic, STORE_IC, kNoExtraICState) \ | 264 V(StoreIC_Megamorphic, STORE_IC, kNoExtraICState) \ |
| 266 V(StoreIC_Megamorphic_Strict, STORE_IC, StoreICState::kStrictModeState) \ | 265 V(StoreIC_Megamorphic_Strict, STORE_IC, StoreICState::kStrictModeState) \ |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 V(ArrayIsArray, 2) \ | 331 V(ArrayIsArray, 2) \ |
| 333 V(StringFromCharCode, 2) \ | 332 V(StringFromCharCode, 2) \ |
| 334 V(StringPrototypeCharAt, 2) \ | 333 V(StringPrototypeCharAt, 2) \ |
| 335 V(StringPrototypeCharCodeAt, 2) \ | 334 V(StringPrototypeCharCodeAt, 2) \ |
| 336 V(TypedArrayPrototypeByteLength, 1) \ | 335 V(TypedArrayPrototypeByteLength, 1) \ |
| 337 V(TypedArrayPrototypeByteOffset, 1) \ | 336 V(TypedArrayPrototypeByteOffset, 1) \ |
| 338 V(TypedArrayPrototypeLength, 1) \ | 337 V(TypedArrayPrototypeLength, 1) \ |
| 339 V(AtomicsLoad, 3) \ | 338 V(AtomicsLoad, 3) \ |
| 340 V(AtomicsStore, 4) | 339 V(AtomicsStore, 4) |
| 341 | 340 |
| 341 // Define list of builtins implemented in TurboFan (with CallStub linkage). |
| 342 #define BUILTIN_LIST_S(V) \ |
| 343 V(LoadIC_Miss, BUILTIN, kNoExtraICState, LoadWithVector) \ |
| 344 V(LoadIC_Slow, HANDLER, Code::LOAD_IC, LoadWithVector) |
| 345 |
| 342 // Define list of builtin handlers implemented in assembly. | 346 // Define list of builtin handlers implemented in assembly. |
| 343 #define BUILTIN_LIST_H(V) \ | 347 #define BUILTIN_LIST_H(V) \ |
| 344 V(LoadIC_Slow, LOAD_IC) \ | |
| 345 V(KeyedLoadIC_Slow, KEYED_LOAD_IC) \ | 348 V(KeyedLoadIC_Slow, KEYED_LOAD_IC) \ |
| 346 V(StoreIC_Slow, STORE_IC) \ | 349 V(StoreIC_Slow, STORE_IC) \ |
| 347 V(KeyedStoreIC_Slow, KEYED_STORE_IC) \ | 350 V(KeyedStoreIC_Slow, KEYED_STORE_IC) \ |
| 348 V(LoadIC_Normal, LOAD_IC) \ | 351 V(LoadIC_Normal, LOAD_IC) \ |
| 349 V(StoreIC_Normal, STORE_IC) | 352 V(StoreIC_Normal, STORE_IC) |
| 350 | 353 |
| 351 // Define list of builtins used by the debugger implemented in assembly. | 354 // Define list of builtins used by the debugger implemented in assembly. |
| 352 #define BUILTIN_LIST_DEBUG_A(V) \ | 355 #define BUILTIN_LIST_DEBUG_A(V) \ |
| 353 V(Return_DebugBreak, BUILTIN, kNoExtraICState) \ | 356 V(Return_DebugBreak, BUILTIN, kNoExtraICState) \ |
| 354 V(Slot_DebugBreak, BUILTIN, kNoExtraICState) \ | 357 V(Slot_DebugBreak, BUILTIN, kNoExtraICState) \ |
| (...skipping 15 matching lines...) Expand all Loading... |
| 370 // Garbage collection support. | 373 // Garbage collection support. |
| 371 void IterateBuiltins(ObjectVisitor* v); | 374 void IterateBuiltins(ObjectVisitor* v); |
| 372 | 375 |
| 373 // Disassembler support. | 376 // Disassembler support. |
| 374 const char* Lookup(byte* pc); | 377 const char* Lookup(byte* pc); |
| 375 | 378 |
| 376 enum Name { | 379 enum Name { |
| 377 #define DEF_ENUM_C(name, ignore) k##name, | 380 #define DEF_ENUM_C(name, ignore) k##name, |
| 378 #define DEF_ENUM_A(name, kind, extra) k##name, | 381 #define DEF_ENUM_A(name, kind, extra) k##name, |
| 379 #define DEF_ENUM_T(name, argc) k##name, | 382 #define DEF_ENUM_T(name, argc) k##name, |
| 383 #define DEF_ENUM_S(name, kind, extra, interface_descriptor) k##name, |
| 380 #define DEF_ENUM_H(name, kind) k##name, | 384 #define DEF_ENUM_H(name, kind) k##name, |
| 381 BUILTIN_LIST_C(DEF_ENUM_C) BUILTIN_LIST_A(DEF_ENUM_A) | 385 BUILTIN_LIST_C(DEF_ENUM_C) BUILTIN_LIST_A(DEF_ENUM_A) |
| 382 BUILTIN_LIST_T(DEF_ENUM_T) BUILTIN_LIST_H(DEF_ENUM_H) | 386 BUILTIN_LIST_T(DEF_ENUM_T) BUILTIN_LIST_S(DEF_ENUM_S) |
| 383 BUILTIN_LIST_DEBUG_A(DEF_ENUM_A) | 387 BUILTIN_LIST_H(DEF_ENUM_H) BUILTIN_LIST_DEBUG_A(DEF_ENUM_A) |
| 384 #undef DEF_ENUM_C | 388 #undef DEF_ENUM_C |
| 385 #undef DEF_ENUM_A | 389 #undef DEF_ENUM_A |
| 386 #undef DEF_ENUM_T | 390 #undef DEF_ENUM_T |
| 391 #undef DEF_ENUM_S |
| 387 #undef DEF_ENUM_H | 392 #undef DEF_ENUM_H |
| 388 builtin_count | 393 builtin_count |
| 389 }; | 394 }; |
| 390 | 395 |
| 391 enum CFunctionId { | 396 enum CFunctionId { |
| 392 #define DEF_ENUM_C(name, ignore) c_##name, | 397 #define DEF_ENUM_C(name, ignore) c_##name, |
| 393 BUILTIN_LIST_C(DEF_ENUM_C) | 398 BUILTIN_LIST_C(DEF_ENUM_C) |
| 394 #undef DEF_ENUM_C | 399 #undef DEF_ENUM_C |
| 395 cfunction_count | 400 cfunction_count |
| 396 }; | 401 }; |
| 397 | 402 |
| 398 #define DECLARE_BUILTIN_ACCESSOR_C(name, ignore) Handle<Code> name(); | 403 #define DECLARE_BUILTIN_ACCESSOR_C(name, ignore) Handle<Code> name(); |
| 399 #define DECLARE_BUILTIN_ACCESSOR_A(name, kind, extra) Handle<Code> name(); | 404 #define DECLARE_BUILTIN_ACCESSOR_A(name, kind, extra) Handle<Code> name(); |
| 400 #define DECLARE_BUILTIN_ACCESSOR_T(name, argc) Handle<Code> name(); | 405 #define DECLARE_BUILTIN_ACCESSOR_T(name, argc) Handle<Code> name(); |
| 406 #define DECLARE_BUILTIN_ACCESSOR_S(name, kind, extra, interface_descriptor) \ |
| 407 Handle<Code> name(); |
| 401 #define DECLARE_BUILTIN_ACCESSOR_H(name, kind) Handle<Code> name(); | 408 #define DECLARE_BUILTIN_ACCESSOR_H(name, kind) Handle<Code> name(); |
| 402 BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C) | 409 BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C) |
| 403 BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A) | 410 BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A) |
| 404 BUILTIN_LIST_T(DECLARE_BUILTIN_ACCESSOR_T) | 411 BUILTIN_LIST_T(DECLARE_BUILTIN_ACCESSOR_T) |
| 412 BUILTIN_LIST_S(DECLARE_BUILTIN_ACCESSOR_S) |
| 405 BUILTIN_LIST_H(DECLARE_BUILTIN_ACCESSOR_H) | 413 BUILTIN_LIST_H(DECLARE_BUILTIN_ACCESSOR_H) |
| 406 BUILTIN_LIST_DEBUG_A(DECLARE_BUILTIN_ACCESSOR_A) | 414 BUILTIN_LIST_DEBUG_A(DECLARE_BUILTIN_ACCESSOR_A) |
| 407 #undef DECLARE_BUILTIN_ACCESSOR_C | 415 #undef DECLARE_BUILTIN_ACCESSOR_C |
| 408 #undef DECLARE_BUILTIN_ACCESSOR_A | 416 #undef DECLARE_BUILTIN_ACCESSOR_A |
| 409 #undef DECLARE_BUILTIN_ACCESSOR_T | 417 #undef DECLARE_BUILTIN_ACCESSOR_T |
| 418 #undef DECLARE_BUILTIN_ACCESSOR_S |
| 410 #undef DECLARE_BUILTIN_ACCESSOR_H | 419 #undef DECLARE_BUILTIN_ACCESSOR_H |
| 411 | 420 |
| 412 // Convenience wrappers. | 421 // Convenience wrappers. |
| 413 Handle<Code> CallFunction( | 422 Handle<Code> CallFunction( |
| 414 ConvertReceiverMode = ConvertReceiverMode::kAny, | 423 ConvertReceiverMode = ConvertReceiverMode::kAny, |
| 415 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 424 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
| 416 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny, | 425 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny, |
| 417 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 426 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
| 418 Handle<Code> CallBoundFunction(TailCallMode tail_call_mode); | 427 Handle<Code> CallBoundFunction(TailCallMode tail_call_mode); |
| 419 Handle<Code> InterpreterPushArgsAndCall(TailCallMode tail_call_mode); | 428 Handle<Code> InterpreterPushArgsAndCall(TailCallMode tail_call_mode); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 friend class BuiltinFunctionTable; | 729 friend class BuiltinFunctionTable; |
| 721 friend class Isolate; | 730 friend class Isolate; |
| 722 | 731 |
| 723 DISALLOW_COPY_AND_ASSIGN(Builtins); | 732 DISALLOW_COPY_AND_ASSIGN(Builtins); |
| 724 }; | 733 }; |
| 725 | 734 |
| 726 } // namespace internal | 735 } // namespace internal |
| 727 } // namespace v8 | 736 } // namespace v8 |
| 728 | 737 |
| 729 #endif // V8_BUILTINS_H_ | 738 #endif // V8_BUILTINS_H_ |
| OLD | NEW |