Skip to content

Commit

Permalink
Merge branch 'upstream' of git://github.com/leto/parrot into gsoc_nci
Browse files Browse the repository at this point in the history
  • Loading branch information
ashgti committed Jul 14, 2010
2 parents 00c5b85 + 55fab15 commit beb5efd
Show file tree
Hide file tree
Showing 117 changed files with 29,992 additions and 28,540 deletions.
13 changes: 13 additions & 0 deletions DEPRECATED.pod
Expand Up @@ -141,12 +141,25 @@ things that aren't really logical ops (don't do that!).

L<https://trac.parrot.org/parrot/ticket/1655>

=item Method is_tty in PMCs derived from Handle [eligible in 2.7]

Use isatty instead.

L<https://trac.parrot.org/parrot/ticket/1689>

=back

=head1 Opcodes

=over 4

=item open and close opcodes will be removed [eligible in 2.7]

L<https://trac.parrot.org/parrot/ticket/1697>

These opcodes will be removed. The open/close methods on File or
the FileHandle PMC should be used instead.

=item get_addr and set_addr [eligible in 1.5]

L<https://trac.parrot.org/parrot/ticket/218>
Expand Down
4 changes: 1 addition & 3 deletions MANIFEST
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
# generated by tools/dev/mk_manifest_and_skip.pl Sun Jun 20 14:27:22 2010 UT
# generated by tools/dev/mk_manifest_and_skip.pl Tue Jun 29 22:56:50 2010 UT
#
# See below for documentation on the format of this file.
#
Expand Down Expand Up @@ -278,7 +278,6 @@ config/gen/platform/ansi/time.c []
config/gen/platform/cygwin/math.c []
config/gen/platform/darwin/begin.c []
config/gen/platform/darwin/hires_timer.c []
config/gen/platform/darwin/memalign.c []
config/gen/platform/generic/dl.c []
config/gen/platform/generic/dl.h []
config/gen/platform/generic/env.c []
Expand All @@ -288,7 +287,6 @@ config/gen/platform/generic/io.h []
config/gen/platform/generic/itimer.c []
config/gen/platform/generic/math.c []
config/gen/platform/generic/math.h []
config/gen/platform/generic/memalign.c []
config/gen/platform/generic/memexec.c []
config/gen/platform/generic/platform_limits.h []
config/gen/platform/generic/signal.c []
Expand Down
7 changes: 6 additions & 1 deletion MANIFEST.SKIP
@@ -1,6 +1,6 @@
# ex: set ro:
# $Id$
# generated by tools/dev/mk_manifest_and_skip.pl Thu May 27 15:25:37 2010 UT
# generated by tools/dev/mk_manifest_and_skip.pl Thu Jun 24 14:06:33 2010 UT
#
# This file should contain a transcript of the svn:ignore properties
# of the directories in the Parrot subversion repository. (Needed for
Expand Down Expand Up @@ -69,6 +69,8 @@
^config_lib\.pir/
^cover_db$
^cover_db/
^generated_hello\.pbc$
^generated_hello\.pbc/
^install_config\.fpmc$
^install_config\.fpmc/
^installable.*$
Expand Down Expand Up @@ -624,6 +626,9 @@
# generated from svn:ignore of 'runtime/parrot/library/Test/Builder/'
^runtime/parrot/library/Test/Builder/.*\.pbc$
^runtime/parrot/library/Test/Builder/.*\.pbc/
# generated from svn:ignore of 'runtime/parrot/library/URI/'
^runtime/parrot/library/URI/.*\.pbc$
^runtime/parrot/library/URI/.*\.pbc/
# generated from svn:ignore of 'runtime/parrot/library/YAML/'
^runtime/parrot/library/YAML/.*\.pbc$
^runtime/parrot/library/YAML/.*\.pbc/
Expand Down
5 changes: 5 additions & 0 deletions NEWS
@@ -1,5 +1,10 @@
# $Id$

New in 2.6.0
- Platforms
+ The Fedora package 'parrot-devel' install the files for syntax-highlighting
and automatic indenting for the vim editor.

New in 2.5.0
- Core
+ Added ByteBuffer PMC to allow direct byte manipulation
Expand Down
2 changes: 1 addition & 1 deletion README
Expand Up @@ -79,7 +79,7 @@ You can install Parrot with:
By default, this installs in /usr/local, with the Parrot executable in
/usr/local/bin. If you want to install Parrot into another location use:

perl Configure.pl --prefix=/Users/foo/parrot-0.7.0
perl Configure.pl --prefix=/home/joe/bird
make install

But please note that dynamic libs will not be found for non-standard
Expand Down
6 changes: 2 additions & 4 deletions compilers/imcc/pbc.c
Expand Up @@ -901,7 +901,6 @@ IMCC_string_from_reg(PARROT_INTERP, ARGIN(const SymReg *r))
const CHARSET *s_charset;
const ENCODING *s_encoding = NULL;
const ENCODING *src_encoding;
const char *charset;
#define MAX_NAME 31
char charset_name[MAX_NAME + 1];
char encoding_name[MAX_NAME + 1];
Expand Down Expand Up @@ -2090,18 +2089,17 @@ int
e_pbc_end_sub(PARROT_INTERP, SHIM(void *param), ARGIN(IMC_Unit *unit))
{
ASSERT_ARGS(e_pbc_end_sub)
Instruction *ins;
Instruction *ins = unit->instructions;
int pragma;

if (!unit->instructions)
if (!ins)
return 0;

/*
* if the sub was marked IMMEDIATE, we run it now
* This is *dangerous*: all possible global state can be messed
* up, e.g. when that sub starts loading bytecode
*/
ins = unit->instructions;

/* we run only PCC subs */
if (!ins->symregs[0] || !ins->symregs[0]->pcc_sub)
Expand Down
19 changes: 14 additions & 5 deletions compilers/opsc/src/Ops/Trans/C.pm
Expand Up @@ -95,7 +95,7 @@ method goto_offset($offset) { "return (opcode_t *)cur_opcode + $offset"; }

method expr_address($addr) { $addr; }

method expr_offset($offset) { "cur_opcode + $offset"; }
method expr_offset($offset) { " cur_opcode + $offset"; }

=begin

Expand Down Expand Up @@ -299,7 +299,10 @@ static void hop_deinit(PARROT_INTERP);
* returns >= 0 (found idx into info_table), -1 if not
*/
static size_t hash_str(const char *str) {
PARROT_PURE_FUNCTION
static
size_t hash_str(ARGIN(const char *str))
{
size_t key = 0;
const char *s = str;
Expand All @@ -311,7 +314,8 @@ static size_t hash_str(const char *str) {
return key;
}
static void store_op(PARROT_INTERP, op_info_t *info, int full) {
static void store_op(PARROT_INTERP, op_info_t *info, int full)
{
HOP * const p = mem_gc_allocate_zeroed_typed(interp, HOP);
const size_t hidx =
hash_str(full ? info->full_name : info->name) % OP_HASH_SIZE;
Expand All @@ -320,7 +324,9 @@ static void store_op(PARROT_INTERP, op_info_t *info, int full) {
p->next = hop[hidx];
hop[hidx] = p;
}
static int get_op(PARROT_INTERP, const char * name, int full) {
static int get_op(PARROT_INTERP, const char * name, int full)
{
const HOP * p;
const size_t hidx = hash_str(name) % OP_HASH_SIZE;
if (!hop) {
Expand All @@ -333,7 +339,9 @@ static int get_op(PARROT_INTERP, const char * name, int full) {
}
return -1;
}
static void hop_init(PARROT_INTERP) {
static void hop_init(PARROT_INTERP)
{
size_t i;
op_info_t * const info = [[BS]]op_lib.op_info_table;
/* store full names */
Expand All @@ -344,6 +352,7 @@ static void hop_init(PARROT_INTERP) {
if (get_op(interp, info[i].name, 0) == -1)
store_op(interp, info + i, 0);
}
static void hop_deinit(PARROT_INTERP)
{
if (hop) {
Expand Down
38 changes: 34 additions & 4 deletions compilers/pct/src/PAST/Compiler.pir
Expand Up @@ -18,6 +18,7 @@ what sorts of conversions are allowed (or desired). The
basic flags are:

P,S,I,N PMC, string, int, or num register
Q keyed PMC, next flag indicates type of key
s string register or constant
i int register or constant
n num register or constant
Expand All @@ -27,6 +28,7 @@ basic flags are:
+ PMC, int register, num register, or numeric constant
~ PMC, string register, or string constant
: argument (same as '*'), possibly with :named or :flat
0-9 use the nth input operand as the output result of this operation

These flags are used to describe signatures and desired return
types for various operations. For example, if an opcode is
Expand Down Expand Up @@ -67,11 +69,13 @@ any value type.
piropsig['concat'] = 'PP~'
piropsig['copy'] = '0PP'
piropsig['defined'] = 'IP'
piropsig['delete'] = 'vQ*'
piropsig['die'] = 'v~'
piropsig['div'] = 'PP+'
piropsig['does'] = 'IPs'
piropsig['downcase'] = 'Ss'
piropsig['elements'] = 'IP'
piropsig['exists'] = 'IQ*'
piropsig['exit'] = 'vi'
piropsig['fdiv'] = 'PP+'
piropsig['find_codepoint'] = 'Is'
Expand Down Expand Up @@ -430,6 +434,7 @@ third and subsequent children can be any value they wish.
sigidx = 1
rtype = substr signature, sigidx, 1
iter_loop:
if rtype == 'Q' goto keyed_pos
unless iter goto iter_end
.local pmc cpast, cpost
cpast = shift iter
Expand Down Expand Up @@ -472,6 +477,31 @@ third and subsequent children can be any value they wish.
inc sigidx
rtype = substr signature, sigidx, 1
goto iter_loop
keyed_pos:
# rtype is 'Q', so construct a keyed pmc argument
# first, get the base PMC
unless iter goto iter_end
cpast = shift iter
cpost = self.'as_post'(cpast, 'rtype'=>'P')
cpost = self.'coerce'(cpost, 'P')
# now process the key arg
unless iter goto iter_end
.local pmc kpast, kpost
kpast = shift iter
inc sigidx
rtype = substr signature, sigidx, 1
kpost = self.'as_post'(kpast, 'rtype'=>rtype)
kpost = self.'coerce'(kpost, rtype)
ops.'push'(kpost)
ops.'push'(cpost)
# now construct the keyed PMC
$S0 = cpost
concat $S0, '['
$S1 = kpost
concat $S0, $S1
concat $S0, ']'
push posargs, $S0
goto iter_rtype
iter_end:
.return (ops, posargs, namedargs)
.end
Expand Down Expand Up @@ -1101,8 +1131,8 @@ a 'pasttype' of 'pirop'.
signature = 'vP'
have_signature:
.local pmc ops
ops = self.'post_children'(node, 'signature'=>signature)
.local pmc ops, posargs
(ops, posargs) = self.'post_children'(node, 'signature'=>signature)
.local pmc arglist
arglist = ops.'list'()
Expand All @@ -1118,10 +1148,10 @@ a 'pasttype' of 'pirop'.
.local string result
result = self.'uniquereg'($S0)
ops.'result'(result)
ops.'push_pirop'(pirop, result, arglist :flat)
ops.'push_pirop'(pirop, result, posargs :flat)
.return (ops)
pirop_void:
ops.'push_pirop'(pirop, arglist :flat)
ops.'push_pirop'(pirop, posargs :flat)
.return (ops)
.end
Expand Down
8 changes: 0 additions & 8 deletions compilers/pct/src/PAST/Node.pir
Expand Up @@ -406,14 +406,6 @@ PIR opcodes that PAST "knows" about is in F<POST.pir>.
Get/set whether this node is an lvalue, or treats its first
child as an lvalue (e.g., for assignment).
=cut
.sub 'lvalue' :method
.param pmc value :optional
.param int has_value :opt_flag
.tailcall self.'attr'('lvalue', value, has_value)
.end
=item inline([STRING code])
Get/set the code to be used for inline PIR when C<pasttype> is
Expand Down
4 changes: 0 additions & 4 deletions compilers/pct/src/POST/Node.pir
Expand Up @@ -46,10 +46,6 @@ C<PCT::Node> (see F<compilers/pct/src/PCT/Node.pir>).

=over 4

=item result([value])

Get/set

=cut

.namespace [ 'POST';'Node' ]
Expand Down
13 changes: 7 additions & 6 deletions compilers/pirc/src/pircapi.c
Expand Up @@ -17,6 +17,9 @@
/* HEADERIZER BEGIN: static */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */

/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */


/*
Expand Down Expand Up @@ -72,16 +75,14 @@ open_file(ARGIN(char const * const filename), ARGIN(char const * const mode))
=item C<void parse_file(PARROT_INTERP, int flexdebug, FILE *infile, char * const
filename, int flags, int thr_id, unsigned macro_size, char * const outputfile)>
=cut
This will be the proper declaration after testing for thread-safety:
void parse_file(int flexdebug, FILE *infile, char * const filename, int flags,
char * const outputfile)
*/

=cut
*/

void
parse_file(PARROT_INTERP, int flexdebug, ARGIN(FILE *infile),
Expand Down Expand Up @@ -260,6 +261,8 @@ parse_string(PARROT_INTERP, ARGIN(char *pirstring), int flags, int pasminput,
=item C<PackFile_ByteCode * pirc_compile_file(PARROT_INTERP, const char
*filename, STRING **error_message)>
Returns NULL.
=cut
*/
Expand All @@ -274,8 +277,6 @@ pirc_compile_file(SHIM_INTERP, SHIM(const char *filename),
}


/* HEADERIZER END: static */


/*
Expand Down
2 changes: 1 addition & 1 deletion config/gen/core_pmcs.pm
Expand Up @@ -76,7 +76,7 @@ END_H
END_H
print {$OUT} coda();

close $OUT or die "Can't close file: $!";;
close $OUT or die "Can't close file: $!";

move_if_diff( "$file.tmp", $file );

Expand Down
6 changes: 5 additions & 1 deletion config/gen/makefiles/editor.in
@@ -1,4 +1,4 @@
# Copyright (C) 2005-2009, Parrot Foundation.
# Copyright (C) 2005-2010, Parrot Foundation.
# $Id$

#IF(win32):VIM_DIR = $(USERPROFILE)/vimfiles
Expand All @@ -13,6 +13,9 @@ CP = @cp@
MKPATH = @mkpath@
RM_F = @rm_f@

SKEL_FILE_DIR = `$(PERL) -e 'print "$(SKELETON)" || "$(VIM_DIR)"'`
LINE = "au BufNewFile *.pir 0r $(SKEL_FILE_DIR)/skeleton.pir"

default: all

all: pir.vim imc.kate skeleton.pir
Expand Down Expand Up @@ -49,6 +52,7 @@ vim-install: pir.vim skeleton.pir
$(CP) pmc.vim "$(VIM_SYN_DIR)"
$(MKPATH) "$(VIM_FT_DIR)"
$(CP) filetype_parrot.vim "$(VIM_FT_DIR)/parrot.vim"
echo $(LINE) >> "$(VIM_FT_DIR)/parrot.vim"
$(MKPATH) "$(VIM_IN_DIR)"
$(CP) indent_pir.vim "$(VIM_IN_DIR)/pir.vim"

Expand Down

0 comments on commit beb5efd

Please sign in to comment.