Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(613)

Side by Side Diff: base/mac/call_with_eh_frame_asm.S

Issue 1212093002: [Mac] Redo NSException handling, and generate better stacks for C++ exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // base::mac::CallWithEHFrame(void () block_pointer)
6 #define CALL_WITH_EH_FRAME __ZN4base3mac15CallWithEHFrameEU13block_pointerFvvE
7
8 .section __TEXT,__text,regular,pure_instructions
9 #if !defined(COMPONENT_BUILD)
10 .private_extern CALL_WITH_EH_FRAME
11 #endif
12 .globl CALL_WITH_EH_FRAME
13 CALL_WITH_EH_FRAME:
14
15 .cfi_startproc
16
17 // Configure the C++ exception handler personality routine. Normally the
18 // compiler would emit ___gxx_personality_v0 here. The purpose of this
19 // function is to use a custom personality routine.
20 .cfi_personality 155, __ZN4base3mac21CxxPersonalityRoutineEi14_Unwind_ActionyP 17_Unwind_ExceptionP15_Unwind_Context
21 .cfi_lsda 16, CallWithEHFrame_exception_table
22
23 Lfunction_start:
24 pushq %rbp
25 .cfi_def_cfa_offset 16
26 .cfi_offset %rbp, -16
27 movq %rsp, %rbp
28 .cfi_def_cfa_register %rbp
29
30 // Load the function pointer from the block descriptor.
31 movq 16(%rdi), %rax
32
33 // Execute the block in the context of a C++ try{}.
34 Ltry_start:
35 callq *%rax
36 Ltry_end:
37 popq %rbp
38 ret
39
40 // Landing pad for the exception handler. This should never be called, since
41 // the personality routine will stop the search for an exception handler,
42 // which will cause the runtime to invoke the default terminate handler.
43 Lcatch:
44 movq %rax, %rdi
45 callq ___cxa_begin_catch // The ABI requires a call to the catch handler.
46 ud2 // In the event this is called, make it fatal.
47
48 Lfunction_end:
49 .cfi_endproc
50
51 // The C++ exception table that is used to identify this frame as an
52 // exception handler. See http://llvm.org/docs/ExceptionHandling.html and
53 // http://mentorembedded.github.io/cxx-abi/exceptions.pdf.
54 .section __TEXT,__gcc_except_tab
55 .align 2
56 CallWithEHFrame_exception_table:
57 .byte 255 // DW_EH_PE_omit
58 .byte 155 // DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4
59 .asciz "\242\200\200" // LE int128 for the number of bytes in this table.
60 .byte 3 // DW_EH_PE_udata4
61 .byte 26 // Callsite table length.
62
63 // First callsite.
64 CS1_begin = Ltry_start - Lfunction_start
65 .long CS1_begin
66 CS1_end = Ltry_end - Ltry_start
67 .long CS1_end
68
69 // First landing pad.
70 LP1 = Lcatch - Lfunction_start
71 .long LP1
72 .byte 1 // Action record.
73
74 // Second callsite.
75 CS2_begin = Ltry_end - Lfunction_start
76 .long CS2_begin
77 CS2_end = Lfunction_end - Ltry_end
78 .long CS2_end
79
80 // Second landing pad (none).
81 .long 0
82 .byte 0 // No action.
83
84 // Action table.
85 .byte 1 // Action record 1.
86 .byte 0 // No further action to take.
87 .long 0 // No type filter for this catch(){} clause.
88 .align 2
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698