Skip to content

Commit

Permalink
[ops] replace HALT() with equivalent code, remove ops2c code dealing …
Browse files Browse the repository at this point in the history
…with HALT

git-svn-id: https://svn.parrot.org/parrot/trunk@44579 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
cotto committed Mar 2, 2010
1 parent 8cee09f commit 3f2802c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
9 changes: 0 additions & 9 deletions lib/Parrot/OpsFile.pm
Expand Up @@ -130,11 +130,6 @@ Transforms to C<X>, an absolute address.
Transforms to C<S>, the size of an op.
=item C<HALT()>
Transforms to C<PC' = 0>. Halts run loop, and resets the current
position to the start of the Parrot code, without resuming.
=item C<restart OFFSET(X)>
Transforms to C<PC' = 0> and restarts at C<PC + X>.
Expand Down Expand Up @@ -501,8 +496,6 @@ END_CODE
# expr ADDRESS(X) {{^X}} X Absolute address
# OP_SIZE {{^S}} S op size
#
# HALT() {{=0}} PC' = 0 Halts run_ops loop, no resume
#
# restart OFFSET(X) {{=0,+=X}} PC' = 0 Restarts at PC + X
# restart NEXT() {{=0,+=S}} PC' = 0 Restarts at PC + S
#
Expand Down Expand Up @@ -535,7 +528,6 @@ END_CODE
$next ||= $body =~ s/\bexpr\s+NEXT\(\)/{{^+$op_size}}/mg;
$body =~ s/\bgoto\s+NEXT\(\)/{{+=$op_size}}/mg;

$body =~ s/\bHALT\(\)/{{=0}}/mg;
$body =~ s/\bOP_SIZE\b/{{^$op_size}}/mg;

if ( $body =~ s/\brestart\s+OFFSET\((.*?)\)/{{=0,+=$1}}/mg ) {
Expand Down Expand Up @@ -663,7 +655,6 @@ sub preamble {

#s/goto\s+NEXT\(\)/{{+=$op_size}}/mg; #not supported--dependent on op size
s/goto\s+ADDRESS\((.*)\)/{{=$1}}/mg;
s/HALT\(\)/{{=0}}/mg;

$_ = Parrot::Op->rewrite_body( $_, $trans, 'preamble' );
}
Expand Down
2 changes: 1 addition & 1 deletion src/ops/core.ops
Expand Up @@ -52,7 +52,7 @@ Halts the interpreter. (Must be op #0, CORE_OPS_end). See also B<exit>.
=cut

inline op end() :base_core :check_event :flow {
HALT();
goto ADDRESS(0);
}


Expand Down

0 comments on commit 3f2802c

Please sign in to comment.