Skip to content

Commit

Permalink
Merge branch 'master' into threads
Browse files Browse the repository at this point in the history
  • Loading branch information
Whiteknight committed Sep 23, 2012
2 parents 97e5370 + 7c24a69 commit 01343d1
Show file tree
Hide file tree
Showing 24 changed files with 332 additions and 49 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Expand Up @@ -22,6 +22,8 @@ script: "perl Configure.pl $PARROT_CONFIG_ARGS $PARROT_OPTIMIZE --cc=\"$CC\" --l
branches:
only:
- master
- threads
- /smoke-me/
notifications:
recipients:
- parrot-ci@lists.parrot.org
Expand All @@ -34,12 +36,8 @@ notifications:
on_success: change
on_failure: change
env:
- PARROT_CONFIG_ARGS="" PARROT_OPTIMIZE="--optimize" PARROT_TEST="smoke" CC="clang"
- PARROT_CONFIG_ARGS="" PARROT_OPTIMIZE="" PARROT_TEST="smoke" CC="clang"
- PARROT_CONFIG_ARGS="--without-gettext --without-gmp --without-libffi --without-extra-nci-thunks --without-opengl --without-readline --without-pcre --without-zlib --without-threads --without-icu" PARROT_OPTIMIZE="" PARROT_TEST="smoke" CC="clang"
- PARROT_CONFIG_ARGS="" PARROT_OPTIMIZE="--optimize" PARROT_TEST="smoke" CC="gcc"
- PARROT_CONFIG_ARGS="" PARROT_OPTIMIZE="" PARROT_TEST="smoke" CC="gcc"
- PARROT_CONFIG_ARGS="--without-gettext --without-gmp --without-libffi --without-extra-nci-thunks --without-opengl --without-readline --without-pcre --without-zlib --without-threads --without-icu" PARROT_OPTIMIZE="" PARROT_TEST="smoke" CC="gcc"
- PARROT_CONFIG_ARGS="" PARROT_OPTIMIZE="--optimize" PARROT_TEST="smoke" CC="g++"
- PARROT_CONFIG_ARGS="" PARROT_OPTIMIZE="" PARROT_TEST="smoke" CC="g++"
- PARROT_CONFIG_ARGS="--without-gettext --without-gmp --without-libffi --without-extra-nci-thunks --without-opengl --without-readline --without-pcre --without-zlib --without-threads --without-icu" PARROT_OPTIMIZE="" PARROT_TEST="smoke" CC="g++"
2 changes: 1 addition & 1 deletion CREDITS
Expand Up @@ -76,7 +76,7 @@ U: allison

N: Alvis Yardley
D: Documentation Shepherd (3.9.0 - Present)
D: Release manager for 4.1.0 and 4.5.0
D: Release manager for 4.1.0, 4.5.0 and 4.8.0
E: ac.yardley@gmail.com
U: alvis
S: Ft. Worth, Texas
Expand Down
14 changes: 14 additions & 0 deletions ChangeLog
@@ -1,3 +1,14 @@
2012-10-16 release 4.9.0
- Core
+ Keep encoding information in the imcc optimizer, which fixes the
concat op but probably many more cases with non-ascii encoded
constant strings. [GH #837]
+ Fixed ByteBuffer set_string_native, which became out of sync with
two internal buffers. [GH #835]
- Documentation
- Tests
- Community

2012-09-18 release 4.8.0
- Core
+ Prevent interpreter from dying twice
Expand All @@ -11,7 +22,10 @@
+ Fixed for the FileHandle open method the append mode on Windows.
+ Fix compilation on Windows without working mt.exe
+ Detect GNU/Hurd as linux proper.
+ Fixed broken int3 trap on Solaris with gcc.
+ Updated the vms port on a YAPC::EU hackathon with vaxman and mvorl.
- Tests
+ Improve testability with valgrind or thread-sanitizer

2012-08-21 release 4.7.0
- Core
Expand Down
1 change: 1 addition & 0 deletions MANIFEST
Expand Up @@ -1882,6 +1882,7 @@ t/pmc/bigint.t [test]
t/pmc/bignum.t [test]
t/pmc/boolean.t [test]
t/pmc/bytebuffer.t [test]
t/pmc/bytebuffer2.t [test]
t/pmc/callcontext.t [test]
t/pmc/capture.t [test]
t/pmc/class.t [test]
Expand Down
6 changes: 3 additions & 3 deletions MANIFEST.generated
Expand Up @@ -2,14 +2,14 @@
# See tools/dev/install_files.pl for documentation on the
# format of this file.
# Please re-sort this file after *EVERY* modification
blib/lib/libparrot.4.7.0.dylib [main]lib
blib/lib/libparrot.4.8.0.dylib [main]lib
blib/lib/libparrot.a [main]lib
blib/lib/libparrot.dylib [main]lib
blib/lib/libparrot.so [main]lib
blib/lib/libparrot.so.4.7.0 [main]lib
blib/lib/libparrot.so.4.8.0 [main]lib
compilers/data_json/data_json.pbc [data_json]
config/gen/call_list/opengl.in []
cygparrot-4.7.0.dll [main]bin
cygparrot-4.8.0.dll [main]bin
docs/ops/bit.pod [doc]
docs/ops/cmp.pod [doc]
docs/ops/core.pod [doc]
Expand Down
2 changes: 1 addition & 1 deletion README.pod
Expand Up @@ -4,7 +4,7 @@

=head1 NAME

README.pod - Readme to Parrot, version 4.7.0.
README.pod - Readme to Parrot, version 4.8.0.

=head1 DESCRIPTION

Expand Down
2 changes: 2 additions & 0 deletions RESPONSIBLE_PARTIES
Expand Up @@ -67,6 +67,7 @@ Core Developer Jonathan Worthington
Mark Glines
Vasily Chekalkin
Jonathan "Duke" Leto
Alvis Yardley

Compiler Developer Patrick Michaud (PGE, PCT)
Allison Randal (TGE)
Expand Down Expand Up @@ -102,5 +103,6 @@ Cage Cleaner James E Keenan
Mark Glines
Bruce Gray
Michael Hind
Alvis Yardley

General Contributor See CREDITS
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
4.7.0
4.8.0
16 changes: 9 additions & 7 deletions compilers/imcc/optimizer.c
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2002-2010, Parrot Foundation.
* Copyright (C) 2002-2012, Parrot Foundation.
*/

/*
Expand Down Expand Up @@ -1070,13 +1070,15 @@ IMCC_subst_constants(ARGMOD(imc_info_t *imcc), ARGMOD(IMC_Unit *unit),
case 'S':
{
char * const cstr = Parrot_str_to_cstring(imcc->interp, REG_STR(imcc->interp, 0));

r[1] = mk_const(imcc, cstr, r[0]->set);

snprintf(b, sizeof (b), "%p", REG_STR(imcc->interp, 0));
const STR_VTABLE* encoding = REG_STR(imcc->interp, 0)->encoding;
if (encoding == Parrot_ascii_encoding_ptr) {
r[1] = mk_const(imcc, cstr, r[0]->set);
}
else {
snprintf(b, sizeof (b), "%s:\"%s\"", encoding->name, cstr);
r[1] = mk_const(imcc, b, 'U');
}
Parrot_str_free_cstring(cstr);

break;
}
default:
break;
Expand Down
1 change: 1 addition & 0 deletions docs/parrothist.pod
Expand Up @@ -146,5 +146,6 @@ Starred release numbers indicate supported releases.
alvis 4.5.0 2012-Jun-19 "Buff-faced Pygmy Parrot"
rurban 4.6.0 * 2012-Jul-17 "Wild Parrots of Telegraph Hill"
Whiteknight 4.7.0 2012-Aug-22 "Hispaniolan"
alvis 4.8.0 2012-Sep-18 "Spix's Macaw"

=cut
8 changes: 5 additions & 3 deletions docs/project/release_manager_guide.pod
Expand Up @@ -471,7 +471,7 @@ to keep the main page fresh.
To update both the C<parrot.github.com> and the relevant C<parrot-docsx> repositories,
execute the following command:

perl tools/release/parrot_github_release.pl
perl tools/release/parrot_github_release.pl --docs=[/path/to/old/docs/]

Please note: To review the available options, use the C<-h | --help> option.
In addition, you may also want to review the pod with,
Expand Down Expand Up @@ -544,10 +544,12 @@ The calendar of releases is available at the C<comp.lang.parrot> Google
calendar, visible at
L<http://www.google.com/calendar/render?cid=ldhctdamsgfg5a1cord52po9h8@group.calendar.google.com>.

- Sep 18, 2012 - 4.8.0 - alvis
- Oct 16, 2012 - 4.9.0 - dukeleto
- Nov 20, 2012 - 4.10.0 - ??
- Nov 20, 2012 - 4.10.0 - rurban
- Dec 18, 2012 - 4.11.0 - ??
- Jan 15, 2013 - 5.0.0 - dukeleto
- Feb 19, 2013 - 5.1.0 - ??
- Mar 19, 2013 - 5.2.0 - ??

=cut

Expand Down
47 changes: 47 additions & 0 deletions examples/benchmarks/stress_strings1.pir
@@ -0,0 +1,47 @@
# Copyright (C) 2010-2012, Parrot Foundation.

=head1 NAME

examples/benchmarks/stress_strings1.pir - comparison with stress_stringsu.pir

=head1 SYNOPSIS

% time ./parrot examples/benchmarks/stress_strings1.pir
% time ./parrot examples/benchmarks/stress_stringsu.pir

=head1 DESCRIPTION

Create non-encoded strings, running through the imcc optimizer.
Some of the strings are long-lived, most of them are short lived.

=cut

.sub 'main' :main
.local pmc rsa # array of long lived strings.
.local pmc args
.local int i

rsa = new ['ResizableStringArray']
args = new ['ResizablePMCArray']
i = 0
push args, i
loop:
$S0 = "c"
args[0] = i
sprintf $S1, "%d", args
$S2 = concat $S0, $S1
$I0 = i % 10 # every 10th string is longlived
if $I0 goto inc_i
push rsa, $S2
inc_i:
inc i
if i < 10000000 goto loop

.end


# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:
48 changes: 48 additions & 0 deletions examples/benchmarks/stress_stringsu.pir
@@ -0,0 +1,48 @@
# Copyright (C) 2010-2012, Parrot Foundation.

=head1 NAME

examples/benchmarks/stress_stringsu.pir - GC unicode strings stress-testing

=head1 SYNOPSIS

% time ./parrot examples/benchmarks/stress_stringsu.pir

=head1 DESCRIPTION

Create encoded strings, running through the imcc optimizer, which reencodes the strings.
Some of the strings are long-lived, most of them are short lived.

Main purpose - test encoding issues and imcc performance. [GH #873]

=cut

.sub 'main' :main
.local pmc rsa # array of long lived strings.
.local pmc args
.local int i

rsa = new ['ResizableStringArray']
args = new ['ResizablePMCArray']
i = 0
push args, i
loop:
$S0 = utf8:"\x{a2}"
args[0] = i
sprintf $S1, "%d", args
$S2 = concat $S0, $S1
$I0 = i % 10 # every 10th string is longlived
if $I0 goto inc_i
push rsa, $S2
inc_i:
inc i
if i < 10000000 goto loop

.end


# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:
2 changes: 1 addition & 1 deletion include/parrot/oplib/core_ops.h
Expand Up @@ -19,7 +19,7 @@
#include "parrot/runcore_api.h"

PARROT_EXPORT
op_lib_t *Parrot_DynOp_core_4_7_0(PARROT_INTERP, long init);
op_lib_t *Parrot_DynOp_core_4_8_0(PARROT_INTERP, long init);

opcode_t * Parrot_end(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_noop(opcode_t *, PARROT_INTERP);
Expand Down
8 changes: 4 additions & 4 deletions src/ops/core_ops.c
Expand Up @@ -23302,7 +23302,7 @@ Parrot_find_sub_not_null_p_sc(opcode_t *cur_opcode, PARROT_INTERP) {
opcode_t *
Parrot_trap(opcode_t *cur_opcode, PARROT_INTERP) {
UNUSED(interp);
#if defined(__GNUC__) && defined(i386)
#if defined(__GNUC__) && defined(i386) && !defined(sun)
__asm__("int3");

#endif
Expand Down Expand Up @@ -24568,7 +24568,7 @@ op_lib_t core_op_lib = {
PARROT_FUNCTION_CORE, /* core_type = PARROT_XX_CORE */
0, /* flags */
4, /* major_version */
7, /* minor_version */
8, /* minor_version */
0, /* patch_version */
1129, /* op_count */
core_op_info_table, /* op_info_table */
Expand Down Expand Up @@ -24697,7 +24697,7 @@ static void hop_deinit(PARROT_INTERP)
hop_buckets = NULL;
}PARROT_EXPORT
op_lib_t *
Parrot_DynOp_core_4_7_0(PARROT_INTERP, long init) {
Parrot_DynOp_core_4_8_0(PARROT_INTERP, long init) {
/* initialize and return op_lib ptr */
if (init == 1) {

Expand Down Expand Up @@ -24726,7 +24726,7 @@ Parrot_lib_core_ops_load(PARROT_INTERP)

{
PMC *const lib = Parrot_pmc_new(interp, enum_class_ParrotLibrary);
((Parrot_ParrotLibrary_attributes*)PMC_data(lib))->oplib_init = (void *) Parrot_DynOp_core_4_7_0;
((Parrot_ParrotLibrary_attributes*)PMC_data(lib))->oplib_init = (void *) Parrot_DynOp_core_4_8_0;
dynop_register(interp, lib);
return lib;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ops/experimental.ops
Expand Up @@ -49,7 +49,7 @@ For other architectures, this is a C<noop>.

op trap() :deprecated {
UNUSED(interp);
#if defined(__GNUC__) && defined(i386)
#if defined(__GNUC__) && defined(i386) && !defined(sun)
__asm__("int3"); /* opcode 0xcc */
#endif
#if defined(__GNUC__) && defined(PPC)
Expand Down
18 changes: 15 additions & 3 deletions src/pmc/bytebuffer.pmc
Expand Up @@ -200,15 +200,27 @@ Reset the buffer with the content of the string.

VTABLE void set_string_native(STRING *new_string) {
INTVAL allocated_size;
INTVAL new_length;
GET_ATTR_allocated_size(INTERP, SELF, allocated_size);
new_length = Parrot_str_byte_length(interp, new_string);
if (allocated_size) {
unsigned char *content;
GET_ATTR_content(INTERP, SELF, content);
Parrot_gc_free_memory_chunk(INTERP, content);
SET_ATTR_allocated_size(INTERP, SELF, 0);
if (allocated_size < new_length) {
content = (unsigned char *)Parrot_gc_reallocate_memory_chunk(INTERP, content, new_length);
}
memcpy(content, new_string->strstart, new_length);
SET_ATTR_content(INTERP, SELF, content);
}
else {
unsigned char * const content = (unsigned char *)
Parrot_gc_allocate_memory_chunk(INTERP, new_length);
memcpy(content, new_string->strstart, new_length);
SET_ATTR_content(INTERP, SELF, content);
}
SET_ATTR_source(INTERP, SELF, new_string);
SET_ATTR_size(INTERP, SELF, Parrot_str_byte_length(INTERP, new_string));
SET_ATTR_size(INTERP, SELF, new_length);
SET_ATTR_allocated_size(INTERP, SELF, new_length);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion src/string/api.c
Expand Up @@ -701,7 +701,7 @@ STRING *encodingname)>
Given a buffer and an encoding, creates and returns a new string. If buffer is
NULL the result is a null string. Otherwise, the buffer should be a zero
terminated c-style string and its content must be valid for the encoding
specified. If encoding is null, assume plaftorm encoding.
specified. If encoding is null, assume platform encoding.
=cut
Expand Down

0 comments on commit 01343d1

Please sign in to comment.