| OLD | NEW |
| 1 | 1 |
| 2 // Copyright 2011 the V8 project authors. All rights reserved. | 2 // Copyright 2011 the V8 project authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 #ifndef V8_BUILTINS_H_ | 6 #ifndef V8_BUILTINS_H_ |
| 7 #define V8_BUILTINS_H_ | 7 #define V8_BUILTINS_H_ |
| 8 | 8 |
| 9 #include "src/base/flags.h" | 9 #include "src/base/flags.h" |
| 10 #include "src/handles.h" | 10 #include "src/handles.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 V(CompileOptimized, BUILTIN, kNoExtraICState) \ | 232 V(CompileOptimized, BUILTIN, kNoExtraICState) \ |
| 233 V(CompileOptimizedConcurrent, BUILTIN, kNoExtraICState) \ | 233 V(CompileOptimizedConcurrent, BUILTIN, kNoExtraICState) \ |
| 234 V(NotifyDeoptimized, BUILTIN, kNoExtraICState) \ | 234 V(NotifyDeoptimized, BUILTIN, kNoExtraICState) \ |
| 235 V(NotifySoftDeoptimized, BUILTIN, kNoExtraICState) \ | 235 V(NotifySoftDeoptimized, BUILTIN, kNoExtraICState) \ |
| 236 V(NotifyLazyDeoptimized, BUILTIN, kNoExtraICState) \ | 236 V(NotifyLazyDeoptimized, BUILTIN, kNoExtraICState) \ |
| 237 V(NotifyStubFailure, BUILTIN, kNoExtraICState) \ | 237 V(NotifyStubFailure, BUILTIN, kNoExtraICState) \ |
| 238 V(NotifyStubFailureSaveDoubles, BUILTIN, kNoExtraICState) \ | 238 V(NotifyStubFailureSaveDoubles, BUILTIN, kNoExtraICState) \ |
| 239 \ | 239 \ |
| 240 V(InterpreterEntryTrampoline, BUILTIN, kNoExtraICState) \ | 240 V(InterpreterEntryTrampoline, BUILTIN, kNoExtraICState) \ |
| 241 V(InterpreterMarkBaselineOnReturn, BUILTIN, kNoExtraICState) \ | 241 V(InterpreterMarkBaselineOnReturn, BUILTIN, kNoExtraICState) \ |
| 242 V(InterpreterPushArgsAndCallFunction, BUILTIN, kNoExtraICState) \ |
| 243 V(InterpreterPushArgsAndTailCallFunction, BUILTIN, kNoExtraICState) \ |
| 242 V(InterpreterPushArgsAndCall, BUILTIN, kNoExtraICState) \ | 244 V(InterpreterPushArgsAndCall, BUILTIN, kNoExtraICState) \ |
| 243 V(InterpreterPushArgsAndTailCall, BUILTIN, kNoExtraICState) \ | 245 V(InterpreterPushArgsAndTailCall, BUILTIN, kNoExtraICState) \ |
| 244 V(InterpreterPushArgsAndConstruct, BUILTIN, kNoExtraICState) \ | 246 V(InterpreterPushArgsAndConstruct, BUILTIN, kNoExtraICState) \ |
| 245 V(InterpreterEnterBytecodeDispatch, BUILTIN, kNoExtraICState) \ | 247 V(InterpreterEnterBytecodeDispatch, BUILTIN, kNoExtraICState) \ |
| 246 \ | 248 \ |
| 247 V(KeyedLoadIC_Miss, BUILTIN, kNoExtraICState) \ | 249 V(KeyedLoadIC_Miss, BUILTIN, kNoExtraICState) \ |
| 248 V(StoreIC_Miss, BUILTIN, kNoExtraICState) \ | 250 V(StoreIC_Miss, BUILTIN, kNoExtraICState) \ |
| 249 V(KeyedStoreIC_Miss, BUILTIN, kNoExtraICState) \ | 251 V(KeyedStoreIC_Miss, BUILTIN, kNoExtraICState) \ |
| 250 V(LoadIC_Getter_ForDeopt, LOAD_IC, kNoExtraICState) \ | 252 V(LoadIC_Getter_ForDeopt, LOAD_IC, kNoExtraICState) \ |
| 251 V(KeyedLoadIC_Megamorphic, KEYED_LOAD_IC, kNoExtraICState) \ | 253 V(KeyedLoadIC_Megamorphic, KEYED_LOAD_IC, kNoExtraICState) \ |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 #undef DECLARE_BUILTIN_ACCESSOR_S | 445 #undef DECLARE_BUILTIN_ACCESSOR_S |
| 444 #undef DECLARE_BUILTIN_ACCESSOR_H | 446 #undef DECLARE_BUILTIN_ACCESSOR_H |
| 445 | 447 |
| 446 // Convenience wrappers. | 448 // Convenience wrappers. |
| 447 Handle<Code> CallFunction( | 449 Handle<Code> CallFunction( |
| 448 ConvertReceiverMode = ConvertReceiverMode::kAny, | 450 ConvertReceiverMode = ConvertReceiverMode::kAny, |
| 449 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 451 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
| 450 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny, | 452 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny, |
| 451 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 453 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
| 452 Handle<Code> CallBoundFunction(TailCallMode tail_call_mode); | 454 Handle<Code> CallBoundFunction(TailCallMode tail_call_mode); |
| 453 Handle<Code> InterpreterPushArgsAndCall(TailCallMode tail_call_mode); | 455 Handle<Code> InterpreterPushArgsAndCall( |
| 456 TailCallMode tail_call_mode, |
| 457 CallableType function_type = CallableType::kAny); |
| 454 | 458 |
| 455 Code* builtin(Name name) { | 459 Code* builtin(Name name) { |
| 456 // Code::cast cannot be used here since we access builtins | 460 // Code::cast cannot be used here since we access builtins |
| 457 // during the marking phase of mark sweep. See IC::Clear. | 461 // during the marking phase of mark sweep. See IC::Clear. |
| 458 return reinterpret_cast<Code*>(builtins_[name]); | 462 return reinterpret_cast<Code*>(builtins_[name]); |
| 459 } | 463 } |
| 460 | 464 |
| 461 Address builtin_address(Name name) { | 465 Address builtin_address(Name name) { |
| 462 return reinterpret_cast<Address>(&builtins_[name]); | 466 return reinterpret_cast<Address>(&builtins_[name]); |
| 463 } | 467 } |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 static void Generate_TypedArrayPrototypeLength(CodeStubAssembler* assembler); | 787 static void Generate_TypedArrayPrototypeLength(CodeStubAssembler* assembler); |
| 784 | 788 |
| 785 static void Generate_OnStackReplacement(MacroAssembler* masm); | 789 static void Generate_OnStackReplacement(MacroAssembler* masm); |
| 786 static void Generate_InterruptCheck(MacroAssembler* masm); | 790 static void Generate_InterruptCheck(MacroAssembler* masm); |
| 787 static void Generate_StackCheck(MacroAssembler* masm); | 791 static void Generate_StackCheck(MacroAssembler* masm); |
| 788 | 792 |
| 789 static void Generate_InterpreterEntryTrampoline(MacroAssembler* masm); | 793 static void Generate_InterpreterEntryTrampoline(MacroAssembler* masm); |
| 790 static void Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm); | 794 static void Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm); |
| 791 static void Generate_InterpreterMarkBaselineOnReturn(MacroAssembler* masm); | 795 static void Generate_InterpreterMarkBaselineOnReturn(MacroAssembler* masm); |
| 792 static void Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { | 796 static void Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { |
| 793 return Generate_InterpreterPushArgsAndCallImpl(masm, | 797 return Generate_InterpreterPushArgsAndCallImpl( |
| 794 TailCallMode::kDisallow); | 798 masm, TailCallMode::kDisallow, CallableType::kAny); |
| 795 } | 799 } |
| 796 static void Generate_InterpreterPushArgsAndTailCall(MacroAssembler* masm) { | 800 static void Generate_InterpreterPushArgsAndTailCall(MacroAssembler* masm) { |
| 797 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kAllow); | 801 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kAllow, |
| 802 CallableType::kAny); |
| 803 } |
| 804 static void Generate_InterpreterPushArgsAndCallFunction( |
| 805 MacroAssembler* masm) { |
| 806 return Generate_InterpreterPushArgsAndCallImpl( |
| 807 masm, TailCallMode::kDisallow, CallableType::kJSFunction); |
| 808 } |
| 809 static void Generate_InterpreterPushArgsAndTailCallFunction( |
| 810 MacroAssembler* masm) { |
| 811 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kAllow, |
| 812 CallableType::kJSFunction); |
| 798 } | 813 } |
| 799 static void Generate_InterpreterPushArgsAndCallImpl( | 814 static void Generate_InterpreterPushArgsAndCallImpl( |
| 800 MacroAssembler* masm, TailCallMode tail_call_mode); | 815 MacroAssembler* masm, TailCallMode tail_call_mode, |
| 816 CallableType function_type); |
| 801 static void Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm); | 817 static void Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm); |
| 802 | 818 |
| 803 #define DECLARE_CODE_AGE_BUILTIN_GENERATOR(C) \ | 819 #define DECLARE_CODE_AGE_BUILTIN_GENERATOR(C) \ |
| 804 static void Generate_Make##C##CodeYoungAgainEvenMarking( \ | 820 static void Generate_Make##C##CodeYoungAgainEvenMarking( \ |
| 805 MacroAssembler* masm); \ | 821 MacroAssembler* masm); \ |
| 806 static void Generate_Make##C##CodeYoungAgainOddMarking( \ | 822 static void Generate_Make##C##CodeYoungAgainOddMarking( \ |
| 807 MacroAssembler* masm); | 823 MacroAssembler* masm); |
| 808 CODE_AGE_LIST(DECLARE_CODE_AGE_BUILTIN_GENERATOR) | 824 CODE_AGE_LIST(DECLARE_CODE_AGE_BUILTIN_GENERATOR) |
| 809 #undef DECLARE_CODE_AGE_BUILTIN_GENERATOR | 825 #undef DECLARE_CODE_AGE_BUILTIN_GENERATOR |
| 810 | 826 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 822 friend class BuiltinFunctionTable; | 838 friend class BuiltinFunctionTable; |
| 823 friend class Isolate; | 839 friend class Isolate; |
| 824 | 840 |
| 825 DISALLOW_COPY_AND_ASSIGN(Builtins); | 841 DISALLOW_COPY_AND_ASSIGN(Builtins); |
| 826 }; | 842 }; |
| 827 | 843 |
| 828 } // namespace internal | 844 } // namespace internal |
| 829 } // namespace v8 | 845 } // namespace v8 |
| 830 | 846 |
| 831 #endif // V8_BUILTINS_H_ | 847 #endif // V8_BUILTINS_H_ |
| OLD | NEW |