Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

eliminate deprecated :unique_reg PIR value flag

  • Loading branch information...
commit 141396064957ccd57730f1eacf13561b7ec0efe4 1 parent 7ee8fd9
@plobsing plobsing authored
View
1  compilers/imcc/imcc.l
@@ -327,7 +327,6 @@ SP [ ]
<emit,INITIAL>":lex" return NEED_LEX;
<emit,INITIAL>":vtable" return VTABLE_METHOD;
<emit,INITIAL>":nsentry" return NS_ENTRY;
-":unique_reg" return UNIQUE_REG;
":instanceof" return SUB_INSTANCE_OF;
":subid" return SUBID;
View
12 compilers/imcc/imcc.y
@@ -1021,13 +1021,12 @@ do_loadlib(PARROT_INTERP, ARGIN(const char *lib))
%token <t> MAIN LOAD INIT IMMEDIATE POSTCOMP METHOD ANON OUTER NEED_LEX
%token <t> MULTI VTABLE_METHOD LOADLIB SUB_INSTANCE_OF SUBID
%token <t> NS_ENTRY
-%token <t> UNIQUE_REG
%token <s> LABEL
%token <t> EMIT EOM
%token <s> IREG NREG SREG PREG IDENTIFIER REG MACRO ENDM
%token <s> STRINGC INTC FLOATC USTRINGC
%token <s> PARROT_OP
-%type <t> type hll_def return_or_yield comma_or_goto opt_unique_reg
+%type <t> type hll_def return_or_yield comma_or_goto
%type <i> program
%type <i> class_namespace
%type <i> constdef sub emit pcc_ret pcc_yield
@@ -1639,7 +1638,6 @@ paramtype:
| ADV_NAMED { $$ = VT_NAMED; }
| ADV_NAMED '(' STRINGC ')' { adv_named_set(interp, $3); $$ = VT_NAMED; mem_sys_free($3); }
| ADV_NAMED '(' USTRINGC ')' { adv_named_set_u(interp, $3); $$ = VT_NAMED; mem_sys_free($3); }
- | UNIQUE_REG { $$ = 0; }
| ADV_CALL_SIG { $$ = VT_CALL_SIG; }
;
@@ -1827,7 +1825,7 @@ id_list :
;
id_list_id :
- IDENTIFIER opt_unique_reg
+ IDENTIFIER
{
IdList* const l = mem_gc_allocate_n_zeroed_typed(interp, 1, IdList);
l->id = $1;
@@ -1835,12 +1833,6 @@ id_list_id :
}
;
-opt_unique_reg:
- /* empty */
- | UNIQUE_REG
- ;
-
-
labeled_inst:
assignment
| conditional_statement
View
3,984 compilers/imcc/imclexer.c
1,977 additions, 2,007 deletions not shown
View
2,115 compilers/imcc/imcparser.c
1,046 additions, 1,069 deletions not shown
View
88 compilers/imcc/imcparser.h
@@ -142,28 +142,27 @@
SUB_INSTANCE_OF = 348,
SUBID = 349,
NS_ENTRY = 350,
- UNIQUE_REG = 351,
- LABEL = 352,
- EMIT = 353,
- EOM = 354,
- IREG = 355,
- NREG = 356,
- SREG = 357,
- PREG = 358,
- IDENTIFIER = 359,
- REG = 360,
- MACRO = 361,
- ENDM = 362,
- STRINGC = 363,
- INTC = 364,
- FLOATC = 365,
- USTRINGC = 366,
- PARROT_OP = 367,
- VAR = 368,
- LINECOMMENT = 369,
- FILECOMMENT = 370,
- DOT = 371,
- CONCAT = 372
+ LABEL = 351,
+ EMIT = 352,
+ EOM = 353,
+ IREG = 354,
+ NREG = 355,
+ SREG = 356,
+ PREG = 357,
+ IDENTIFIER = 358,
+ REG = 359,
+ MACRO = 360,
+ ENDM = 361,
+ STRINGC = 362,
+ INTC = 363,
+ FLOATC = 364,
+ USTRINGC = 365,
+ PARROT_OP = 366,
+ VAR = 367,
+ LINECOMMENT = 368,
+ FILECOMMENT = 369,
+ DOT = 370,
+ CONCAT = 371
};
#endif
/* Tokens. */
@@ -260,28 +259,27 @@
#define SUB_INSTANCE_OF 348
#define SUBID 349
#define NS_ENTRY 350
-#define UNIQUE_REG 351
-#define LABEL 352
-#define EMIT 353
-#define EOM 354
-#define IREG 355
-#define NREG 356
-#define SREG 357
-#define PREG 358
-#define IDENTIFIER 359
-#define REG 360
-#define MACRO 361
-#define ENDM 362
-#define STRINGC 363
-#define INTC 364
-#define FLOATC 365
-#define USTRINGC 366
-#define PARROT_OP 367
-#define VAR 368
-#define LINECOMMENT 369
-#define FILECOMMENT 370
-#define DOT 371
-#define CONCAT 372
+#define LABEL 351
+#define EMIT 352
+#define EOM 353
+#define IREG 354
+#define NREG 355
+#define SREG 356
+#define PREG 357
+#define IDENTIFIER 358
+#define REG 359
+#define MACRO 360
+#define ENDM 361
+#define STRINGC 362
+#define INTC 363
+#define FLOATC 364
+#define USTRINGC 365
+#define PARROT_OP 366
+#define VAR 367
+#define LINECOMMENT 368
+#define FILECOMMENT 369
+#define DOT 370
+#define CONCAT 371
@@ -302,7 +300,7 @@ typedef union YYSTYPE
/* Line 1685 of yacc.c */
-#line 295 "compilers/imcc/imcparser.h"
+#line 293 "compilers/imcc/imcparser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
View
1  compilers/imcc/main.c
@@ -332,7 +332,6 @@ do_pre_process(PARROT_INTERP, yyscan_t yyscanner)
case NEED_LEX: printf(":lex");break;
case METHOD: printf(":method");break;
- case UNIQUE_REG: printf(":unique_reg");break;
case ADV_FLAT: printf(":flat");break;
case ADV_SLURPY: printf(":slurpy");break;
case ADV_OPTIONAL: printf(":optional");break;
View
28 compilers/pge/PGE/Exp.pir
@@ -172,11 +172,11 @@ tree as a PIR code object that can be compiled.
.return (mob)
.end
.sub '' :subid(%2)
- .param pmc mob :unique_reg
- .param pmc adverbs :unique_reg
- .local string target :unique_reg
- .local pmc mfrom, mpos :unique_reg
- .local int cpos, iscont :unique_reg
+ .param pmc mob
+ .param pmc adverbs
+ .local string target
+ .local pmc mfrom, mpos
+ .local int cpos, iscont
$P0 = get_hll_global ['PGE'], '$!MATCH'
(mob, cpos, target, mfrom, mpos, iscont) = $P0.'new'(mob, adverbs :flat :named)
$P0 = interpinfo %3
@@ -192,11 +192,11 @@ tree as a PIR code object that can be compiled.
returnop = '.return'
code.'emit'(<<" CODE", name, pirflags)
.sub %0 :method :nsentry %1
- .param pmc adverbs :unique_reg :slurpy :named
+ .param pmc adverbs :slurpy :named
.local pmc mob
- .local string target :unique_reg
- .local pmc mfrom, mpos :unique_reg
- .local int cpos, iscont :unique_reg
+ .local string target
+ .local pmc mfrom, mpos
+ .local int cpos, iscont
$P0 = get_hll_global ['PGE'], '$!MATCH'
(mob, cpos, target, mfrom, mpos, iscont) = $P0.'new'(self, adverbs :flat :named)
.local int lastpos
@@ -208,28 +208,28 @@ tree as a PIR code object that can be compiled.
## generate the ustack only if we need it
.local string expstr
expstr = expcode
- code.'emit'(" .local pmc cstack :unique_reg")
+ code.'emit'(" .local pmc cstack")
code.'emit'(" cstack = root_new ['parrot';'ResizableIntegerArray']")
$I0 = index expstr, 'ustack'
if $I0 < 0 goto code_body_1
- code.'emit'(" .local pmc ustack :unique_reg")
+ code.'emit'(" .local pmc ustack")
code.'emit'(" ustack = root_new ['parrot';'ResizablePMCArray']")
code_body_1:
## generate the gpad only if we need it
$I0 = index expstr, 'gpad'
if $I0 < 0 goto code_body_2
- code.'emit'(" .local pmc gpad :unique_reg")
+ code.'emit'(" .local pmc gpad")
code.'emit'(" gpad = root_new ['parrot';'ResizablePMCArray']")
code_body_2:
## set the captscope if we need it
$I0 = index expstr, 'captscope'
if $I0 < 0 goto code_body_3
- code.'emit'(" .local pmc captscope, captob :unique_reg")
+ code.'emit'(" .local pmc captscope, captob")
code.'emit'(" captscope = mob")
code_body_3:
code.'emit'(<<" CODE", PGE_CUT_RULE, returnop)
- .local int pos, rep, cutmark :unique_reg
+ .local int pos, rep, cutmark
try_match:
if cpos > lastpos goto fail_rule
mfrom = cpos
View
23 docs/pdds/pdd19_pir.pod
@@ -229,7 +229,7 @@ C<0x> and C<0b> denote hex and binary constants respectively.
=over 4
-=item .local <type> <identifier> [:unique_reg]
+=item .local <type> <identifier>
Define a local name I<identifier> within a subroutine with the given
I<type>. You can define multiple identifiers of the same type by
@@ -237,25 +237,6 @@ separating them with commas:
.local int i, j
-The optional C<:unique_reg> modifier will force the register allocator to
-associate the identifier with a unique register for the duration of the
-subroutine. If the register allocator is thought of as an optimization
-tool for allowing fewer registers to be used in a register frame by reusing
-unused registers, then the C<:unique_reg> directive forces this
-optimization to be turned off. This can be important in a number of
-situations:
-
-=over 4
-
-=item * When a subroutine has a small fixed number of registers
-
-=item * When a named variable or named register is used throughout the entire
-subroutine
-
-=item * When a reference needs to be made to a register
-
-=back
-
=item .lex <string constant>, <reg>
Declare a lexical variable that is an alias for a PMC register. For example,
@@ -659,7 +640,7 @@ C<:optional>, and C<:opt_flag>.
At the top of a subroutine, declare a local variable, in the manner
of C<.local>, into which parameter(s) of the current subroutine should
be stored. Available modifiers: C<:slurpy>, C<:named>, C<:optional>,
-C<:opt_flag> and C<:unique_reg>.
+C<:opt_flag>.
=back
View
2  editor/pir-mode.el
@@ -223,7 +223,7 @@ newline or semicolon after an end keyword."
(defvar pir-directives
'(":anon" ":flat" ":init" ":lex" ":subid" ":load" ":main" ":method" ":multi"
":named" ":opt_count" ":opt_flag" ":optional" ":outer" ":postcomp"
- ":slurpy" ":unique_reg" ":vtable" ":wrap"))
+ ":slurpy" ":vtable" ":wrap"))
(defvar pir-dotted-directives
'(".HLL" ".arg" ".const" ".constant" ".emit" ".end" ".endm"
View
23 t/compilers/imcc/reg/alloc.t
@@ -4,7 +4,7 @@
use strict;
use warnings;
use lib qw( . lib ../lib ../../lib );
-use Parrot::Test tests => 11;
+use Parrot::Test tests => 10;
pir_output_is( <<'CODE', <<'OUT', "alligator" );
# if the side-effect of set_addr/continuation isn't
@@ -62,27 +62,6 @@ abc
def
OUT
-pir_2_pasm_is( <<'CODE', <<'OUT', ":unique_reg" );
-.sub main
- .param int i :unique_reg
- .local int j :unique_reg
- .local int k :unique_reg
- i = 5
- j = 2
- k = j * 2
-.end
-CODE
-# IMCC does produce b0rken PASM files
-# see http://guest@rt.perl.org/rt3/Ticket/Display.html?id=32392
-main:
- get_params
- set I0, 5
- set I1, 2
- mul I2, I1, 2
- set_returns
- returncc
-OUT
-
pir_output_is( <<'CODE', <<'OUT', "Explicit large register: S, PIR" );
.sub main
$S32 = "ok\n"
Please sign in to comment.
Something went wrong with that request. Please try again.