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 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1219 // convention requires to put the pointer to the return value slot into | 1219 // convention requires to put the pointer to the return value slot into |
1220 // rcx (rcx must be preserverd until CallApiFunctionAndReturn). Saves | 1220 // rcx (rcx must be preserverd until CallApiFunctionAndReturn). Saves |
1221 // context (rsi). Clobbers rax. Allocates arg_stack_space * kPointerSize | 1221 // context (rsi). Clobbers rax. Allocates arg_stack_space * kPointerSize |
1222 // inside the exit frame (not GCed) accessible via StackSpaceOperand. | 1222 // inside the exit frame (not GCed) accessible via StackSpaceOperand. |
1223 void PrepareCallApiFunction(int arg_stack_space); | 1223 void PrepareCallApiFunction(int arg_stack_space); |
1224 | 1224 |
1225 // Calls an API function. Allocates HandleScope, extracts returned value | 1225 // Calls an API function. Allocates HandleScope, extracts returned value |
1226 // from handle and propagates exceptions. Clobbers r14, r15, rbx and | 1226 // from handle and propagates exceptions. Clobbers r14, r15, rbx and |
1227 // caller-save registers. Restores context. On return removes | 1227 // caller-save registers. Restores context. On return removes |
1228 // stack_space * kPointerSize (GCed). | 1228 // stack_space * kPointerSize (GCed). |
1229 void CallApiFunctionAndReturn(Address function_address, int stack_space); | 1229 void CallApiFunctionAndReturn( |
1230 Address function_address, | |
tfarina
2013/05/03 16:33:46
super tiny nit: doesn't fit in 80 column above? wi
| |
1231 int stack_space, | |
1232 int return_value_offset); | |
1230 | 1233 |
1231 // Before calling a C-function from generated code, align arguments on stack. | 1234 // Before calling a C-function from generated code, align arguments on stack. |
1232 // After aligning the frame, arguments must be stored in esp[0], esp[4], | 1235 // After aligning the frame, arguments must be stored in esp[0], esp[4], |
1233 // etc., not pushed. The argument count assumes all arguments are word sized. | 1236 // etc., not pushed. The argument count assumes all arguments are word sized. |
1234 // The number of slots reserved for arguments depends on platform. On Windows | 1237 // The number of slots reserved for arguments depends on platform. On Windows |
1235 // stack slots are reserved for the arguments passed in registers. On other | 1238 // stack slots are reserved for the arguments passed in registers. On other |
1236 // platforms stack slots are only reserved for the arguments actually passed | 1239 // platforms stack slots are only reserved for the arguments actually passed |
1237 // on the stack. | 1240 // on the stack. |
1238 void PrepareCallCFunction(int num_arguments); | 1241 void PrepareCallCFunction(int num_arguments); |
1239 | 1242 |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1512 masm->popfq(); \ | 1515 masm->popfq(); \ |
1513 } \ | 1516 } \ |
1514 masm-> | 1517 masm-> |
1515 #else | 1518 #else |
1516 #define ACCESS_MASM(masm) masm-> | 1519 #define ACCESS_MASM(masm) masm-> |
1517 #endif | 1520 #endif |
1518 | 1521 |
1519 } } // namespace v8::internal | 1522 } } // namespace v8::internal |
1520 | 1523 |
1521 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1524 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |