Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add new control exception types for JVM.
To support new async features in Perl 6.
  • Loading branch information
jnthn committed Aug 18, 2015
1 parent 733bf22 commit 87d8a61
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/vm/jvm/QAST/Compiler.nqp
Expand Up @@ -78,9 +78,13 @@ my $EX_CAT_TAKE := 32;
my $EX_CAT_WARN := 64;
my $EX_CAT_SUCCEED := 128;
my $EX_CAT_PROCEED := 256;
my $EX_CAT_AWAIT := 8192;
my $EX_CAT_EMIT := 16384;
my $EX_CAT_DONE := 32768;
my $EX_CAT_CONTROL := $EX_CAT_NEXT +| $EX_CAT_REDO +| $EX_CAT_LAST +|
$EX_CAT_TAKE +| $EX_CAT_WARN +|
$EX_CAT_SUCCEED +| $EX_CAT_PROCEED;
$EX_CAT_SUCCEED +| $EX_CAT_PROCEED +|
$EX_CAT_AWIAT +| $EX_CAT_EMIT +| $EX_CAT_DONE;

This comment has been minimized.

Copy link
@coke

coke Aug 19, 2015

Contributor

Typo on AWAIT?

my $EX_CAT_LABELED := 4096;

# Exception handler kinds.
Expand Down Expand Up @@ -1614,6 +1618,9 @@ my %handler_names := nqp::hash(
'WARN', $EX_CAT_WARN,
'PROCEED', $EX_CAT_PROCEED,
'SUCCEED', $EX_CAT_SUCCEED,
'AWAIT', $EX_CAT_AWAIT,
'EMIT', $EX_CAT_EMIT,
'DONE', $EX_CAT_DONE,
);
QAST::OperationsJAST.add_core_op('handle', :!inlinable, sub ($qastcomp, $op) {
my @children := nqp::clone($op.list());
Expand Down Expand Up @@ -1969,6 +1976,9 @@ my %const_map := nqp::hash(
'CONTROL_PROCEED', 256,
'CONTROL_WARN', 64,
'CONTROL_LABELED', 4096,
'CONTROL_AWAIT', 8192,
'CONTROL_EMIT', 16384,
'CONTROL_DONE', 32768,

'STAT_EXISTS', 0,
'STAT_FILESIZE', 1,
Expand Down
Expand Up @@ -19,6 +19,9 @@ public class ExceptionHandling {
public static final int EX_CAT_WARN = 64;
public static final int EX_CAT_SUCCEED = 128;
public static final int EX_CAT_LABELED = 4096;
public static final int EX_CAT_AWAIT = 8192;
public static final int EX_CAT_EMIT = 16384;
public static final int EX_CAT_DONE = 32768;

/* Exception handler kinds. */
public static final int EX_UNWIND_SIMPLE = 0;
Expand Down

0 comments on commit 87d8a61

Please sign in to comment.