| 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_X64_MACRO_ASSEMBLER_X64_H_ | 5 #ifndef V8_X64_MACRO_ASSEMBLER_X64_H_ |
| 6 #define V8_X64_MACRO_ASSEMBLER_X64_H_ | 6 #define V8_X64_MACRO_ASSEMBLER_X64_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 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1319 int result_size); | 1319 int result_size); |
| 1320 | 1320 |
| 1321 // Convenience function: tail call a runtime routine (jump). | 1321 // Convenience function: tail call a runtime routine (jump). |
| 1322 void TailCallRuntime(Runtime::FunctionId fid, | 1322 void TailCallRuntime(Runtime::FunctionId fid, |
| 1323 int num_arguments, | 1323 int num_arguments, |
| 1324 int result_size); | 1324 int result_size); |
| 1325 | 1325 |
| 1326 // Jump to a runtime routine. | 1326 // Jump to a runtime routine. |
| 1327 void JumpToExternalReference(const ExternalReference& ext, int result_size); | 1327 void JumpToExternalReference(const ExternalReference& ext, int result_size); |
| 1328 | 1328 |
| 1329 // Prepares stack to put arguments (aligns and so on). WIN64 calling | |
| 1330 // convention requires to put the pointer to the return value slot into | |
| 1331 // rcx (rcx must be preserverd until CallApiFunctionAndReturn). Saves | |
| 1332 // context (rsi). Clobbers rax. Allocates arg_stack_space * kPointerSize | |
| 1333 // inside the exit frame (not GCed) accessible via StackSpaceOperand. | |
| 1334 void PrepareCallApiFunction(int arg_stack_space); | |
| 1335 | |
| 1336 // Calls an API function. Allocates HandleScope, extracts returned value | |
| 1337 // from handle and propagates exceptions. Clobbers r14, r15, rbx and | |
| 1338 // caller-save registers. Restores context. On return removes | |
| 1339 // stack_space * kPointerSize (GCed). | |
| 1340 void CallApiFunctionAndReturn(Register function_address, | |
| 1341 ExternalReference thunk_ref, | |
| 1342 Register thunk_last_arg, int stack_space, | |
| 1343 Operand* stack_space_operand, | |
| 1344 Operand return_value_operand, | |
| 1345 Operand* context_restore_operand); | |
| 1346 | |
| 1347 // Before calling a C-function from generated code, align arguments on stack. | 1329 // Before calling a C-function from generated code, align arguments on stack. |
| 1348 // After aligning the frame, arguments must be stored in rsp[0], rsp[8], | 1330 // After aligning the frame, arguments must be stored in rsp[0], rsp[8], |
| 1349 // etc., not pushed. The argument count assumes all arguments are word sized. | 1331 // etc., not pushed. The argument count assumes all arguments are word sized. |
| 1350 // The number of slots reserved for arguments depends on platform. On Windows | 1332 // The number of slots reserved for arguments depends on platform. On Windows |
| 1351 // stack slots are reserved for the arguments passed in registers. On other | 1333 // stack slots are reserved for the arguments passed in registers. On other |
| 1352 // platforms stack slots are only reserved for the arguments actually passed | 1334 // platforms stack slots are only reserved for the arguments actually passed |
| 1353 // on the stack. | 1335 // on the stack. |
| 1354 void PrepareCallCFunction(int num_arguments); | 1336 void PrepareCallCFunction(int num_arguments); |
| 1355 | 1337 |
| 1356 // Calls a C function and cleans up the space for arguments allocated | 1338 // Calls a C function and cleans up the space for arguments allocated |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1646 masm->popfq(); \ | 1628 masm->popfq(); \ |
| 1647 } \ | 1629 } \ |
| 1648 masm-> | 1630 masm-> |
| 1649 #else | 1631 #else |
| 1650 #define ACCESS_MASM(masm) masm-> | 1632 #define ACCESS_MASM(masm) masm-> |
| 1651 #endif | 1633 #endif |
| 1652 | 1634 |
| 1653 } } // namespace v8::internal | 1635 } } // namespace v8::internal |
| 1654 | 1636 |
| 1655 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1637 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
| OLD | NEW |