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 1221 matching lines...) Loading... |
1232 // rcx (rcx must be preserverd until CallApiFunctionAndReturn). Saves | 1232 // rcx (rcx must be preserverd until CallApiFunctionAndReturn). Saves |
1233 // context (rsi). Clobbers rax. Allocates arg_stack_space * kPointerSize | 1233 // context (rsi). Clobbers rax. Allocates arg_stack_space * kPointerSize |
1234 // inside the exit frame (not GCed) accessible via StackSpaceOperand. | 1234 // inside the exit frame (not GCed) accessible via StackSpaceOperand. |
1235 void PrepareCallApiFunction(int arg_stack_space, bool returns_handle); | 1235 void PrepareCallApiFunction(int arg_stack_space, bool returns_handle); |
1236 | 1236 |
1237 // Calls an API function. Allocates HandleScope, extracts returned value | 1237 // Calls an API function. Allocates HandleScope, extracts returned value |
1238 // from handle and propagates exceptions. Clobbers r14, r15, rbx and | 1238 // from handle and propagates exceptions. Clobbers r14, r15, rbx and |
1239 // caller-save registers. Restores context. On return removes | 1239 // caller-save registers. Restores context. On return removes |
1240 // stack_space * kPointerSize (GCed). | 1240 // stack_space * kPointerSize (GCed). |
1241 void CallApiFunctionAndReturn(Address function_address, | 1241 void CallApiFunctionAndReturn(Address function_address, |
| 1242 Address thunk_address, |
| 1243 Register thunk_last_arg, |
1242 int stack_space, | 1244 int stack_space, |
1243 bool returns_handle, | 1245 bool returns_handle, |
1244 int return_value_offset_from_rbp); | 1246 int return_value_offset_from_rbp); |
1245 | 1247 |
1246 // Before calling a C-function from generated code, align arguments on stack. | 1248 // Before calling a C-function from generated code, align arguments on stack. |
1247 // After aligning the frame, arguments must be stored in esp[0], esp[4], | 1249 // After aligning the frame, arguments must be stored in esp[0], esp[4], |
1248 // etc., not pushed. The argument count assumes all arguments are word sized. | 1250 // etc., not pushed. The argument count assumes all arguments are word sized. |
1249 // The number of slots reserved for arguments depends on platform. On Windows | 1251 // The number of slots reserved for arguments depends on platform. On Windows |
1250 // stack slots are reserved for the arguments passed in registers. On other | 1252 // stack slots are reserved for the arguments passed in registers. On other |
1251 // platforms stack slots are only reserved for the arguments actually passed | 1253 // platforms stack slots are only reserved for the arguments actually passed |
(...skipping 275 matching lines...) Loading... |
1527 masm->popfq(); \ | 1529 masm->popfq(); \ |
1528 } \ | 1530 } \ |
1529 masm-> | 1531 masm-> |
1530 #else | 1532 #else |
1531 #define ACCESS_MASM(masm) masm-> | 1533 #define ACCESS_MASM(masm) masm-> |
1532 #endif | 1534 #endif |
1533 | 1535 |
1534 } } // namespace v8::internal | 1536 } } // namespace v8::internal |
1535 | 1537 |
1536 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1538 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |