Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[imcc] enable -O[12p] options again

Rename imcc_set_debug_api() to imcc_set_flags_api() to set
verbosity, debug flags and optimizer flags at once.

Remove unused internal imcc->IMCC_DEBUG flags.

-v prints now also the optimizer_level.

Document internal imcc_set_verbosity() as unused.

Makefile: add testOp, disable testexec (unused)

Add missing documentation to docs/running.pod and docs/binaries/parrot.pod
which is essentially the same. docs/running.pod should include more high-level
info. Remove gcdebug runcore documentation (unused).

Fix enabling parrot --imcc-debug flags.

Add Parrot_imcc_dflags and Parrot_imcc_opt_flags enums to include/imcc/api.h
for the frontends.

Mark t/op/calling.t test 63 as failing with -O1. (TODO)
This is a bad test, assuming an unoptimized layout.
  • Loading branch information...
commit 4758059e51c985b95f80ca6c035dfa5f4a1def98 1 parent 4d02cc7
@rurban rurban authored
View
19 compilers/imcc/api.c
@@ -205,8 +205,11 @@ imcc_preprocess_file_api(Parrot_PMC interp_pmc, Parrot_PMC compiler,
/*
-=item C<Parrot_Int imcc_set_debug_api(Parrot_PMC interp_pmc, Parrot_PMC
-compiler, Parrot_Int imccflags)>
+=item C<Parrot_Int imcc_set_flags_api(Parrot_PMC interp_pmc, Parrot_PMC
+compiler, Parrot_Int debug, Parrot_Int opt)>
+
+Public interface to imcc_set_verbosity, imcc_set_optimization_level and
+imcc_set_debug_mode. Overwrites the imcc flags.
=cut
@@ -215,17 +218,17 @@ compiler, Parrot_Int imccflags)>
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
Parrot_Int
-imcc_set_debug_api(Parrot_PMC interp_pmc, Parrot_PMC compiler,
- Parrot_Int imccflags)
+imcc_set_flags_api(Parrot_PMC interp_pmc, Parrot_PMC compiler,
+ Parrot_Int debug, Parrot_Int opt)
{
- ASSERT_ARGS(imcc_set_debug_api)
+ ASSERT_ARGS(imcc_set_flags_api)
IMCC_API_CALLIN(interp_pmc, interp)
imc_info_t * imcc = (imc_info_t *)VTABLE_get_pointer(interp, compiler);
- if (imccflags & PARROT_IMCC_VERBOSE)
+ if (debug & PARROT_IMCC_VERBOSE)
imcc_set_verbosity(imcc, 1);
- /* >> 16 translates public PARROT_IMCC_* flags to internal imcc->debug flags. */
- imcc_set_debug_mode(imcc, imccflags >> 16, imccflags & PARROT_IMCC_PARSER);
+ imcc_set_debug_mode(imcc, debug, debug & PARROT_IMCC_DEBUG_PARSER); /* i.e. yydebug */
+ imcc->optimizer_level = opt;
IMCC_API_CALLOUT(interp_pmc, interp)
}
View
7 compilers/imcc/imc.h
@@ -385,11 +385,11 @@ SymReg* get_pasm_reg(ARGMOD(imc_info_t * imcc), ARGIN(const char *name))
typedef enum _enum_opt {
OPT_NONE,
- OPT_PRE,/* 0x001 */
+ OPT_PRE, /*0x001 */
OPT_CFG = 0x002,
OPT_SUB = 0x004,
- OPT_PASM = 0x100,
- OPT_J = 0x200
+ OPT_PASM = 0x100
+ /* OPT_J = 0x200 */
} enum_opt_t;
struct nodeType_t;
@@ -483,7 +483,6 @@ struct _imc_info_t {
AsmState asm_state;
SymHash ghash;
jmp_buf jump_buf; /* The jump for error handling */
- int IMCC_DEBUG;
int cnr;
int debug;
int dont_optimize;
View
3  compilers/imcc/imclexer.c
@@ -5061,7 +5061,8 @@ determine_input_file_type(ARGMOD(imc_info_t * imcc), ARGIN(STRING *sourcefile))
}
if (imcc->verbose) {
- IMCC_info(imcc, 1, "debug = 0x%x\n", imcc->debug);
+ IMCC_info(imcc, 1, "debug = 0x%x, optim = 0x%x\n", imcc->debug,
+ imcc->optimizer_level);
IMCC_info(imcc, 1, "Reading %Ss\n", sourcefile);
}
View
2  compilers/imcc/main.c
@@ -238,6 +238,8 @@ imcc_set_verbosity(ARGMOD(imc_info_t *imcc), INTVAL verbose)
Set the optimization level. C<opts> is a string with character code flags.
+Unused.
+
=cut
*/
View
12 config/gen/makefiles/root.in
@@ -2379,7 +2379,7 @@ testj : test_prep
testr : test_prep
$(PERL) t/harness $(EXTRA_TEST_ARGS) -r $(RUNCORE_TEST_FILES)
-# normal core, optimization level 1
+# normal core, optimization level 1 (one error)
testO1 : test_prep
$(PERL) t/harness $(EXTRA_TEST_ARGS) -O1 $(RUNCORE_TEST_FILES)
@@ -2387,9 +2387,13 @@ testO1 : test_prep
testO2 : test_prep
$(PERL) t/harness $(EXTRA_TEST_ARGS) -O2 $(RUNCORE_TEST_FILES)
-# test the EXEC stuff
-testexec: test_prep
- $(PERL) t/harness $(EXTRA_TEST_ARGS) --run-exec $(RUNCORE_TEST_FILES)
+# -Op: -O2 for PASM
+testOp : test_prep
+ $(PERL) t/harness $(EXTRA_TEST_ARGS) -Op $(RUNCORE_TEST_FILES)
+
+# test --run-exec
+#testexec: test_prep
+# $(PERL) t/harness $(EXTRA_TEST_ARGS) --run-exec $(RUNCORE_TEST_FILES)
# Test that need to be compiled by the C-compiler
src_tests : test_prep
View
34 docs/binaries/parrot.pod
@@ -70,12 +70,12 @@ information about these options, I<see> the "About runcores" section in F<docs/r
Select the runcore. The following cores are available in Parrot, but not all
may be available on your system:
- slow, bounds bounds checking core (default)
+ fast bare-bones core without bounds-checking or
+ context-updating (default)
- fast bare-bones core without bounds-checking or
- context-updating
+ slow, bounds bounds checking core
- trace bounds checking core with trace info
+ trace bounds checking core with trace info
(see 'parrot --help-debug')
profiling see F<docs/dev/profiling.pod>
@@ -185,6 +185,28 @@ number of OS threads. Minimum number: 2
=over 4
+=item B<-O>[level]
+
+Valid optimizer levels: C<-O>, C<-O1>, C<-O2>, C<-Op>
+
+-O1 enables the pre_optimizer, runs before control flow graph (CFG) is built.
+It includes strength reduction and rewrites certain if/branch/label constructs.
+
+-O2 runs afterwards, handles constant propagation, jump optimizations,
+removal of unused labels and dead code.
+
+-Op> applies -O2 to pasm files also.
+
+The old options -Op, -Oc and -Oj are currently ineffective.
+
+-O defaults to -O1.
+
+=item B<-d>[=HEXFLAGS]
+
+=item B<--imcc-debug>[=HEXFLAGS]
+
+Turn on compiler debug flags. I<See> C<parrot --help-debug> for available flag bits.
+
=item B<-E>
=item B<--pre-process-only>
@@ -229,6 +251,10 @@ primarily, for tests.
=item B<--yydebug> Turn on yydebug in F<yacc>/F<bison>.
+=item B<-v>
+
+=item B<--verbose> Turn on compiler verbosity.
+
=back
=head2 <file>
View
50 docs/running.pod
@@ -35,10 +35,30 @@ Turn on the I<--gc-debug> flag.
=head1 OPTIONS
-=head2 Assembler options
+=head2 Assembler/compiler options
=over 4
+=item -O[level]
+
+Valid optimizer levels: C<-O>, C<-O1>, C<-O2>, C<-Op>, C<-Oc>
+
+=item B<-O>[level]
+
+Valid optimizer levels: C<-O>, C<-O1>, C<-O2>
+
+C<-O1> enables the pre_optimizer, runs before control flow graph (CFG) is built.
+It includes strength reduction and rewrites certain if/branch/label constructs.
+
+C<-O2> runs afterwards, handles constant propagation, jump optimizations,
+removal of unused labels and dead code.
+
+C<-Op> applies C<-O2> to pasm files also.
+
+The old options C<-Oc> and C<-Oj> are currently ineffective.
+
+C<-O> defaults to C<-O1>.
+
=item -a, --pasm
Assume PASM input on stdin.
@@ -76,6 +96,16 @@ disc and run. This is mainly needed for tests.
Turn on yydebug in F<yacc>/F<bison>.
+=item -v, --verbose
+
+Turn on compiler verbosity.
+
+=item B<-d>[=HEXFLAGS]
+
+=item B<--imcc-debug>[=HEXFLAGS]
+
+Turn on compiler debug flags. I<See> C<parrot --help-debug> for available flag bits.
+
=item -V, --version
Print version information and exit.
@@ -101,12 +131,18 @@ debugging. See L<About runcores> for details.
Select the runcore. The following cores are available in Parrot, but not all
may be available on your system:
- slow, bounds bounds checking core (default)
- gcdebug performs a full GC run before every op dispatch (good for
- debugging GC problems)
+ fast bare-bones core without bounds-checking or
+ context-updating (default)
+
+ slow, bounds bounds checking core
+
trace bounds checking core w/ trace info (see 'parrot --help-debug')
+
profiling see F<docs/dev/profilling.pod>
+ subprof subroutine-level profiler
+ (see POD in F<src/runcore/subprof.c>)
+
The C<jit>, C<switch-jit>, and C<cgp-jit> options are currently aliases for the
C<fast>, C<switch>, and C<cgp> options, respectively. We do not recommend
their use in new code; they will continue working for existing code per our
@@ -203,7 +239,7 @@ no single runcore will perform optimally on all architectures (or even for all
problems on a given architecture), and partly because some of the runcores have
specific debugging and tracing capabilities.
-In the default "slow" runcore, each opcode is a separate C function.
+In the "slow" or "bounds" runcore, each opcode is a separate C function.
That's pretty easy in pseudocode:
slow_runcore( op ):
@@ -211,7 +247,7 @@ That's pretty easy in pseudocode:
op = op_function( op )
check_for_events()
-The GC debugging runcore is similar:
+The old GC debugging runcore was similar:
gcdebug_runcore( op ):
while ( op ):
@@ -250,6 +286,6 @@ full bounds checking, and also printing runtime information to stderr.
=head1 FILES
-F<main.c>
+F<frontend/parrot/main.c>
=cut
View
42 frontend/parrot/main.c
@@ -39,7 +39,8 @@ struct init_args_t {
Parrot_Int have_pasm_file;
Parrot_Int turn_gc_off;
Parrot_Int preprocess_only;
- Parrot_Int imccflags;
+ Parrot_Int imcc_dflags;
+ Parrot_Int imcc_opts;
};
extern int Parrot_set_config_hash(Parrot_PMC interp_pmc);
@@ -260,9 +261,10 @@ run_imcc(Parrot_PMC interp, Parrot_String sourcefile, ARGIN(struct init_args_t *
imcc_get_pasm_compreg_api(interp, 1, &pasm_compiler)))
show_last_error_and_exit(interp);
if (flags->preprocess_only) {
- if (flags->imccflags) {
- r = imcc_set_debug_api(interp, pir_compiler, flags->imccflags);
- if (!r) exit(EXIT_FAILURE);
+ if (flags->imcc_dflags || flags->imcc_opts) {
+ if (!imcc_set_flags_api(interp, pir_compiler, flags->imcc_dflags,
+ flags->imcc_opts))
+ exit(EXIT_FAILURE);
}
r = imcc_preprocess_file_api(interp, pir_compiler, sourcefile);
exit(r ? EXIT_SUCCESS : EXIT_FAILURE);
@@ -272,9 +274,9 @@ run_imcc(Parrot_PMC interp, Parrot_String sourcefile, ARGIN(struct init_args_t *
const Parrot_PMC compiler = pasm_mode ? pasm_compiler : pir_compiler;
Parrot_PMC pbc;
- if (flags->imccflags) {
- r = imcc_set_debug_api(interp, compiler, flags->imccflags);
- if (!r) exit(EXIT_FAILURE);
+ if (flags->imcc_dflags || flags->imcc_opts) {
+ if (!imcc_set_flags_api(interp, compiler, flags->imcc_dflags, flags->imcc_opts))
+ exit(EXIT_FAILURE);
}
if (!imcc_compile_file_api(interp, compiler, sourcefile, &pbc))
show_last_error_and_exit(interp);
@@ -758,7 +760,8 @@ parseflags(Parrot_PMC interp, int argc, ARGIN(const char *argv[]),
args->outfile = NULL;
args->sourcefile = NULL;
args->preprocess_only = 0;
- args->imccflags = 0;
+ args->imcc_dflags = 0;
+ args->imcc_opts = 0;
if (argc == 1) {
usage(stderr);
@@ -794,24 +797,25 @@ parseflags(Parrot_PMC interp, int argc, ARGIN(const char *argv[]),
break;
case 'd':
if (opt.opt_arg && is_all_hex_digits(opt.opt_arg))
- args->imccflags = (Parrot_Int)(strtoul(opt.opt_arg, NULL, 16) << 16);
+ args->imcc_dflags = (Parrot_Int)strtoul(opt.opt_arg, NULL, 16);
else
- args->imccflags = PARROT_IMCC_VERBOSE;
+ args->imcc_dflags = PARROT_IMCC_VERBOSE;
break;
case 'O':
if (!opt.opt_arg || !*opt.opt_arg || opt.opt_arg[0] == '0') {
- args->imccflags |= PARROT_IMCC_OPT1;
+ args->imcc_opts |= PARROT_IMCC_OPT_PRE;
break;
}
if (strchr(opt.opt_arg, 'p'))
- args->imccflags |= PARROT_IMCC_OPT1;
+ args->imcc_opts |= PARROT_IMCC_OPT_PASM;
if (strchr(opt.opt_arg, 'c'))
- args->imccflags |= PARROT_IMCC_OPT2;
+ args->imcc_opts |= PARROT_IMCC_OPT_SUB;
if (strchr(opt.opt_arg, '1'))
- args->imccflags |= PARROT_IMCC_OPT1;
+ args->imcc_opts |= PARROT_IMCC_OPT_PRE;
if (strchr(opt.opt_arg, '2'))
- args->imccflags |= (PARROT_IMCC_OPT1|PARROT_IMCC_OPT2);
+ args->imcc_opts |= (PARROT_IMCC_OPT_PRE|PARROT_IMCC_OPT_CFG);
break;
+
case '.': /* Give Windows Parrot hackers an opportunity to
* attach a debuggger. */
fgetc(stdin);
@@ -858,7 +862,7 @@ parseflags(Parrot_PMC interp, int argc, ARGIN(const char *argv[]),
args->have_pbc_file = 1;
break;
case OPT_GC_DEBUG:
-#if DISABLE_GC_DEBUG
+#if 0 && DISABLE_GC_DEBUG
Parrot_warn(interp, 0xFFFF,
"PARROT_GC_DEBUG is set but the binary was compiled "
"with DISABLE_GC_DEBUG.");
@@ -885,10 +889,10 @@ parseflags(Parrot_PMC interp, int argc, ARGIN(const char *argv[]),
args->preprocess_only = 1;
break;
case 'v': /* same as -d */
- args->imccflags |= PARROT_IMCC_VERBOSE;
+ args->imcc_dflags |= PARROT_IMCC_VERBOSE;
break;
- case 'y': /* same as -d400 */
- args->imccflags |= PARROT_IMCC_PARSER;
+ case 'y': /* same as -d4 */
+ args->imcc_dflags |= PARROT_IMCC_DEBUG_PARSER;
break;
default:
/* languages handle their arguments later (after being initialized) */
View
52 frontend/parrot2/main.c
@@ -35,7 +35,8 @@ struct init_args_t {
Parrot_Int have_pasm_file;
Parrot_Int turn_gc_off;
Parrot_Int preprocess_only;
- Parrot_Int imccflags;
+ Parrot_Int imcc_dflags;
+ Parrot_Int imcc_opts;
const char ** argv;
int argc;
};
@@ -169,19 +170,20 @@ main(int argc, const char *argv[])
Parrot_api_toggle_gc(interp, 0);
-#if 1
- setup_imcc(interp);
-#else
- if (!(parsed_flags.have_pasm_file
- ? imcc_get_pasm_compreg_api(interp, 1, &compiler)
- : imcc_get_pir_compreg_api(interp, 1, &compiler))) {
- show_last_error_and_exit(interp);
+ {
+ Parrot_PMC pir_compiler = NULL;
+ Parrot_PMC pasm_compiler = NULL;;
+ if (!(imcc_get_pir_compreg_api(interp, 1, &pir_compiler) &&
+ imcc_get_pasm_compreg_api(interp, 1, &pasm_compiler)))
+ show_last_error_and_exit(interp);
+ compiler = parsed_flags.have_pasm_file ? pasm_compiler : pir_compiler;
}
-#endif
+
if (!parsed_flags.turn_gc_off)
Parrot_api_toggle_gc(interp, 1);
- if (parsed_flags.imccflags) {
- if (!imcc_set_debug_api(interp, compiler, parsed_flags.imccflags))
+ if (parsed_flags.imcc_dflags || parsed_flags.imcc_opts) {
+ if (!imcc_set_flags_api(interp, compiler, parsed_flags.imcc_dflags,
+ parsed_flags.imcc_opts))
exit(EXIT_FAILURE);
}
@@ -463,6 +465,7 @@ Parrot_cmd_options(void)
{ '\0', OPT_RUNTIME_PREFIX, (OPTION_flags)0, { "--runtime-prefix" } },
{ 't', 't', OPTION_optional_FLAG, { "--trace" } },
{ 'w', 'w', (OPTION_flags)0, { "--warnings" } },
+ { 'v', 'v', (OPTION_flags)0, { "--verbose" } },
{ 'y', 'y', (OPTION_flags)0, { "--yydebug" } },
{ 'd', 'd', OPTION_optional_FLAG, { "--imcc-debug" } },
{ 0, 0, (OPTION_flags)0, { NULL } }
@@ -605,7 +608,8 @@ parseflags(Parrot_PMC interp, int argc, ARGIN(const char *argv[]),
args->turn_gc_off = 0;
args->have_pasm_file = 0;
args->preprocess_only = 0;
- args->imccflags = 0;
+ args->imcc_dflags = 0;
+ args->imcc_opts = 0;
pargs[nargs++] = argv[0];
while ((status = longopt_get(argc, argv, Parrot_cmd_options(), &opt)) > 0) {
@@ -640,9 +644,23 @@ parseflags(Parrot_PMC interp, int argc, ARGIN(const char *argv[]),
break;
case 'd':
if (opt.opt_arg && is_all_hex_digits(opt.opt_arg))
- args->imccflags = (Parrot_Int)(strtoul(opt.opt_arg, NULL, 16) << 16);
+ args->imcc_dflags = (Parrot_Int)(strtoul(opt.opt_arg, NULL, 16));
else
- args->imccflags = PARROT_IMCC_VERBOSE;
+ args->imcc_dflags = PARROT_IMCC_VERBOSE;
+ break;
+ case 'O':
+ if (!opt.opt_arg || !*opt.opt_arg || opt.opt_arg[0] == '0') {
+ args->imcc_opts |= PARROT_IMCC_OPT_PRE;
+ break;
+ }
+ if (strchr(opt.opt_arg, 'p'))
+ args->imcc_opts |= PARROT_IMCC_OPT_PASM;
+ if (strchr(opt.opt_arg, 'c'))
+ args->imcc_opts |= PARROT_IMCC_OPT_SUB;
+ if (strchr(opt.opt_arg, '1'))
+ args->imcc_opts |= PARROT_IMCC_OPT_PRE;
+ if (strchr(opt.opt_arg, '2'))
+ args->imcc_opts |= (PARROT_IMCC_OPT_PRE|PARROT_IMCC_OPT_CFG);
break;
case '.': /* Give Windows Parrot hackers an opportunity to
@@ -677,7 +695,7 @@ parseflags(Parrot_PMC interp, int argc, ARGIN(const char *argv[]),
pargs[nargs++] = "-c";
break;
case OPT_GC_DEBUG:
-#if DISABLE_GC_DEBUG
+#if 0 && DISABLE_GC_DEBUG
Parrot_warn(interp, 0xFFFF,
"PARROT_GC_DEBUG is set but the binary was compiled "
"with DISABLE_GC_DEBUG.");
@@ -688,10 +706,10 @@ parseflags(Parrot_PMC interp, int argc, ARGIN(const char *argv[]),
result = Parrot_api_flag(interp, PARROT_DESTROY_FLAG, 1);
break;
case 'v':
- args->imccflags |= PARROT_IMCC_VERBOSE;
+ args->imcc_dflags |= PARROT_IMCC_VERBOSE;
break;
case 'y':
- args->imccflags |= PARROT_IMCC_PARSER;
+ args->imcc_dflags |= PARROT_IMCC_DEBUG_PARSER;
break;
case 'a':
args->have_pasm_file = 1;
View
4 frontend/parrot2/prt0.pir
@@ -294,7 +294,7 @@
.sub '__show_help_and_exit' :subid('WSubId_3') :anon
- set $S1, "parrot [Options] <file> [<program options...>]\n Options:\n -h --help\n -V --version\n -I --include add path to include search\n -L --library add path to library search\n --hash-seed F00F specify hex value to use as hash seed\n -X --dynext add path to dynamic extension search\n <Run core options>\n -R --runcore fast|slow|bounds\n -R --runcore trace|profiling|subprof\n -t --trace [flags]\n <VM options>\n -D --parrot-debug[=HEXFLAGS]\n --help-debug\n -w --warnings\n -G --no-gc\n -g --gc ms2|gms|ms|inf set GC type\n <GC MS2 options>\n --gc-dynamic-threshold=percentage maximum memory wasted by GC\n --gc-min-threshold=KB\n <GC GMS options>\n --gc-nursery-size=percent of sysmem size of gen0 (default 2)\n --gc-debug\n --leak-test|--destroy-at-end\n -. --wait Read a keystroke before starting\n --runtime-prefix\n <Compiler options>\n -E --pre-process-only\n -o --output=FILE\n --output-pbc\n -a --pasm\n -c --pbc\n -r --run-pbc\n -y --yydebug\n -d --imcc-debug[=HEXFLAGS] (see --help-debug)\n <Language options>\nsee docs/running.pod for more\n"
+ set $S1, "parrot [Options] <file> [<program options...>]\n Options:\n -h --help\n -V --version\n -I --include add path to include search\n -L --library add path to library search\n --hash-seed F00F specify hex value to use as hash seed\n -X --dynext add path to dynamic extension search\n <Run core options>\n -R --runcore fast|slow|bounds\n -R --runcore trace|profiling|subprof\n -t --trace [flags]\n <VM options>\n -D --parrot-debug[=HEXFLAGS]\n --help-debug\n -w --warnings\n -G --no-gc\n -g --gc ms2|gms|ms|inf set GC type\n <GC MS2 options>\n --gc-dynamic-threshold=percentage maximum memory wasted by GC\n --gc-min-threshold=KB\n <GC GMS options>\n --gc-nursery-size=percent of sysmem size of gen0 (default 2)\n --gc-debug\n --leak-test|--destroy-at-end\n -. --wait Read a keystroke before starting\n --runtime-prefix\n <Compiler options>\n -E --pre-process-only\n -o --output=FILE\n --output-pbc\n -a --pasm\n -c --pbc\n -r --run-pbc\n -v --verbose\n -y --yydebug\n -d --imcc-debug[=HEXFLAGS] (see --help-debug)\n <Language options>\nsee docs/running.pod for more\n"
say $S1
exit 0
@@ -317,7 +317,7 @@
concat $S1, __ARG_1, "\n"
$P1.'print'($S1)
__label_1: # endif
- $P1.'print'("parrot -[acEGhrtVwy.] [-D [FLAGS]] ")
+ $P1.'print'("parrot -[acEGhrtVvwy.] [-D [FLAGS]] ")
$P1.'print'("[-[LIX] path] [-R runcore] [-o FILE] <file> <args>\n")
exit 1
View
7 include/imcc/api.h
@@ -46,10 +46,11 @@ Parrot_Int imcc_preprocess_file_api(
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
-Parrot_Int imcc_set_debug_api(
+Parrot_Int imcc_set_flags_api(
Parrot_PMC interp_pmc,
Parrot_PMC compiler,
- Parrot_Int imccflags);
+ Parrot_Int debug,
+ Parrot_Int opt);
#define ASSERT_ARGS_imcc_compile_file_api __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(pbc))
@@ -58,7 +59,7 @@ Parrot_Int imcc_set_debug_api(
#define ASSERT_ARGS_imcc_get_pir_compreg_api __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(compiler))
#define ASSERT_ARGS_imcc_preprocess_file_api __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
-#define ASSERT_ARGS_imcc_set_debug_api __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_imcc_set_flags_api __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: compilers/imcc/api.c */
View
35 include/parrot/interpreter.h
@@ -38,14 +38,6 @@ typedef enum {
PARROT_EVAL_DEBUG_FLAG = 0x20, /* create EVAL_n file */
PARROT_REG_DEBUG_FLAG = 0x40, /* fill I,N with garbage */
PARROT_CTX_DESTROY_DEBUG_FLAG = 0x80, /* ctx of a sub is gone */
- PARROT_IMCC_VERBOSE = 0x100, /* these appear at imcc >> 16 */
- PARROT_IMCC_LEXER = 0x200,
- PARROT_IMCC_PARSER = 0x400, /* sets yydebug */
- PARROT_IMCC_IMC = 0x800,
- PARROT_IMCC_CFG = 0x1000,
- PARROT_IMCC_OPT1 = 0x2000,
- PARROT_IMCC_OPT2 = 0x4000,
- PARROT_IMCC_AST = 0x8000,
PARROT_ALL_DEBUG_FLAGS = 0xffff
} Parrot_debug_flags;
/* &end_gen */
@@ -60,6 +52,33 @@ typedef enum {
} Parrot_trace_flags;
/* &end_gen */
+typedef enum { /* sync with compilers/imcc/debug.h */
+ PARROT_IMCC_DEBUG_NONE = 0x00,
+ PARROT_IMCC_VERBOSE = 0x01,
+ PARROT_IMCC_DEBUG_LEXER = 0x02,
+ PARROT_IMCC_DEBUG_PARSER = 0x04, /* sets yydebug */
+ PARROT_IMCC_DEBUG_IMC = 0x08, /* dump symreg, insns */
+ PARROT_IMCC_DEBUG_CFG = 0x10,
+ PARROT_IMCC_DEBUG_OPT1 = 0x20,
+ PARROT_IMCC_DEBUG_OPT2 = 0x40,
+ PARROT_IMCC_DEBUG_SPILL = 0x80,
+ PARROT_IMCC_DEBUG_AST = 0x100,
+ PARROT_IMCC_DEBUG_REG = 0x200,
+ PARROT_IMCC_DEBUG_REG2 = 0x400,
+ PARROT_IMCC_DEBUG_PBC = 0x1000,
+ PARROT_IMCC_DEBUG_PBC_CONST = 0x2000,
+ PARROT_IMCC_DEBUG_PBC_FIXUP = 0x4000,
+ PARROT_IMCC_DEBUG_ALL = 0xffff
+} Parrot_imcc_dflags;
+
+typedef enum { /* sync with compilers/imcc/imc.h */
+ PARROT_IMCC_OPT_NONE = 0x000,
+ PARROT_IMCC_OPT_PRE = 0x001, /* -O1 */
+ PARROT_IMCC_OPT_CFG = 0x002, /* -O2 */
+ PARROT_IMCC_OPT_SUB = 0x004, /* -Oc */
+ PARROT_IMCC_OPT_PASM = 0x100, /* -Op */
+} Parrot_imcc_opt_flags;
+
/* &gen_from_enum(interpcores.pasm) */
typedef enum {
PARROT_SLOW_CORE, /* slow bounds/trace core */
View
2  t/op/calling.t
@@ -1669,6 +1669,7 @@ ok 1
ok 2
OUTPUT
+# TODO -O1
pir_output_is( <<'CODE', <<'OUTPUT', "newclosure followed by tailcall" );
## regression test for newclosure followed by tailcall, which used to recycle
## the context too soon. it looks awful because (a) the original version was
@@ -1712,6 +1713,7 @@ L3:
.end
+# TODO -O1 error
.sub _try_it
.param int n
.param pmc closure
Please sign in to comment.
Something went wrong with that request. Please try again.