Skip to content

Commit 5bb421f

Browse files
authored
Merge pull request #2899 from MicrosoftDocs/master
5/22 AM Publish
2 parents 8c8ed02 + e8cf9db commit 5bb421f

File tree

2 files changed

+12
-21
lines changed

2 files changed

+12
-21
lines changed

docs/build/arm64-exception-handling.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,7 @@ The unwind codes are encoded according to the table below. All unwind codes are
301301
|`end`| 11100100: end of unwind code. Implies ret in epilog. |
302302
|`end_c`| 11100101: end of unwind code in current chained scope. |
303303
|`save_next`| 11100110: save next non-volatile Int or FP register pair. |
304-
|`arithmetic(add)`| 11100111'000zxxxx: add cookie reg(z) to lr (0=x28, 1=sp); `add lr, lr, reg(z)` |
305-
|`arithmetic(sub)`| 11100111'001zxxxx: sub cookie reg(z) from lr (0=x28, 1=sp); `sub lr, lr, reg(z)` |
306-
|`arithmetic(eor)`| 11100111'010zxxxx: eor lr with cookie reg(z) (0=x28, 1=sp); `eor lr, lr, reg(z)` |
307-
|`arithmetic(rol)`| 11100111'0110xxxx: simulated rol of lr with cookie reg (x28); xip0 = neg x28; `ror lr, xip0` |
308-
|`arithmetic(ror)`| 11100111'100zxxxx: ror lr with cookie reg(z) (0=x28, 1=sp); `ror lr, lr, reg(z)` |
309-
| | 11100111: xxxz----: ---- reserved |
304+
| | 11100111: reserved |
310305
| | 11101xxx: reserved for custom stack cases below only generated for asm routines |
311306
| | 11101000: Custom stack for MSFT_OP_TRAP_FRAME |
312307
| | 11101001: Custom stack for MSFT_OP_MACHINE_FRAME |

docs/cpp/thiscall.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
11
---
22
title: "__thiscall"
3-
ms.date: "11/04/2016"
3+
ms.date: "05/22/2020"
44
f1_keywords: ["__thiscall", "__thiscall_cpp"]
55
helpviewer_keywords: ["__thiscall keyword [C++]"]
66
ms.assetid: a6a22dd2-0101-4885-b33b-22f6057965df
77
---
8-
# __thiscall
8+
# `__thiscall`
99

10-
**Microsoft Specific**
10+
The **Microsoft-specific** **`__thiscall`** calling convention is used on C++ class member functions on the x86 architecture. It's the default calling convention used by member functions that don't use variable arguments (`vararg` functions).
1111

12-
The **__thiscall** calling convention is used on member functions and is the default calling convention used by C++ member functions that do not use variable arguments. Under **__thiscall**, the callee cleans the stack, which is impossible for `vararg` functions. Arguments are pushed on the stack from right to left, with the **this** pointer being passed via register ECX, and not on the stack, on the x86 architecture.
12+
Under **`__thiscall`**, the callee cleans the stack, which is impossible for `vararg` functions. Arguments are pushed on the stack from right to left. The **`this`** pointer is passed via register ECX, and not on the stack.
1313

14-
One reason to use **__thiscall** is in classes whose member functions use `__clrcall` by default. In that case, you can use **__thiscall** to make individual member functions callable from native code.
14+
On ARM, ARM64, and x64 machines, **`__thiscall`** is accepted and ignored by the compiler. That's because they use a register-based calling convention by default.
1515

16-
When compiling with [/clr:pure](../build/reference/clr-common-language-runtime-compilation.md), all functions and function pointers are `__clrcall` unless specified otherwise. The **/clr:pure** and **/clr:safe** compiler options are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017.
16+
One reason to use **`__thiscall`** is in classes whose member functions use **`__clrcall`** by default. In that case, you can use **`__thiscall`** to make individual member functions callable from native code.
1717

18-
In releases before Visual Studio 2005, the **__thiscall** calling convention could not be explicitly specified in a program, because **__thiscall** was not a keyword.
18+
When compiling with [**`/clr:pure`**](../build/reference/clr-common-language-runtime-compilation.md), all functions and function pointers are **`__clrcall`** unless specified otherwise. The **`/clr:pure`** and **`/clr:safe`** compiler options are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017.
1919

20-
`vararg` member functions use the **__cdecl** calling convention. All function arguments are pushed on the stack, with the **this** pointer placed on the stack last
20+
`vararg` member functions use the **`__cdecl`** calling convention. All function arguments are pushed on the stack, with the **`this`** pointer placed on the stack last.
2121

22-
Because this calling convention applies only to C++, there is no C name decoration scheme.
22+
Because this calling convention applies only to C++, it doesn't have a C name decoration scheme.
2323

24-
On ARM and x64 machines, **__thiscall** is accepted and ignored by the compiler.
25-
26-
For non-static class functions, if the function is defined out-of-line, the calling convention modifier does not have to be specified on the out-of-line definition. That is, for class non-static member methods, the calling convention specified during declaration is assumed at the point of definition.
27-
28-
**END Microsoft Specific**
24+
When you define a non-static class member function out-of-line, specify the calling convention modifier only in the declaration. You don't have to specify it again on the out-of-line definition. The compiler uses the calling convention specified during declaration at the point of definition.
2925

3026
## See also
3127

32-
[Argument Passing and Naming Conventions](../cpp/argument-passing-and-naming-conventions.md)
28+
[Argument passing and naming conventions](../cpp/argument-passing-and-naming-conventions.md)

0 commit comments

Comments
 (0)