OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // Store the code object for the given builtin in the target register. | 155 // Store the code object for the given builtin in the target register. |
156 void GetBuiltinEntry(Register target, Builtins::JavaScript id); | 156 void GetBuiltinEntry(Register target, Builtins::JavaScript id); |
157 | 157 |
158 | 158 |
159 // --------------------------------------------------------------------------- | 159 // --------------------------------------------------------------------------- |
160 // Smi tagging, untagging and operations on tagged smis. | 160 // Smi tagging, untagging and operations on tagged smis. |
161 | 161 |
162 // Conversions between tagged smi values and non-tagged integer values. | 162 // Conversions between tagged smi values and non-tagged integer values. |
163 | 163 |
164 // Tag an integer value. The result must be known to be a valid smi value. | 164 // Tag an integer value. The result must be known to be a valid smi value. |
165 // Only uses the low 32 bits of the src register. | 165 // Only uses the low 32 bits of the src register. Sets the N and Z flags |
| 166 // based on the value of the resulting integer. |
166 void Integer32ToSmi(Register dst, Register src); | 167 void Integer32ToSmi(Register dst, Register src); |
167 | 168 |
168 // Tag an integer value if possible, or jump the integer value cannot be | 169 // Tag an integer value if possible, or jump the integer value cannot be |
169 // represented as a smi. Only uses the low 32 bit of the src registers. | 170 // represented as a smi. Only uses the low 32 bit of the src registers. |
170 // NOTICE: Destroys the dst register even if unsuccessful! | 171 // NOTICE: Destroys the dst register even if unsuccessful! |
171 void Integer32ToSmi(Register dst, Register src, Label* on_overflow); | 172 void Integer32ToSmi(Register dst, Register src, Label* on_overflow); |
172 | 173 |
173 // Adds constant to src and tags the result as a smi. | 174 // Adds constant to src and tags the result as a smi. |
174 // Result must be a valid smi. | 175 // Result must be a valid smi. |
175 void Integer64PlusConstantToSmi(Register dst, Register src, int constant); | 176 void Integer64PlusConstantToSmi(Register dst, Register src, int constant); |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 // Tail call of a runtime routine (jump). | 638 // Tail call of a runtime routine (jump). |
638 // Like JumpToRuntime, but also takes care of passing the number | 639 // Like JumpToRuntime, but also takes care of passing the number |
639 // of arguments. | 640 // of arguments. |
640 void TailCallRuntime(const ExternalReference& ext, | 641 void TailCallRuntime(const ExternalReference& ext, |
641 int num_arguments, | 642 int num_arguments, |
642 int result_size); | 643 int result_size); |
643 | 644 |
644 // Jump to a runtime routine. | 645 // Jump to a runtime routine. |
645 void JumpToRuntime(const ExternalReference& ext, int result_size); | 646 void JumpToRuntime(const ExternalReference& ext, int result_size); |
646 | 647 |
| 648 // Before calling a C-function from generated code, align arguments on stack. |
| 649 // After aligning the frame, arguments must be stored in esp[0], esp[4], |
| 650 // etc., not pushed. The argument count assumes all arguments are word sized. |
| 651 // The number of slots reserved for arguments depends on platform. On Windows |
| 652 // stack slots are reserved for the arguments passed in registers. On other |
| 653 // platforms stack slots are only reserved for the arguments actually passed |
| 654 // on the stack. |
| 655 void PrepareCallCFunction(int num_arguments); |
| 656 |
| 657 // Calls a C function and cleans up the space for arguments allocated |
| 658 // by PrepareCallCFunction. The called function is not allowed to trigger a |
| 659 // garbage collection, since that might move the code and invalidate the |
| 660 // return address (unless this is somehow accounted for by the called |
| 661 // function). |
| 662 void CallCFunction(ExternalReference function, int num_arguments); |
| 663 void CallCFunction(Register function, int num_arguments); |
| 664 |
| 665 // Calculate the number of stack slots to reserve for arguments when calling a |
| 666 // C function. |
| 667 int ArgumentStackSlotsForCFunctionCall(int num_arguments); |
647 | 668 |
648 // --------------------------------------------------------------------------- | 669 // --------------------------------------------------------------------------- |
649 // Utilities | 670 // Utilities |
650 | 671 |
651 void Ret(); | 672 void Ret(); |
652 | 673 |
653 struct Unresolved { | 674 struct Unresolved { |
654 int pc; | 675 int pc; |
655 uint32_t flags; // see Bootstrapper::FixupFlags decoders/encoders. | 676 uint32_t flags; // see Bootstrapper::FixupFlags decoders/encoders. |
656 const char* name; | 677 const char* name; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 } \ | 804 } \ |
784 masm-> | 805 masm-> |
785 #else | 806 #else |
786 #define ACCESS_MASM(masm) masm-> | 807 #define ACCESS_MASM(masm) masm-> |
787 #endif | 808 #endif |
788 | 809 |
789 | 810 |
790 } } // namespace v8::internal | 811 } } // namespace v8::internal |
791 | 812 |
792 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 813 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |