You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build/arm64-exception-handling.md
+1-5Lines changed: 1 addition & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -15,12 +15,10 @@ The exception unwinding data conventions, and this description, are intended to:
15
15
16
16
- Analyzing the code requires the code to be paged in. It prevents unwinding in some circumstances where it's useful (tracing, sampling, debugging).
17
17
18
-
19
18
- Analyzing the code is complex; the compiler must be careful to only generate instructions that the unwinder can decode.
20
19
21
20
- If unwinding can't be fully described by using unwind codes, then in some cases it must fall back to instruction decoding. Instruction decoding increases the overall complexity, and ideally should be avoided.
22
21
23
-
24
22
- Support unwinding in mid-prolog and mid-epilog.
25
23
26
24
- Unwinding is used in Windows for more than exception handling. It's critical that code can unwind accurately even when in the middle of a prolog or epilog code sequence.
@@ -277,14 +275,12 @@ The array of unwind codes is a pool of sequences that describe exactly how to un
277
275
278
276
If exceptions were guaranteed to only ever occur within a function body, and never within a prolog or any epilog, then only a single sequence would be necessary. However, the Windows unwinding model requires that code can unwind from within a partially executed prolog or epilog. To meet this requirement, the unwind codes have been carefully designed so they unambiguously map 1:1 to each relevant opcode in the prolog and epilog. This design has several implications:
279
277
280
-
281
278
- By counting the number of unwind codes, it's possible to compute the length of the prolog and epilog.
282
279
283
280
- By counting the number of instructions past the start of an epilog scope, it's possible to skip the equivalent number of unwind codes. We can execute the rest of a sequence to complete the partially executed unwind done by the epilog.
284
281
285
282
- By counting the number of instructions before the end of the prolog, it's possible to skip the equivalent number of unwind codes. We can execute the rest of the sequence to undo only those parts of the prolog that have completed execution.
286
283
287
-
288
284
The unwind codes are encoded according to the table below. All unwind codes are a single/double byte, except the one that allocates a huge stack. There are 21 unwind codes in total. Each unwind code maps exactly one instruction in the prolog/epilog, to allow for unwinding of partially executed prologs and epilogs.
289
285
290
286
| Unwind code | Bits and interpretation |
@@ -303,7 +299,7 @@ The unwind codes are encoded according to the table below. All unwind codes are
303
299
|`save_fregp_x`| 1101101x'xxzzzzzz: save pair d(8+#X), at `[sp-(#Z+1)*8]!`, pre-indexed offset >= -512 |
304
300
|`save_freg`| 1101110x'xxzzzzzz: save reg d(8+#X) at `[sp+#Z*8]`, offset \<= 504 |
305
301
|`save_freg_x`| 11011110'xxxzzzzz: save reg d(8+#X) at `[sp-(#Z+1)*8]!`, pre-indexed offset >= -256 |
306
-
|`alloc_l`| 11100000'xxxxxxxx'xxxxxxxx'xxxxxxxx: allocate large stack with size \< 256M (2^24 *16) |
302
+
|`alloc_l`| 11100000'xxxxxxxx'xxxxxxxx'xxxxxxxx: allocate large stack with size \< 256M (2^24 *16) |
307
303
|`set_fp`| 11100001: set up x29: with: `mov x29,sp`|
308
304
|`add_fp`| 11100010'xxxxxxxx: set up x29 with: `add x29,sp,#x*8`|
309
305
|`nop`| 11100011: no unwind operation is required. |
The C operators are a subset of the [C++ built-in operators](../cpp/cpp-built-in-operators-precedence-and-associativity.md).
11
11
12
-
13
12
There are three types of operators. A unary expression consists of either a unary operator followed by an operand, or the **`sizeof`** or **`_Alignof`** keyword followed by an expression. The expression can be either the name of a variable or a cast expression. If the expression is a cast expression, it must be enclosed in parentheses. A binary expression consists of two operands joined by a binary operator. A ternary expression consists of three operands joined by the conditional-expression operator.
0 commit comments