Skip to content

Commit

Permalink
Merge branch 'opsc_llvm' of github.com:parrot/parrot into opsc_llvm
Browse files Browse the repository at this point in the history
  • Loading branch information
bacek committed Mar 17, 2011
2 parents b75e23b + ecbda7c commit 99ec214
Show file tree
Hide file tree
Showing 55 changed files with 589 additions and 402 deletions.
2 changes: 1 addition & 1 deletion CREDITS
Expand Up @@ -434,7 +434,7 @@ D: Miscellaneous codingstd fixes
N: Gerd Pokorra
A: gerd
E: pokorra@uni-siegen.de
D: Release manager for 1.9.0, 2.3.0, 2.5.0, 2.8.0 and 2.9.0
D: Release manager for 1.9.0, 2.3.0, 2.5.0, 2.8.0, 2.9.0 and 3.2.0

N: Goplat
D: Win98 and other fixes.
Expand Down
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,5 +1,9 @@
#1

2011.03.15 Gerd
* Released 3.2.0
See NEWS for more.

2011.02.15 mikehh
* Released 3.1.0
See NEWS for more.
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.generated
@@ -1,11 +1,11 @@
# 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.3.1.0.dylib [main]lib
blib/lib/libparrot.3.2.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.3.1.0 [main]lib
blib/lib/libparrot.so.3.2.0 [main]lib
compilers/data_json/data_json.pbc [data_json]
config/gen/call_list/opengl.in []
docs/ops/bit.pod [doc]
Expand Down
3 changes: 2 additions & 1 deletion NEWS
Expand Up @@ -3,7 +3,8 @@ New in 3.2.0
+ Full support for Unicode filenames on Linux and Win32
+ The configuration option --cxx is gone
+ New Generational GC implemented. To enable it run Configure.pl --gc=gms
+ "opsc_full_parse" branch for semantically parse of ops is started
+ Now op definitions are semantically parsed. It opens possibilities for
future optimizations of parrot core.
+ A statement convert the '.param' PIR systax
+ A PMC is implemented for low-level buffer access which separate the
representation from the pointers
Expand Down
2 changes: 1 addition & 1 deletion README
@@ -1,4 +1,4 @@
This is Parrot, version 3.1.0
This is Parrot, version 3.2.0
------------------------------

Parrot is Copyright (C) 2001-2011, Parrot Foundation.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
3.1.0
3.2.0
3 changes: 2 additions & 1 deletion compilers/opsc/Defines.mak
Expand Up @@ -10,7 +10,8 @@ OPSC_SOURCES_GENERATED = \
$(OPSC_DIR)/gen/Ops/Op.pir \
$(OPSC_DIR)/gen/Ops/OpLib.pir \
$(OPSC_DIR)/gen/Ops/File.pir \
$(OPSC_DIR)/gen/Ops/Renumberer.pir
$(OPSC_DIR)/gen/Ops/Renumberer.pir \
$(OPSC_DIR)/gen/Ops/Util.pir

OPSC_SOURCES = \
$(OPSC_DIR)/opsc.pir \
Expand Down
3 changes: 3 additions & 0 deletions compilers/opsc/Rules.mak
Expand Up @@ -31,6 +31,9 @@ $(OPSC_DIR)/gen/Ops/Trans/C.pir: $(OPSC_DIR)/src/Ops/Trans/C.pm $(NQP_RX)
$(OPSC_DIR)/gen/Ops/Renumberer.pir: $(OPSC_DIR)/src/Ops/Renumberer.pm $(NQP_RX)
$(NQP_RX) --target=pir --output=$@ $(OPSC_DIR)/src/Ops/Renumberer.pm

$(OPSC_DIR)/gen/Ops/Util.pir: $(OPSC_DIR)/src/Ops/Util.pm $(NQP_RX)
$(NQP_RX) --target=pir --output=$@ $(OPSC_DIR)/src/Ops/Util.pm

# Target to force rebuild opsc from main Makefile
$(OPSC_DIR)/ops2c.nqp: $(LIBRARY_DIR)/opsc.pbc

Expand Down
54 changes: 47 additions & 7 deletions compilers/opsc/ops2c.nqp
Expand Up @@ -58,17 +58,54 @@ sub MAIN() {
)
!! undef;

my $f := Ops::File.new(|@files, :oplib($lib), :core($core), :quiet($quiet));
my $f;
my $do_dump_file := 0;
my $do_load := 1;
my $dump_file := $core ?? 'src/ops/ops.dump' !! @files[0] ~ ".dump";
if $opts<dump> {
try {
my $fh := open($dump_file, :r, :bin);
my $dump := $fh.readall;
$fh.close();

$f := pir::thaw__ps($dump);
$do_load := 0;

CATCH {
$quiet || pir::say("# Caught $!");
$do_dump_file := 1;
$f := undef;
};
}
}

$quiet || say("# Ops parsed in { pir::sprintf__ssp("%.3f", [pir::time__N() - $start_time] ) } seconds.");
if $do_load {
$f := Ops::File.new(|@files,
:oplib($lib),
:core($core),
:quiet($quiet),
);
}

my $emitter := Ops::Emitter.new(
:ops_file($f), :trans($trans),
:script('ops2c.nqp'), :file(@files[0]),
:flags( hash( core => $core, quiet => $quiet ) ),
);
if $do_dump_file {
$quiet || say("Dumping");
my $capture := Ops::Util::strip_source($f);
my $frozen := pir::freeze__sp($capture);

my $fh := open($dump_file, :w, :bin);
$fh.print($frozen);
$fh.close();
}

$quiet || say("# Ops parsed in { pir::sprintf__ssp("%.3f", [pir::time__N() - $start_time] ) } seconds.");

unless $debug {
my $emitter := Ops::Emitter.new(
:ops_file($f), :trans($trans),
:script('ops2c.nqp'), :file(@files[0]),
:flags( hash( core => $core, quiet => $quiet ) ),
);

$emitter.print_ops_num_files() if $core;
$emitter.print_c_header_files();
$emitter.print_c_source_file();
Expand Down Expand Up @@ -98,6 +135,9 @@ sub get_options() {
# suppress timing and debug output on stdout
$getopts.add_option('quiet', 'q');

# Use .dump files with parsed ops.
$getopts.add_option('dump', 'D');

$getopts.get_options(pir::getinterp__p()[2]);
}

Expand Down
1 change: 1 addition & 0 deletions compilers/opsc/opsc.pir
Expand Up @@ -17,6 +17,7 @@
.include 'compilers/opsc/gen/Ops/File.pir'
.include 'compilers/opsc/gen/Ops/Renumberer.pir'

.include 'compilers/opsc/gen/Ops/Util.pir'

.namespace []
.sub 'main' :main
Expand Down
10 changes: 9 additions & 1 deletion compilers/opsc/src/Ops/Compiler/Actions.pm
Expand Up @@ -104,7 +104,7 @@ method op ($/, $key?) {
my @variants := expand_args(pir::clone__PP($OP<normalized_args>));
if @variants {
for @variants {
my $new_op := pir::clone__PP($OP);
my $new_op := deep_clone($OP);
$new_op<arg_types> := $_;
$past.push($new_op);
}
Expand All @@ -117,6 +117,12 @@ method op ($/, $key?) {
}
}

sub deep_clone($thingy) {
Ops::Util::process_recursive($thingy, -> $_ {
$_.WHAT.new;
});
}

# Normalize args
# For each arg produce LoL of all available variants
# E.g. "in" will produce "i" and "ic" variants
Expand Down Expand Up @@ -167,6 +173,8 @@ sub normalize_args(@args) {
$res<direction> := 'o';
}

#$arg<type> := $res<type>;

@result.push($res);
}
@result;
Expand Down
4 changes: 2 additions & 2 deletions compilers/opsc/src/Ops/File.pm
Expand Up @@ -181,7 +181,7 @@ ops file.

=end

method new(*@files, :$oplib, :$core!, :$nolines, :$quiet? = 0) {
method new(*@files, :$oplib, :$core, :$nolines, :$quiet? = 0) {
self<files> := @files;
self<core> := $core;
self<ops> := list(); # Ops
Expand Down Expand Up @@ -258,7 +258,7 @@ method compile_ops($str, :$experimental? = 0) {
my $past := $compiler.compile($str, :target('past'));

for @($past<ops>) {
$_<experimental> := $experimental;
$_<experimental> := ?$experimental;
self<ops>.push($_);
#say($_.full_name ~ " is number " ~ self<op_order>);
self<op_order>++;
Expand Down
58 changes: 58 additions & 0 deletions compilers/opsc/src/Ops/Util.pm
@@ -0,0 +1,58 @@
module Ops::Util;

=begin Description
Various utility functions.
=end Description

sub process_recursive($op, &ctor) {
my $res;
if pir::isnull($op) {
$res := $op;
}
elsif pir::isa($op, 'Capture') {
$res := &ctor($op);
pir::push($res, process_recursive($_, &ctor)) for @($op);
$res{$_} := process_recursive($op{$_}, &ctor) for $op.hash.keys;
}
elsif pir::does($op, 'array') {
$res := $op.map(->$_ { process_recursive($_, &ctor) });
}
else {
$res := pir::clone($op);
}
$res;
}

sub from_capture($capture) {
process_recursive($capture, -> $c {
my $what := $c<WHAT>;
$c.hash.delete('WHAT');
$what := pir::substr($what, 0, pir::length($what) - 2);
my @parts := split('::', $what);

my $WHAT := pir::get_hll_global__pps(@parts, @parts.pop);
$WHAT.new;
});
}

sub to_capture($op) {
process_recursive($op, -> $_ {
my $what := ~$_.WHAT;
$_ := pir::new('Capture');
$_<WHAT> := $what;
$_.hash.delete('source');
$_
});
}

sub strip_source($op) {
process_recursive($op, -> $c {
Q:PIR {
$P1 = find_lex '$c'
delete $P1['source']
};
pir::clone($c);
});
}

# vim: ft=perl6
24 changes: 14 additions & 10 deletions config/gen/makefiles/root.in
Expand Up @@ -2502,8 +2502,8 @@ bsdlint : $(PARROT)
$(LINT) $(CC_INC) "-Iinclude/pmc" $(BSD_LINT_FLAGS) $(BSD_LINT_EXCLUSIONS) $(LINTABLE_CFILES)

# For checking with splint see also
# http:////trac.parrot.org/parrot/wiki/splint
# Splint: http:////splint.org
# http://trac.parrot.org/parrot/wiki/splint
# Splint: http://splint.org
SPLINT = splint

# Temp directory for splint. Add +keep to splintflags if you want work files
Expand All @@ -2516,14 +2516,16 @@ SPLINT_TMP = $(TEMPDIR)/splint
# looking for "declundef", except that it's "decl-undef" in the docs.
SPLINTFLAGS_BASE = \
+standard \
-hints \
+hints \
\
+indentspaces 4 \
+locindentspaces 4 \
+linelen 120 \
+linelen 999 \
+bugslimit 1000 \
-message-stream-stdout \
+showdeephistory \
-showfunc \
+show-func \
+show-column \
-tmpdir $(SPLINT_TMP) \
\
+posix-lib \
Expand All @@ -2546,12 +2548,14 @@ SPLINTFLAGS_BASE = \
# Memory safety checks
# Transfer errors (-mem-trans) are too tough for us right now
SPLINTFLAGS_MEMORY_SAFETY = \
-mem-trans \
-memchecks \
+bufferoverflow \
+bufferoverflowhigh \
+read-only-strings \
+read-only-trans \
+strict-destroy \
+strict-use-released \
-strict-destroy \
-strict-use-released \
+use-released \
-must-free \
-mustfreefresh \
Expand All @@ -2562,7 +2566,6 @@ SPLINTFLAGS_MEMORY_SAFETY = \
-ptr-arith \
+ptr-negate \
-zero-ptr \
-mem-trans

# Macro safety checks
SPLINTFLAGS_MACRO_SAFETY = \
Expand All @@ -2586,6 +2589,7 @@ SPLINTFLAGS_BOOLEAN_SLOP = \
-pred-bool-ptr \
-pred-bool-others \
-boolops \
+bool-int \

# const and other qualifiers
# Report qualifier mismatches only if dangerous (+relax-quals)
Expand Down Expand Up @@ -2644,8 +2648,8 @@ SPLINTFLAGS = \
$(SPLINTFLAGS_EVALUATION) \
$(SPLINTFLAGS_TYPES) \

#SPLINT_SOURCE = `echo $(O_FILES) | $(PERL) -pe @PQ@s/\.o/\.c/g@PQ@`
SPLINT_SOURCE = `echo src/*.c`
#SPLINT_SOURCE = `echo $(O_FILES) | $(PERL) -pe @PQ@s/\.o/\.c/g@PQ@ | sort`
SPLINT_SOURCE = $$(find src/*.c src/{io,packfile,string}/*.c -type f | grep -v extra_nci_thunks.c | grep -v extend_vtable.c | sort)

# "splint" is the less-thorough splint target. For cage cleaning work,
# you'll probably want to specify SPLINT_SOURCE rather than work on the
Expand Down
2 changes: 1 addition & 1 deletion docs/parrotbyte.pod
Expand Up @@ -328,6 +328,6 @@ mentioned in some of the early Parrot documents.

=head1 SEE ALSO

F<packfile.c>, F<packfile.h>, F<packout.c>, F<packdump.c>, F<pf/*.c>, and the
F<packfile.c>, F<packfile.h>, F<packdump.c>, F<pf/*.c>, and the
B<pbc_dump> utility F<pbc_dump.c>.

1 change: 1 addition & 0 deletions docs/parrothist.pod
Expand Up @@ -123,5 +123,6 @@ Starred release numbers indicate supported releases.

cotto 3.0.0 * 2011-Jan-18 "Beef Stew"
mikehh 3.1.0 2011-Feb-15 "Budgerigar"
Gerd 3.2.0 2011-Mar-15 "Nanday Parakeet"

=cut
7 changes: 3 additions & 4 deletions docs/project/release_manager_guide.pod
Expand Up @@ -346,9 +346,9 @@ the resources/ and html/ directories created in docs/.
ssh into the parrotvm, and in the
webroot for docs.parrot.org, expand these into a release directory (e.g.
1.4.0). in <webroot>/parrot, there are symbolic links for latest, supported,
and devel. Update the devel symlink to point to your new directory.
If this is a supported release, also update the supported symlink. Do not delete
any old copies of the docs, don't update the other symlinks.
and devel. Update the C<latest> symlink to point to your new directory.
If this is a supported release, also update the C<supported> symlink.
Do not delete any old copies of the docs, don't update the other symlinks.

=back

Expand Down Expand Up @@ -448,7 +448,6 @@ L<http://www.google.com/calendar/render?cid=ldhctdamsgfg5a1cord52po9h8@group.cal

Versions with a asterisk (*) are supported releases.

- Mar 15, 2011 - 3.2 - gerd
- Apr 19, 2011 - 3.3* - whiteknight
- May 17, 2011 - 3.4 - gerd
- Jun 21, 2011 - 3.5 - cotto
Expand Down
2 changes: 1 addition & 1 deletion docs/translations/README.BGR
@@ -1,4 +1,4 @@
Това е Parrot, версия 2.10.1
Това е Parrot, версия 3.2.0
-----------------------------

Parrot is Copyright (C) 2001-2010, Parrot Foundation.
Expand Down
2 changes: 1 addition & 1 deletion docs/translations/README.deutsch
@@ -1,4 +1,4 @@
Parrot-Version 3.0.0
Parrot-Version 3.2.0
--------------------

Parrot ist lizenziert (C) 2001-2011, Parrot Foundation.
Expand Down

0 comments on commit 99ec214

Please sign in to comment.