annotate libcilkrts/runtime/except.h @ 143:76e1cf5455ef

add cbc_gc test
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 19:24:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* except.h -*-C++-*-
kono
parents:
diff changeset
2 *
kono
parents:
diff changeset
3 *************************************************************************
kono
parents:
diff changeset
4 *
kono
parents:
diff changeset
5 * Copyright (C) 2009-2016, Intel Corporation
kono
parents:
diff changeset
6 * All rights reserved.
kono
parents:
diff changeset
7 *
kono
parents:
diff changeset
8 * Redistribution and use in source and binary forms, with or without
kono
parents:
diff changeset
9 * modification, are permitted provided that the following conditions
kono
parents:
diff changeset
10 * are met:
kono
parents:
diff changeset
11 *
kono
parents:
diff changeset
12 * * Redistributions of source code must retain the above copyright
kono
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer.
kono
parents:
diff changeset
14 * * Redistributions in binary form must reproduce the above copyright
kono
parents:
diff changeset
15 * notice, this list of conditions and the following disclaimer in
kono
parents:
diff changeset
16 * the documentation and/or other materials provided with the
kono
parents:
diff changeset
17 * distribution.
kono
parents:
diff changeset
18 * * Neither the name of Intel Corporation nor the names of its
kono
parents:
diff changeset
19 * contributors may be used to endorse or promote products derived
kono
parents:
diff changeset
20 * from this software without specific prior written permission.
kono
parents:
diff changeset
21 *
kono
parents:
diff changeset
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
kono
parents:
diff changeset
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
kono
parents:
diff changeset
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
kono
parents:
diff changeset
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
kono
parents:
diff changeset
26 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
kono
parents:
diff changeset
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
kono
parents:
diff changeset
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
kono
parents:
diff changeset
29 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
kono
parents:
diff changeset
30 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
kono
parents:
diff changeset
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
kono
parents:
diff changeset
32 * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
kono
parents:
diff changeset
33 * POSSIBILITY OF SUCH DAMAGE.
kono
parents:
diff changeset
34 *
kono
parents:
diff changeset
35 * *********************************************************************
kono
parents:
diff changeset
36 *
kono
parents:
diff changeset
37 * PLEASE NOTE: This file is a downstream copy of a file mainitained in
kono
parents:
diff changeset
38 * a repository at cilkplus.org. Changes made to this file that are not
kono
parents:
diff changeset
39 * submitted through the contribution process detailed at
kono
parents:
diff changeset
40 * http://www.cilkplus.org/submit-cilk-contribution will be lost the next
kono
parents:
diff changeset
41 * time that a new version is released. Changes only submitted to the
kono
parents:
diff changeset
42 * GNU compiler collection or posted to the git repository at
kono
parents:
diff changeset
43 * https://bitbucket.org/intelcilkruntime/intel-cilk-runtime.git are
kono
parents:
diff changeset
44 * not tracked.
kono
parents:
diff changeset
45 *
kono
parents:
diff changeset
46 * We welcome your contributions to this open source project. Thank you
kono
parents:
diff changeset
47 * for your assistance in helping us improve Cilk Plus.
kono
parents:
diff changeset
48 **************************************************************************/
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 /**
kono
parents:
diff changeset
51 * @file except.h
kono
parents:
diff changeset
52 *
kono
parents:
diff changeset
53 * @brief Common definitions for the various implementations of exception
kono
parents:
diff changeset
54 * handling.
kono
parents:
diff changeset
55 */
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 #ifndef INCLUDED_EXCEPT_DOT_H
kono
parents:
diff changeset
58 #define INCLUDED_EXCEPT_DOT_H
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 #include <cilk/common.h>
kono
parents:
diff changeset
61 #include <internal/abi.h>
kono
parents:
diff changeset
62 #include "full_frame.h"
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 __CILKRTS_BEGIN_EXTERN_C
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 /**
kono
parents:
diff changeset
67 * OS-dependent information about an exception that's being moved between
kono
parents:
diff changeset
68 * strands.
kono
parents:
diff changeset
69 */
kono
parents:
diff changeset
70 typedef struct pending_exception_info pending_exception_info;
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 /**
kono
parents:
diff changeset
73 * Merge the right exception record into the left. The left is logically
kono
parents:
diff changeset
74 * earlier.
kono
parents:
diff changeset
75 *
kono
parents:
diff changeset
76 * On entry the left state is synched and can not have an unresolved
kono
parents:
diff changeset
77 * exception. The merge may result in an unresolved exception.
kono
parents:
diff changeset
78 *
kono
parents:
diff changeset
79 * If there is both a right and left exception, the right exception will
kono
parents:
diff changeset
80 * be disposed of in preference to the left exception, destructing the
kono
parents:
diff changeset
81 * exception object.
kono
parents:
diff changeset
82 *
kono
parents:
diff changeset
83 * @param w The worker that is preparing to resume execution.
kono
parents:
diff changeset
84 * @param left_exception The exception that would have happened earlier
kono
parents:
diff changeset
85 * if the code executed serially. Can be NULL if the left strand has not
kono
parents:
diff changeset
86 * raised an exception.
kono
parents:
diff changeset
87 * @param right_exception The exception that would have happened later
kono
parents:
diff changeset
88 * if the code executed serially. Can be NULL if the right strand has not
kono
parents:
diff changeset
89 * raised an exception.
kono
parents:
diff changeset
90 *
kono
parents:
diff changeset
91 * @return NULL if there both the right and left exception are NULL. This
kono
parents:
diff changeset
92 * indicates that there are no pending exceptions.
kono
parents:
diff changeset
93 * @return The pending exception that is to be raised to continue searching
kono
parents:
diff changeset
94 * for a catch block to handle the exception.
kono
parents:
diff changeset
95 */
kono
parents:
diff changeset
96 COMMON_SYSDEP
kono
parents:
diff changeset
97 struct pending_exception_info *__cilkrts_merge_pending_exceptions(
kono
parents:
diff changeset
98 __cilkrts_worker *w,
kono
parents:
diff changeset
99 pending_exception_info *left_exception,
kono
parents:
diff changeset
100 pending_exception_info *right_exception);
kono
parents:
diff changeset
101
kono
parents:
diff changeset
102 /**
kono
parents:
diff changeset
103 * Move the exception information from the worker to the full_frame.
kono
parents:
diff changeset
104 *
kono
parents:
diff changeset
105 * @param w The worker which is suspending work on a full_frame.
kono
parents:
diff changeset
106 * @param ff The full_frame which is being suspended.
kono
parents:
diff changeset
107 */
kono
parents:
diff changeset
108 COMMON_SYSDEP
kono
parents:
diff changeset
109 void __cilkrts_save_exception_state(__cilkrts_worker *w,
kono
parents:
diff changeset
110 full_frame *ff);
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 /**
kono
parents:
diff changeset
113 * Function to delete pending exception. This will delete the
kono
parents:
diff changeset
114 * exception object and then free the stack/fiber.
kono
parents:
diff changeset
115 *
kono
parents:
diff changeset
116 * @param w The worker we're running on.
kono
parents:
diff changeset
117 * @param pei The pending exception to be delete
kono
parents:
diff changeset
118 * @param delete_object Unused. Should always be 1.
kono
parents:
diff changeset
119 */
kono
parents:
diff changeset
120 void delete_exception_obj (__cilkrts_worker *w,
kono
parents:
diff changeset
121 struct pending_exception_info *pei,
kono
parents:
diff changeset
122 int delete_object);
kono
parents:
diff changeset
123
kono
parents:
diff changeset
124 #ifndef _WIN32
kono
parents:
diff changeset
125 /* gcc-style exception handling */
kono
parents:
diff changeset
126 NON_COMMON NORETURN __cilkrts_c_sync_except(__cilkrts_worker *w,
kono
parents:
diff changeset
127 __cilkrts_stack_frame *sf);
kono
parents:
diff changeset
128 NON_COMMON void __attribute__((nonnull))
kono
parents:
diff changeset
129 __cilkrts_gcc_rethrow(__cilkrts_stack_frame *sf);
kono
parents:
diff changeset
130 #endif
kono
parents:
diff changeset
131
kono
parents:
diff changeset
132 __CILKRTS_END_EXTERN_C
kono
parents:
diff changeset
133
kono
parents:
diff changeset
134 #endif // ! defined(INCLUDED_EXCEPT_DOT_H)