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.
5 // base::mac::CallWithEHFrame(void () block_pointer)
6 #define CALL_WITH_EH_FRAME __ZN4base3mac15CallWithEHFrameEU13block_pointerFvvE
8 .section __TEXT,__text,regular,pure_instructions
9 #if !defined(COMPONENT_BUILD)
10 .private_extern CALL_WITH_EH_FRAME
12 .globl CALL_WITH_EH_FRAME
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_ActionyP17_Unwind_ExceptionP15_Unwind_Context
22 .cfi_lsda 16, CallWithEHFrame_exception_table
26 .cfi_def_cfa_offset 16
29 .cfi_def_cfa_register %rbp
31 // Load the function pointer from the block descriptor.
34 // Execute the block in the context of a C++ try{}.
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.
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.
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
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.
65 CS1_begin = Ltry_start - Lfunction_start
67 CS1_end = Ltry_end - Ltry_start
71 LP1 = Lcatch - Lfunction_start
73 .byte 1 // Action record.
76 CS2_begin = Ltry_end - Lfunction_start
78 CS2_end = Lfunction_end - Ltry_end
81 // Second landing pad (none).
86 .byte 1 // Action record 1.
87 .byte 0 // No further action to take.
88 .long 0 // No type filter for this catch(){} clause.