Skip to content

Commit 7f8b9c5

Browse files
committed
Make ThrowData ValueType
1 parent 0d0f081 commit 7f8b9c5

File tree

1 file changed

+8
-0
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/generator

1 file changed

+8
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/generator/ThrowData.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,15 @@
4141
package com.oracle.graal.python.builtins.objects.generator;
4242

4343
import com.oracle.graal.python.builtins.objects.exception.PBaseException;
44+
import com.oracle.truffle.api.CompilerDirectives.ValueType;
4445

46+
/**
47+
* Simple wrapper to pass a {@link PBaseException} between {@code throw} method and the
48+
* {@code yield} expression that will continue the control flow. The wrapper is needed because the
49+
* same frame slot is used to pass value from {@code send}, so the exception for {@code throw} needs
50+
* to be wrapped in something that is not a Python object to be able to distinguish the two cases.
51+
*/
52+
@ValueType
4553
public final class ThrowData {
4654
public final PBaseException pythonException;
4755
public final boolean withJavaStacktrace;

0 commit comments

Comments
 (0)