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(TailCallMode tail_call_mode, |
456 bool is_js_function = false); | |
rmcilroy
2016/07/08 09:57:59
nit - could you make this bool an enum instead.
Benedikt Meurer
2016/07/09 18:19:22
Yes, please.
mythria
2016/07/11 15:25:24
Thanks, Done.
| |
454 | 457 |
455 Code* builtin(Name name) { | 458 Code* builtin(Name name) { |
456 // Code::cast cannot be used here since we access builtins | 459 // Code::cast cannot be used here since we access builtins |
457 // during the marking phase of mark sweep. See IC::Clear. | 460 // during the marking phase of mark sweep. See IC::Clear. |
458 return reinterpret_cast<Code*>(builtins_[name]); | 461 return reinterpret_cast<Code*>(builtins_[name]); |
459 } | 462 } |
460 | 463 |
461 Address builtin_address(Name name) { | 464 Address builtin_address(Name name) { |
462 return reinterpret_cast<Address>(&builtins_[name]); | 465 return reinterpret_cast<Address>(&builtins_[name]); |
463 } | 466 } |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
783 static void Generate_TypedArrayPrototypeLength(CodeStubAssembler* assembler); | 786 static void Generate_TypedArrayPrototypeLength(CodeStubAssembler* assembler); |
784 | 787 |
785 static void Generate_OnStackReplacement(MacroAssembler* masm); | 788 static void Generate_OnStackReplacement(MacroAssembler* masm); |
786 static void Generate_InterruptCheck(MacroAssembler* masm); | 789 static void Generate_InterruptCheck(MacroAssembler* masm); |
787 static void Generate_StackCheck(MacroAssembler* masm); | 790 static void Generate_StackCheck(MacroAssembler* masm); |
788 | 791 |
789 static void Generate_InterpreterEntryTrampoline(MacroAssembler* masm); | 792 static void Generate_InterpreterEntryTrampoline(MacroAssembler* masm); |
790 static void Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm); | 793 static void Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm); |
791 static void Generate_InterpreterMarkBaselineOnReturn(MacroAssembler* masm); | 794 static void Generate_InterpreterMarkBaselineOnReturn(MacroAssembler* masm); |
792 static void Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { | 795 static void Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { |
793 return Generate_InterpreterPushArgsAndCallImpl(masm, | 796 return Generate_InterpreterPushArgsAndCallImpl( |
794 TailCallMode::kDisallow); | 797 masm, TailCallMode::kDisallow, false); |
795 } | 798 } |
796 static void Generate_InterpreterPushArgsAndTailCall(MacroAssembler* masm) { | 799 static void Generate_InterpreterPushArgsAndTailCall(MacroAssembler* masm) { |
797 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kAllow); | 800 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kAllow, |
801 false); | |
802 } | |
803 static void Generate_InterpreterPushArgsAndCallFunction( | |
804 MacroAssembler* masm) { | |
805 return Generate_InterpreterPushArgsAndCallImpl( | |
806 masm, TailCallMode::kDisallow, true); | |
807 } | |
808 static void Generate_InterpreterPushArgsAndTailCallFunction( | |
809 MacroAssembler* masm) { | |
810 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kAllow, | |
811 true); | |
798 } | 812 } |
799 static void Generate_InterpreterPushArgsAndCallImpl( | 813 static void Generate_InterpreterPushArgsAndCallImpl( |
800 MacroAssembler* masm, TailCallMode tail_call_mode); | 814 MacroAssembler* masm, TailCallMode tail_call_mode, bool is_js_function); |
801 static void Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm); | 815 static void Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm); |
802 | 816 |
803 #define DECLARE_CODE_AGE_BUILTIN_GENERATOR(C) \ | 817 #define DECLARE_CODE_AGE_BUILTIN_GENERATOR(C) \ |
804 static void Generate_Make##C##CodeYoungAgainEvenMarking( \ | 818 static void Generate_Make##C##CodeYoungAgainEvenMarking( \ |
805 MacroAssembler* masm); \ | 819 MacroAssembler* masm); \ |
806 static void Generate_Make##C##CodeYoungAgainOddMarking( \ | 820 static void Generate_Make##C##CodeYoungAgainOddMarking( \ |
807 MacroAssembler* masm); | 821 MacroAssembler* masm); |
808 CODE_AGE_LIST(DECLARE_CODE_AGE_BUILTIN_GENERATOR) | 822 CODE_AGE_LIST(DECLARE_CODE_AGE_BUILTIN_GENERATOR) |
809 #undef DECLARE_CODE_AGE_BUILTIN_GENERATOR | 823 #undef DECLARE_CODE_AGE_BUILTIN_GENERATOR |
810 | 824 |
(...skipping 11 matching lines...) Expand all Loading... | |
822 friend class BuiltinFunctionTable; | 836 friend class BuiltinFunctionTable; |
823 friend class Isolate; | 837 friend class Isolate; |
824 | 838 |
825 DISALLOW_COPY_AND_ASSIGN(Builtins); | 839 DISALLOW_COPY_AND_ASSIGN(Builtins); |
826 }; | 840 }; |
827 | 841 |
828 } // namespace internal | 842 } // namespace internal |
829 } // namespace v8 | 843 } // namespace v8 |
830 | 844 |
831 #endif // V8_BUILTINS_H_ | 845 #endif // V8_BUILTINS_H_ |
OLD | NEW |