Skip to content

Commit

Permalink
Merge branch 'master' into generational_gc
Browse files Browse the repository at this point in the history
  • Loading branch information
bacek committed Feb 11, 2011
2 parents 5eec12f + d5a6bc6 commit 0c03f7e
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 7 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ New in 3.1.0
DEPRECATED.pod, which no longer exists.
+ Improved GC latency
+ Improved GC performance on low-memory systems
- NQP
+ A repository for a new NQP version which has a new object model is created at http://github.com/perl6/nqp
- Languages
- Community
- Documentation
Expand Down
10 changes: 9 additions & 1 deletion runtime/parrot/library/distutils.pir
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ the value is the NQP pathname
$S0 = dirname(pir)
mkpath($S0, 1 :named('verbose'))
.local string cmd
cmd = get_nqp()
cmd = get_nqp_rx()
cmd .= " --target=pir --output="
cmd .= pir
cmd .= " "
Expand Down Expand Up @@ -4396,6 +4396,14 @@ Return the whole config
.tailcall get_executable('parrot-nqp')
.end

=item get_nqp_rx

=cut

.sub 'get_nqp_rx'
.tailcall get_executable('parrot-nqp')
.end

=item get_srcdir

=cut
Expand Down
2 changes: 1 addition & 1 deletion src/dynpmc/os.pmc
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ reads entries from a directory.
INTVAL last_char = STRING_ord(INTERP, path, -1);
int trailing_slash = last_char == '\\' || last_char == '/';
cpath = Parrot_str_to_cstring(INTERP, Parrot_str_concat(INTERP,
path, string_from_literal(INTERP, trailing_slash ? "*" : "\\*"), 0));
path, string_from_literal(INTERP, trailing_slash ? "*" : "\\*")));
hFind = FindFirstFile(cpath, &file_find_data);
Parrot_str_free_cstring(cpath);
if (hFind == INVALID_HANDLE_VALUE)
Expand Down
12 changes: 12 additions & 0 deletions src/embed/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,10 +833,22 @@ Parrot_api_toggle_gc(Parrot_PMC interp_pmc, Parrot_Int on)
EMBED_API_CALLOUT(interp_pmc, interp)
}

/*
=item C<Parrot_Int Parrot_api_reset_call_signature(Parrot_PMC interp_pmc,
Parrot_PMC ctx)>
Reset the call signature
=cut
*/

PARROT_API
Parrot_Int
Parrot_api_reset_call_signature(Parrot_PMC interp_pmc, Parrot_PMC ctx)
{
ASSERT_ARGS(Parrot_api_reset_call_signature)
EMBED_API_CALLIN(interp_pmc, interp)
STRING * const callcontext = Parrot_str_new(interp, "CallContext", 0);
if (!VTABLE_isa(interp, ctx, callcontext))
Expand Down
22 changes: 22 additions & 0 deletions src/extend.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,16 +348,38 @@ Parrot_ext_try(PARROT_INTERP,
ASSERT_ARGS(Parrot_ext_try)
if (cfunction) {
Parrot_runloop jmp;
Parrot_Context *initialctx, *curctx;
PARROT_CALLIN_START(interp);
initialctx = CONTEXT(interp);
switch (setjmp(jmp.resume)) {
case 0: /* try */
Parrot_ex_add_c_handler(interp, &jmp);
(*cfunction)(interp, data);
curctx = CONTEXT(interp);
if (curctx != initialctx) {
Parrot_warn(interp, PARROT_WARNINGS_NONE_FLAG,
"popping context in Parrot_ext_try");
do {
if (curctx == NULL)
do_panic(interp,
"cannot restore context", __FILE__, __LINE__);
} while ((curctx = CONTEXT(interp)) != initialctx);
}
Parrot_cx_delete_handler_local(interp, STRINGNULL);
break;
default: /* catch */
{
PMC *exception = jmp.exception;
curctx = CONTEXT(interp);
if (curctx != initialctx) {
Parrot_warn(interp, PARROT_WARNINGS_NONE_FLAG,
"popping context in Parrot_ext_try");
do {
if (curctx == NULL)
do_panic(interp,
"cannot restore context", __FILE__, __LINE__);
} while ((curctx = CONTEXT(interp)) != initialctx);
}
Parrot_cx_delete_handler_local(interp, STRINGNULL);
if (chandler)
(*chandler)(interp, exception, data);
Expand Down
1 change: 0 additions & 1 deletion src/ops/core.ops
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,6 @@ op get_results(inconst PMC) :flow {
opcode_t * const raw_params = CUR_OPCODE;
PMC * const signature = $1;
PMC *ctx = CURRENT_CONTEXT(interp);
PMC *ccont = Parrot_pcc_get_continuation(interp, ctx);
PMC *call_object = Parrot_pcc_get_signature(interp, ctx);

INTVAL argc;
Expand Down
1 change: 0 additions & 1 deletion src/ops/core_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -15389,7 +15389,6 @@ Parrot_get_results_pc(opcode_t *cur_opcode, PARROT_INTERP) {
opcode_t * const raw_params = CUR_OPCODE;
PMC * const signature = PCONST(1);
PMC *ctx = CURRENT_CONTEXT(interp);
PMC *ccont = Parrot_pcc_get_continuation(interp, ctx);
PMC *call_object = Parrot_pcc_get_signature(interp, ctx);

INTVAL argc;
Expand Down
3 changes: 1 addition & 2 deletions t/src/embed/api.t
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ CODE
executed
OUTPUT

#(undef, $temp_pir) = create_tempfile( SUFFIX => '.pir', UNLINK => 1 );
$temp_pir = "api_t_test.pir";
(undef, $temp_pir) = create_tempfile( SUFFIX => '.pir', UNLINK => 1 );
open $PIR_FILE, ">", $temp_pir;
print $PIR_FILE <<'PIR_CODE';
.sub main :main
Expand Down
22 changes: 21 additions & 1 deletion t/src/misc.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use File::Spec::Functions;

plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile(qw/src parrot_config.o/);

plan tests => 3;
plan tests => 4;

=head1 NAME
Expand Down Expand Up @@ -134,6 +134,26 @@ CODE
Done
OUTPUT

c_output_is(linedirective(__LINE__) . <<'CODE', <<'OUTPUT', "PARROT_GC_WRITE_BARRIER macro" );
#include <stdio.h>
#include <stdlib.h>
#include "parrot/parrot.h"
int main(int argc, const char **argv)
{
PMC pmc;
pmc.flags = 0;
/* It should compile */
PARROT_GC_WRITE_BARRIER(NULL, &pmc);
printf("Done\n");
return 0;
}
CODE
Done
OUTPUT


# Local Variables:
# mode: cperl
Expand Down

0 comments on commit 0c03f7e

Please sign in to comment.