OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_IA32_MACRO_ASSEMBLER_IA32_H_ | 5 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/frames.h" | 10 #include "src/frames.h" |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 | 664 |
665 // Tail call a code stub (jump). Generate the code if necessary. | 665 // Tail call a code stub (jump). Generate the code if necessary. |
666 void TailCallStub(CodeStub* stub); | 666 void TailCallStub(CodeStub* stub); |
667 | 667 |
668 // Return from a code stub after popping its arguments. | 668 // Return from a code stub after popping its arguments. |
669 void StubReturn(int argc); | 669 void StubReturn(int argc); |
670 | 670 |
671 // Call a runtime routine. | 671 // Call a runtime routine. |
672 void CallRuntime(const Runtime::Function* f, int num_arguments, | 672 void CallRuntime(const Runtime::Function* f, int num_arguments, |
673 SaveFPRegsMode save_doubles = kDontSaveFPRegs); | 673 SaveFPRegsMode save_doubles = kDontSaveFPRegs); |
674 void CallRuntimeSaveDoubles(Runtime::FunctionId id) { | 674 void CallRuntimeSaveDoubles(Runtime::FunctionId fid) { |
675 const Runtime::Function* function = Runtime::FunctionForId(id); | 675 const Runtime::Function* function = Runtime::FunctionForId(fid); |
676 CallRuntime(function, function->nargs, kSaveFPRegs); | 676 CallRuntime(function, function->nargs, kSaveFPRegs); |
677 } | 677 } |
678 | 678 |
679 // Convenience function: Same as above, but takes the fid instead. | 679 // Convenience function: Same as above, but takes the fid instead. |
680 void CallRuntime(Runtime::FunctionId id, int num_arguments, | 680 void CallRuntime(Runtime::FunctionId fid, |
681 SaveFPRegsMode save_doubles = kDontSaveFPRegs) { | 681 SaveFPRegsMode save_doubles = kDontSaveFPRegs) { |
682 CallRuntime(Runtime::FunctionForId(id), num_arguments, save_doubles); | 682 const Runtime::Function* function = Runtime::FunctionForId(fid); |
| 683 CallRuntime(function, function->nargs, save_doubles); |
| 684 } |
| 685 |
| 686 // Convenience function: Same as above, but takes the fid instead. |
| 687 void CallRuntime(Runtime::FunctionId fid, int num_arguments, |
| 688 SaveFPRegsMode save_doubles = kDontSaveFPRegs) { |
| 689 CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles); |
683 } | 690 } |
684 | 691 |
685 // Convenience function: call an external reference. | 692 // Convenience function: call an external reference. |
686 void CallExternalReference(ExternalReference ref, int num_arguments); | 693 void CallExternalReference(ExternalReference ref, int num_arguments); |
687 | 694 |
688 // Tail call of a runtime routine (jump). | |
689 // Like JumpToExternalReference, but also takes care of passing the number | |
690 // of parameters. | |
691 void TailCallExternalReference(const ExternalReference& ext, | |
692 int num_arguments); | |
693 | |
694 // Convenience function: tail call a runtime routine (jump). | 695 // Convenience function: tail call a runtime routine (jump). |
695 void TailCallRuntime(Runtime::FunctionId fid, int num_arguments); | 696 void TailCallRuntime(Runtime::FunctionId fid); |
696 | 697 |
697 // Before calling a C-function from generated code, align arguments on stack. | 698 // Before calling a C-function from generated code, align arguments on stack. |
698 // After aligning the frame, arguments must be stored in esp[0], esp[4], | 699 // After aligning the frame, arguments must be stored in esp[0], esp[4], |
699 // etc., not pushed. The argument count assumes all arguments are word sized. | 700 // etc., not pushed. The argument count assumes all arguments are word sized. |
700 // Some compilers/platforms require the stack to be aligned when calling | 701 // Some compilers/platforms require the stack to be aligned when calling |
701 // C++ code. | 702 // C++ code. |
702 // Needs a scratch register to do some arithmetic. This register will be | 703 // Needs a scratch register to do some arithmetic. This register will be |
703 // trashed. | 704 // trashed. |
704 void PrepareCallCFunction(int num_arguments, Register scratch); | 705 void PrepareCallCFunction(int num_arguments, Register scratch); |
705 | 706 |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 } \ | 1003 } \ |
1003 masm-> | 1004 masm-> |
1004 #else | 1005 #else |
1005 #define ACCESS_MASM(masm) masm-> | 1006 #define ACCESS_MASM(masm) masm-> |
1006 #endif | 1007 #endif |
1007 | 1008 |
1008 } // namespace internal | 1009 } // namespace internal |
1009 } // namespace v8 | 1010 } // namespace v8 |
1010 | 1011 |
1011 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 1012 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |