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

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: Align stack 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
« no previous file with comments | « base/mac/call_with_eh_frame.cc ('k') | base/mac/call_with_eh_frame_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 .align 4
14 CALL_WITH_EH_FRAME:
15
16 .cfi_startproc
17
18 // Configure the C++ exception handler personality routine. Normally the
19 // compiler would emit ___gxx_personality_v0 here. The purpose of this
20 // function is to use a custom personality routine.
21 .cfi_personality 155, __ZN4base3mac21CxxPersonalityRoutineEi14_Unwind_ActionyP 17_Unwind_ExceptionP15_Unwind_Context
22 .cfi_lsda 16, CallWithEHFrame_exception_table
23
24 Lfunction_start:
25 pushq %rbp
26 .cfi_def_cfa_offset 16
27 .cfi_offset %rbp, -16
28 movq %rsp, %rbp
29 .cfi_def_cfa_register %rbp
30
31 // Load the function pointer from the block descriptor.
32 movq 16(%rdi), %rax
33
34 // Execute the block in the context of a C++ try{}.
35 Ltry_start:
36 callq *%rax
37 Ltry_end:
38 popq %rbp
39 ret
40
41 // Landing pad for the exception handler. This should never be called, since
42 // the personality routine will stop the search for an exception handler,
43 // which will cause the runtime to invoke the default terminate handler.
44 Lcatch:
45 movq %rax, %rdi
46 callq ___cxa_begin_catch // The ABI requires a call to the catch handler.
47 ud2 // In the event this is called, make it fatal.
48
49 Lfunction_end:
50 .cfi_endproc
51
52 // The C++ exception table that is used to identify this frame as an
53 // exception handler. See http://llvm.org/docs/ExceptionHandling.html and
54 // http://mentorembedded.github.io/cxx-abi/exceptions.pdf.
55 .section __TEXT,__gcc_except_tab
56 .align 2
57 CallWithEHFrame_exception_table:
58 .byte 255 // DW_EH_PE_omit
59 .byte 155 // DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4
60 .asciz "\242\200\200" // LE int128 for the number of bytes in this table.
61 .byte 3 // DW_EH_PE_udata4
62 .byte 26 // Callsite table length.
63
64 // First callsite.
65 CS1_begin = Ltry_start - Lfunction_start
66 .long CS1_begin
67 CS1_end = Ltry_end - Ltry_start
68 .long CS1_end
69
70 // First landing pad.
71 LP1 = Lcatch - Lfunction_start
72 .long LP1
73 .byte 1 // Action record.
74
75 // Second callsite.
76 CS2_begin = Ltry_end - Lfunction_start
77 .long CS2_begin
78 CS2_end = Lfunction_end - Ltry_end
79 .long CS2_end
80
81 // Second landing pad (none).
82 .long 0
83 .byte 0 // No action.
84
85 // Action table.
86 .byte 1 // Action record 1.
87 .byte 0 // No further action to take.
88 .long 0 // No type filter for this catch(){} clause.
89 .align 2
OLDNEW
« no previous file with comments | « base/mac/call_with_eh_frame.cc ('k') | base/mac/call_with_eh_frame_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698