OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 int result_size); | 1235 int result_size); |
1236 | 1236 |
1237 // Jump to a runtime routine. | 1237 // Jump to a runtime routine. |
1238 void JumpToExternalReference(const ExternalReference& ext, int result_size); | 1238 void JumpToExternalReference(const ExternalReference& ext, int result_size); |
1239 | 1239 |
1240 // Prepares stack to put arguments (aligns and so on). WIN64 calling | 1240 // Prepares stack to put arguments (aligns and so on). WIN64 calling |
1241 // convention requires to put the pointer to the return value slot into | 1241 // convention requires to put the pointer to the return value slot into |
1242 // rcx (rcx must be preserverd until CallApiFunctionAndReturn). Saves | 1242 // rcx (rcx must be preserverd until CallApiFunctionAndReturn). Saves |
1243 // context (rsi). Clobbers rax. Allocates arg_stack_space * kPointerSize | 1243 // context (rsi). Clobbers rax. Allocates arg_stack_space * kPointerSize |
1244 // inside the exit frame (not GCed) accessible via StackSpaceOperand. | 1244 // inside the exit frame (not GCed) accessible via StackSpaceOperand. |
1245 void PrepareCallApiFunction(int arg_stack_space, bool returns_handle); | 1245 void PrepareCallApiFunction(int arg_stack_space); |
1246 | 1246 |
1247 // Calls an API function. Allocates HandleScope, extracts returned value | 1247 // Calls an API function. Allocates HandleScope, extracts returned value |
1248 // from handle and propagates exceptions. Clobbers r14, r15, rbx and | 1248 // from handle and propagates exceptions. Clobbers r14, r15, rbx and |
1249 // caller-save registers. Restores context. On return removes | 1249 // caller-save registers. Restores context. On return removes |
1250 // stack_space * kPointerSize (GCed). | 1250 // stack_space * kPointerSize (GCed). |
1251 void CallApiFunctionAndReturn(Address function_address, | 1251 void CallApiFunctionAndReturn(Address function_address, |
1252 Address thunk_address, | 1252 Address thunk_address, |
1253 Register thunk_last_arg, | 1253 Register thunk_last_arg, |
1254 int stack_space, | 1254 int stack_space, |
1255 bool returns_handle, | |
1256 int return_value_offset_from_rbp); | 1255 int return_value_offset_from_rbp); |
1257 | 1256 |
1258 // Before calling a C-function from generated code, align arguments on stack. | 1257 // Before calling a C-function from generated code, align arguments on stack. |
1259 // After aligning the frame, arguments must be stored in rsp[0], rsp[8], | 1258 // After aligning the frame, arguments must be stored in rsp[0], rsp[8], |
1260 // etc., not pushed. The argument count assumes all arguments are word sized. | 1259 // etc., not pushed. The argument count assumes all arguments are word sized. |
1261 // The number of slots reserved for arguments depends on platform. On Windows | 1260 // The number of slots reserved for arguments depends on platform. On Windows |
1262 // stack slots are reserved for the arguments passed in registers. On other | 1261 // stack slots are reserved for the arguments passed in registers. On other |
1263 // platforms stack slots are only reserved for the arguments actually passed | 1262 // platforms stack slots are only reserved for the arguments actually passed |
1264 // on the stack. | 1263 // on the stack. |
1265 void PrepareCallCFunction(int num_arguments); | 1264 void PrepareCallCFunction(int num_arguments); |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1543 masm->popfq(); \ | 1542 masm->popfq(); \ |
1544 } \ | 1543 } \ |
1545 masm-> | 1544 masm-> |
1546 #else | 1545 #else |
1547 #define ACCESS_MASM(masm) masm-> | 1546 #define ACCESS_MASM(masm) masm-> |
1548 #endif | 1547 #endif |
1549 | 1548 |
1550 } } // namespace v8::internal | 1549 } } // namespace v8::internal |
1551 | 1550 |
1552 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1551 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |