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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 // memory (not GCed) on the stack accessible via StackSpaceOperand. | 295 // memory (not GCed) on the stack accessible via StackSpaceOperand. |
296 void EnterApiExitFrame(int arg_stack_space); | 296 void EnterApiExitFrame(int arg_stack_space); |
297 | 297 |
298 // Leave the current exit frame. Expects/provides the return value in | 298 // Leave the current exit frame. Expects/provides the return value in |
299 // register rax:rdx (untouched) and the pointer to the first | 299 // register rax:rdx (untouched) and the pointer to the first |
300 // argument in register rsi. | 300 // argument in register rsi. |
301 void LeaveExitFrame(bool save_doubles = false); | 301 void LeaveExitFrame(bool save_doubles = false); |
302 | 302 |
303 // Leave the current exit frame. Expects/provides the return value in | 303 // Leave the current exit frame. Expects/provides the return value in |
304 // register rax (untouched). | 304 // register rax (untouched). |
305 void LeaveApiExitFrame(); | 305 void LeaveApiExitFrame(bool restore_context); |
306 | 306 |
307 // Push and pop the registers that can hold pointers. | 307 // Push and pop the registers that can hold pointers. |
308 void PushSafepointRegisters() { Pushad(); } | 308 void PushSafepointRegisters() { Pushad(); } |
309 void PopSafepointRegisters() { Popad(); } | 309 void PopSafepointRegisters() { Popad(); } |
310 // Store the value in register src in the safepoint register stack | 310 // Store the value in register src in the safepoint register stack |
311 // slot for register dst. | 311 // slot for register dst. |
312 void StoreToSafepointRegisterSlot(Register dst, const Immediate& imm); | 312 void StoreToSafepointRegisterSlot(Register dst, const Immediate& imm); |
313 void StoreToSafepointRegisterSlot(Register dst, Register src); | 313 void StoreToSafepointRegisterSlot(Register dst, Register src); |
314 void LoadFromSafepointRegisterSlot(Register dst, Register src); | 314 void LoadFromSafepointRegisterSlot(Register dst, Register src); |
315 | 315 |
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 void PrepareCallApiFunction(int arg_stack_space); | 1253 void PrepareCallApiFunction(int arg_stack_space); |
1254 | 1254 |
1255 // Calls an API function. Allocates HandleScope, extracts returned value | 1255 // Calls an API function. Allocates HandleScope, extracts returned value |
1256 // from handle and propagates exceptions. Clobbers r14, r15, rbx and | 1256 // from handle and propagates exceptions. Clobbers r14, r15, rbx and |
1257 // caller-save registers. Restores context. On return removes | 1257 // caller-save registers. Restores context. On return removes |
1258 // stack_space * kPointerSize (GCed). | 1258 // stack_space * kPointerSize (GCed). |
1259 void CallApiFunctionAndReturn(Address function_address, | 1259 void CallApiFunctionAndReturn(Address function_address, |
1260 Address thunk_address, | 1260 Address thunk_address, |
1261 Register thunk_last_arg, | 1261 Register thunk_last_arg, |
1262 int stack_space, | 1262 int stack_space, |
1263 int return_value_offset_from_rbp); | 1263 int return_value_offset_from_rbp, |
| 1264 int restore_context_offset_from_rbp = 0); |
1264 | 1265 |
1265 // Before calling a C-function from generated code, align arguments on stack. | 1266 // Before calling a C-function from generated code, align arguments on stack. |
1266 // After aligning the frame, arguments must be stored in rsp[0], rsp[8], | 1267 // After aligning the frame, arguments must be stored in rsp[0], rsp[8], |
1267 // etc., not pushed. The argument count assumes all arguments are word sized. | 1268 // etc., not pushed. The argument count assumes all arguments are word sized. |
1268 // The number of slots reserved for arguments depends on platform. On Windows | 1269 // The number of slots reserved for arguments depends on platform. On Windows |
1269 // stack slots are reserved for the arguments passed in registers. On other | 1270 // stack slots are reserved for the arguments passed in registers. On other |
1270 // platforms stack slots are only reserved for the arguments actually passed | 1271 // platforms stack slots are only reserved for the arguments actually passed |
1271 // on the stack. | 1272 // on the stack. |
1272 void PrepareCallCFunction(int num_arguments); | 1273 void PrepareCallCFunction(int num_arguments); |
1273 | 1274 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 Label::Distance near_jump = Label::kFar, | 1410 Label::Distance near_jump = Label::kFar, |
1410 const CallWrapper& call_wrapper = NullCallWrapper(), | 1411 const CallWrapper& call_wrapper = NullCallWrapper(), |
1411 CallKind call_kind = CALL_AS_METHOD); | 1412 CallKind call_kind = CALL_AS_METHOD); |
1412 | 1413 |
1413 void EnterExitFramePrologue(bool save_rax); | 1414 void EnterExitFramePrologue(bool save_rax); |
1414 | 1415 |
1415 // Allocates arg_stack_space * kPointerSize memory (not GCed) on the stack | 1416 // Allocates arg_stack_space * kPointerSize memory (not GCed) on the stack |
1416 // accessible via StackSpaceOperand. | 1417 // accessible via StackSpaceOperand. |
1417 void EnterExitFrameEpilogue(int arg_stack_space, bool save_doubles); | 1418 void EnterExitFrameEpilogue(int arg_stack_space, bool save_doubles); |
1418 | 1419 |
1419 void LeaveExitFrameEpilogue(); | 1420 void LeaveExitFrameEpilogue(bool restore_context); |
1420 | 1421 |
1421 // Allocation support helpers. | 1422 // Allocation support helpers. |
1422 // Loads the top of new-space into the result register. | 1423 // Loads the top of new-space into the result register. |
1423 // Otherwise the address of the new-space top is loaded into scratch (if | 1424 // Otherwise the address of the new-space top is loaded into scratch (if |
1424 // scratch is valid), and the new-space top is loaded into result. | 1425 // scratch is valid), and the new-space top is loaded into result. |
1425 void LoadAllocationTopHelper(Register result, | 1426 void LoadAllocationTopHelper(Register result, |
1426 Register scratch, | 1427 Register scratch, |
1427 AllocationFlags flags); | 1428 AllocationFlags flags); |
1428 | 1429 |
1429 // Update allocation top with value in result_end register. | 1430 // Update allocation top with value in result_end register. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1550 masm->popfq(); \ | 1551 masm->popfq(); \ |
1551 } \ | 1552 } \ |
1552 masm-> | 1553 masm-> |
1553 #else | 1554 #else |
1554 #define ACCESS_MASM(masm) masm-> | 1555 #define ACCESS_MASM(masm) masm-> |
1555 #endif | 1556 #endif |
1556 | 1557 |
1557 } } // namespace v8::internal | 1558 } } // namespace v8::internal |
1558 | 1559 |
1559 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1560 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |