1
1
/*
2
- * Copyright (c) 2017, 2023 , Oracle and/or its affiliates.
2
+ * Copyright (c) 2017, 2024 , Oracle and/or its affiliates.
3
3
* Copyright (c) 2013, Regents of the University of California
4
4
*
5
5
* All rights reserved.
@@ -117,7 +117,7 @@ static void setCause(VirtualFrame frame, Object exception, Object causeClass,
117
117
// raise * from <invalid>
118
118
@ Specialization (guards = {"!check.execute(inliningTarget, cause)" , "!isTypeNode.execute(inliningTarget, cause)" }, limit = "1" )
119
119
static void setCause (@ SuppressWarnings ("unused" ) VirtualFrame frame , @ SuppressWarnings ("unused" ) Object exception , @ SuppressWarnings ("unused" ) Object cause ,
120
- @ Bind ("this" ) Node inliningTarget ,
120
+ @ SuppressWarnings ( "unused" ) @ Bind ("this" ) Node inliningTarget ,
121
121
@ Exclusive @ SuppressWarnings ("unused" ) @ Cached TypeNodes .IsTypeNode isTypeNode ,
122
122
@ SuppressWarnings ("unused" ) @ Exclusive @ Cached PyExceptionInstanceCheckNode check ,
123
123
@ Cached PRaiseNode raise ) {
@@ -127,7 +127,7 @@ static void setCause(@SuppressWarnings("unused") VirtualFrame frame, @SuppressWa
127
127
128
128
// raise
129
129
@ Specialization (guards = "isNoValue(type)" )
130
- static void reraise (VirtualFrame frame , @ SuppressWarnings ("unused" ) PNone type , @ SuppressWarnings ("unused" ) Object cause , boolean rootNodeVisible ,
130
+ public static void reraise (VirtualFrame frame , @ SuppressWarnings ("unused" ) PNone type , @ SuppressWarnings ("unused" ) Object cause , boolean rootNodeVisible ,
131
131
@ Bind ("this" ) Node inliningTarget ,
132
132
@ Exclusive @ Cached PRaiseNode .Lazy raise ,
133
133
@ Exclusive @ Cached GetCaughtExceptionNode getCaughtExceptionNode ,
@@ -141,35 +141,37 @@ static void reraise(VirtualFrame frame, @SuppressWarnings("unused") PNone type,
141
141
142
142
// raise <exception>
143
143
@ Specialization (guards = "isNoValue(cause)" )
144
- void doRaise (@ SuppressWarnings ("unused" ) VirtualFrame frame , PBaseException exception , @ SuppressWarnings ("unused" ) PNone cause , @ SuppressWarnings ("unused" ) boolean rootNodeVisible ) {
145
- throw PRaiseNode .raiseExceptionObject (this , exception );
144
+ public static void doRaise (@ SuppressWarnings ("unused" ) VirtualFrame frame , PBaseException exception , @ SuppressWarnings ("unused" ) PNone cause , @ SuppressWarnings ("unused" ) boolean rootNodeVisible ,
145
+ @ Bind ("this" ) Node inliningTarget ) {
146
+ throw PRaiseNode .raiseExceptionObject (inliningTarget , exception );
146
147
}
147
148
148
149
// raise <native-exception>
149
150
@ Specialization (guards = {"check.execute(inliningTarget, exception)" , "isNoValue(cause)" })
150
- void doRaiseNative (@ SuppressWarnings ("unused" ) VirtualFrame frame , PythonAbstractNativeObject exception , @ SuppressWarnings ("unused" ) PNone cause ,
151
+ public static void doRaiseNative (@ SuppressWarnings ("unused" ) VirtualFrame frame , PythonAbstractNativeObject exception , @ SuppressWarnings ("unused" ) PNone cause ,
151
152
@ SuppressWarnings ("unused" ) boolean rootNodeVisible ,
152
- @ SuppressWarnings ( "unused" ) @ Bind ("this" ) Node inliningTarget ,
153
+ @ Bind ("this" ) Node inliningTarget ,
153
154
@ SuppressWarnings ("unused" ) @ Shared @ Cached PyExceptionInstanceCheckNode check ) {
154
- throw PRaiseNode .raiseExceptionObject (this , exception );
155
+ throw PRaiseNode .raiseExceptionObject (inliningTarget , exception );
155
156
}
156
157
157
158
// raise <exception> from *
158
159
@ Specialization (guards = "!isNoValue(cause)" )
159
- void doRaise (@ SuppressWarnings ("unused" ) VirtualFrame frame , PBaseException exception , Object cause , @ SuppressWarnings ("unused" ) boolean rootNodeVisible ,
160
+ public static void doRaise (@ SuppressWarnings ("unused" ) VirtualFrame frame , PBaseException exception , Object cause , @ SuppressWarnings ("unused" ) boolean rootNodeVisible ,
161
+ @ Bind ("this" ) Node inliningTarget ,
160
162
@ Shared @ Cached SetExceptionCauseNode setExceptionCauseNode ) {
161
163
setExceptionCauseNode .execute (frame , exception , cause );
162
- throw PRaiseNode .raiseExceptionObject (this , exception );
164
+ throw PRaiseNode .raiseExceptionObject (inliningTarget , exception );
163
165
}
164
166
165
167
// raise <native-exception> from *
166
168
@ Specialization (guards = {"check.execute(inliningTarget, exception)" , "!isNoValue(cause)" })
167
- void doRaiseNative (@ SuppressWarnings ("unused" ) VirtualFrame frame , PythonAbstractNativeObject exception , Object cause , @ SuppressWarnings ("unused" ) boolean rootNodeVisible ,
168
- @ SuppressWarnings ( "unused" ) @ Bind ("this" ) Node inliningTarget ,
169
+ public static void doRaiseNative (@ SuppressWarnings ("unused" ) VirtualFrame frame , PythonAbstractNativeObject exception , Object cause , @ SuppressWarnings ("unused" ) boolean rootNodeVisible ,
170
+ @ Bind ("this" ) Node inliningTarget ,
169
171
@ SuppressWarnings ("unused" ) @ Shared @ Cached PyExceptionInstanceCheckNode check ,
170
172
@ Shared @ Cached SetExceptionCauseNode setExceptionCauseNode ) {
171
173
setExceptionCauseNode .execute (frame , exception , cause );
172
- throw PRaiseNode .raiseExceptionObject (this , exception );
174
+ throw PRaiseNode .raiseExceptionObject (inliningTarget , exception );
173
175
}
174
176
175
177
private static void checkBaseClass (VirtualFrame frame , Node inliningTarget , Object pythonClass , ValidExceptionNode validException , PRaiseNode .Lazy raise ,
@@ -182,7 +184,7 @@ private static void checkBaseClass(VirtualFrame frame, Node inliningTarget, Obje
182
184
183
185
// raise <class>
184
186
@ Specialization (guards = {"isTypeNode.execute(this, pythonClass)" , "isNoValue(cause)" }, limit = "1" )
185
- static void doRaise (@ SuppressWarnings ("unused" ) VirtualFrame frame , Object pythonClass , @ SuppressWarnings ("unused" ) PNone cause , @ SuppressWarnings ("unused" ) boolean rootNodeVisible ,
187
+ public static void doRaise (@ SuppressWarnings ("unused" ) VirtualFrame frame , Object pythonClass , @ SuppressWarnings ("unused" ) PNone cause , @ SuppressWarnings ("unused" ) boolean rootNodeVisible ,
186
188
@ Bind ("this" ) Node inliningTarget ,
187
189
@ Exclusive @ SuppressWarnings ("unused" ) @ Cached TypeNodes .IsTypeNode isTypeNode ,
188
190
@ Exclusive @ Cached ValidExceptionNode validException ,
@@ -201,7 +203,7 @@ static void doRaise(@SuppressWarnings("unused") VirtualFrame frame, Object pytho
201
203
202
204
// raise <class> from *
203
205
@ Specialization (guards = {"isTypeNode.execute(this, pythonClass)" , "!isNoValue(cause)" }, limit = "1" )
204
- static void doRaise (@ SuppressWarnings ("unused" ) VirtualFrame frame , Object pythonClass , Object cause , @ SuppressWarnings ("unused" ) boolean rootNodeVisible ,
206
+ public static void doRaise (@ SuppressWarnings ("unused" ) VirtualFrame frame , Object pythonClass , Object cause , @ SuppressWarnings ("unused" ) boolean rootNodeVisible ,
205
207
@ Bind ("this" ) Node inliningTarget ,
206
208
@ Exclusive @ SuppressWarnings ("unused" ) @ Cached TypeNodes .IsTypeNode isTypeNode ,
207
209
@ Exclusive @ Cached ValidExceptionNode validException ,
@@ -223,7 +225,7 @@ static void doRaise(@SuppressWarnings("unused") VirtualFrame frame, Object pytho
223
225
// raise <invalid> [from *]
224
226
@ Fallback
225
227
@ SuppressWarnings ("unused" )
226
- static void doRaise (VirtualFrame frame , Object exception , Object cause , @ SuppressWarnings ("unused" ) boolean rootNodeVisible ,
228
+ public static void doRaise (VirtualFrame frame , Object exception , Object cause , @ SuppressWarnings ("unused" ) boolean rootNodeVisible ,
227
229
@ Bind ("this" ) Node inliningTarget ,
228
230
@ CachedLibrary (limit = "1" ) InteropLibrary lib ,
229
231
@ Exclusive @ Cached PRaiseNode .Lazy raise ) {
0 commit comments