[svn:parrot] r46633 - in branches/ops_pct: . config/auto config/gen/makefiles lib/Parrot/Configure/Options lib/Parrot/Configure/Options/Conf lib/Parrot/Configure/Step runtime/parrot/library/HTTP src t/steps/auto

bacek at svn.parrot.org bacek at svn.parrot.org
Sat May 15 02:05:16 UTC 2010


Author: bacek
Date: Sat May 15 02:05:16 2010
New Revision: 46633
URL: https://trac.parrot.org/parrot/changeset/46633

Log:
Merge branch 'master' into ops_pct_local

Added:
   branches/ops_pct/config/auto/extra_nci_thunks.pm
   branches/ops_pct/t/steps/auto/extra_nci_thunks-01.t
Modified:
   branches/ops_pct/Configure.pl
   branches/ops_pct/config/gen/makefiles/root.in
   branches/ops_pct/lib/Parrot/Configure/Options/Conf.pm
   branches/ops_pct/lib/Parrot/Configure/Options/Conf/Shared.pm
   branches/ops_pct/lib/Parrot/Configure/Step/List.pm
   branches/ops_pct/runtime/parrot/library/HTTP/Message.pir
   branches/ops_pct/src/global_setup.c

Modified: branches/ops_pct/Configure.pl
==============================================================================
--- branches/ops_pct/Configure.pl	Sat May 15 02:03:36 2010	(r46632)
+++ branches/ops_pct/Configure.pl	Sat May 15 02:05:16 2010	(r46633)
@@ -625,6 +625,7 @@
     auto::signal
     auto::socklen_t
     auto::env
+    auto::extra_nci_thunks
     auto::gmp
     auto::readline
     auto::pcre

Added: branches/ops_pct/config/auto/extra_nci_thunks.pm
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/ops_pct/config/auto/extra_nci_thunks.pm	Sat May 15 02:05:16 2010	(r46633)
@@ -0,0 +1,54 @@
+# Copyright (C) 2010, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+config/auto/extra_nci_thunks - Static NCI Frame Building
+
+=head1 DESCRIPTIONo
+
+If C<--without-extra-nci-thunks> is specified, builds parrot without NCI thunks
+not required by core.
+
+=cut
+
+package auto::extra_nci_thunks;
+
+use strict;
+use warnings;
+
+use base 'Parrot::Configure::Step';
+
+sub _init {
+    my $self = shift;
+    return {
+	description => 'Determine whether to build extra NCI thunks',
+    };
+}
+
+sub runstep {
+    my ($self, $conf) = @_;
+    my $without = $conf->options->get( 'without-extra-nci-thunks' );
+
+    if ($without) {
+	$conf->data->set( has_extra_nci_thunks => 0 );
+	$conf->data->set( HAS_EXTRA_NCI_THUNKS => 0 );
+	$self->set_result( 'no' );
+    }
+    else {
+	$conf->data->set( has_extra_nci_thunks => 1 );
+	$conf->data->set( HAS_EXTRA_NCI_THUNKS => 1 );
+	$self->set_result( 'yes' );
+    }
+
+    return 1;
+}
+
+1;
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/ops_pct/config/gen/makefiles/root.in
==============================================================================
--- branches/ops_pct/config/gen/makefiles/root.in	Sat May 15 02:03:36 2010	(r46632)
+++ branches/ops_pct/config/gen/makefiles/root.in	Sat May 15 02:05:16 2010	(r46633)
@@ -472,7 +472,7 @@
     src/frame_builder$(O) \
     src/nci/api$(O) \
     src/nci/core_thunks$(O) \
-    src/nci/extra_thunks$(O) \
+#IF(has_extra_nci_thunks): src/nci/extra_thunks$(O) \
     src/oo$(O) \
     src/packfile$(O) \
     src/packout$(O) \
@@ -652,7 +652,7 @@
     src/frame_builder.str \
     src/nci/api.str \
     src/nci/core_thunks.str \
-    src/nci/extra_thunks.str \
+#IF(has_extra_nci_thunks): src/nci/extra_thunks.str \
     src/packfile.str \
     src/pmc.str \
     src/pmc_freeze.str \
@@ -1746,6 +1746,14 @@
 testr : test_prep
 	$(PERL) t/harness $(EXTRA_TEST_ARGS) -r $(RUNCORE_TEST_FILES)
 
+# normal core, write and run PASM
+testp : test_prep
+	$(PERL) t/harness $(EXTRA_TEST_ARGS) -r $(RUNCORE_TEST_FILES)
+
+# normal core, optimization level 1
+testO1 : test_prep
+	$(PERL) t/harness $(EXTRA_TEST_ARGS) -O1 $(RUNCORE_TEST_FILES)
+
 # test the EXEC stuff
 testexec: test_prep
 	$(PERL) t/harness $(EXTRA_TEST_ARGS) --run-exec $(RUNCORE_TEST_FILES)

Modified: branches/ops_pct/lib/Parrot/Configure/Options/Conf.pm
==============================================================================
--- branches/ops_pct/lib/Parrot/Configure/Options/Conf.pm	Sat May 15 02:03:36 2010	(r46632)
+++ branches/ops_pct/lib/Parrot/Configure/Options/Conf.pm	Sat May 15 02:05:16 2010	(r46633)
@@ -95,6 +95,9 @@
    --execcapable        Use JIT to emit a native executable
    --without-threads    Build parrot without thread support
    --buildframes        Dynamically build NCI call frames
+   --without-extra-nci-thunks
+                        Build parrot without unnecessary
+                        statically compiled NCI call frames
 
 External Library Options:
 

Modified: branches/ops_pct/lib/Parrot/Configure/Options/Conf/Shared.pm
==============================================================================
--- branches/ops_pct/lib/Parrot/Configure/Options/Conf/Shared.pm	Sat May 15 02:03:36 2010	(r46632)
+++ branches/ops_pct/lib/Parrot/Configure/Options/Conf/Shared.pm	Sat May 15 02:05:16 2010	(r46633)
@@ -72,6 +72,7 @@
     verbose-step
     version
     without-crypto
+    without-extra-nci-thunks
     without-gdbm
     without-gettext
     without-gmp

Modified: branches/ops_pct/lib/Parrot/Configure/Step/List.pm
==============================================================================
--- branches/ops_pct/lib/Parrot/Configure/Step/List.pm	Sat May 15 02:03:36 2010	(r46632)
+++ branches/ops_pct/lib/Parrot/Configure/Step/List.pm	Sat May 15 02:05:16 2010	(r46633)
@@ -48,6 +48,7 @@
     auto::socklen_t
     auto::neg_0
     auto::env
+    auto::extra_nci_thunks
     auto::thread
     auto::gmp
     auto::readline

Modified: branches/ops_pct/runtime/parrot/library/HTTP/Message.pir
==============================================================================
--- branches/ops_pct/runtime/parrot/library/HTTP/Message.pir	Sat May 15 02:03:36 2010	(r46632)
+++ branches/ops_pct/runtime/parrot/library/HTTP/Message.pir	Sat May 15 02:05:16 2010	(r46633)
@@ -14,6 +14,8 @@
 
 =over 4
 
+=item time2str
+
 =cut
 
 .namespace ['HTTP';'Date']
@@ -48,9 +50,9 @@
     .return ($S0)
 .end
 
-=head3 Class HTTP;Headers
+=back
 
-=over 4
+=head3 Class HTTP;Headers
 
 =cut
 
@@ -60,13 +62,12 @@
     $P0 = subclass 'Hash', ['HTTP';'Headers']
 .end
 
-=back
-
 =head3 Class HTTP;Message
 
 =over 4
 
 =cut
+
 .namespace ['HTTP';'Message']
 
 .sub '' :init :load :anon
@@ -374,7 +375,7 @@
 
 =head1 AUTHOR
 
-Francois Perrad
+Franc§ois Perrad
 
 =cut
 

Modified: branches/ops_pct/src/global_setup.c
==============================================================================
--- branches/ops_pct/src/global_setup.c	Sat May 15 02:03:36 2010	(r46632)
+++ branches/ops_pct/src/global_setup.c	Sat May 15 02:05:16 2010	(r46633)
@@ -194,7 +194,9 @@
     pmc = Parrot_pmc_new(interp, enum_class_Hash);
     VTABLE_set_pmc_keyed_int(interp, iglobals, IGLOBALS_NCI_FUNCS, pmc);
     Parrot_nci_load_core_thunks(interp);
+#if PARROT_HAS_EXTRA_NCI_THUNKS
     Parrot_nci_load_extra_thunks(interp);
+#endif
 }
 
 /*

Added: branches/ops_pct/t/steps/auto/extra_nci_thunks-01.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/ops_pct/t/steps/auto/extra_nci_thunks-01.t	Sat May 15 02:05:16 2010	(r46633)
@@ -0,0 +1,86 @@
+#! perl
+# Copyright (C) 2010, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+auto/extra_nci_thunks-01.t - test auto::extra_nci_thunks
+
+=head1 SYNOPSIS
+
+    % prove t/steps/auto/extra_nci_thunks-01.t
+
+=head1 DESCRIPTION
+
+The files in this directory test functionality used by F<Configure.pl>.
+
+The tests in this file test auto::extra_nci_thunks.
+
+=head1 SEE ALSO
+
+config::auto::libjit, F<Configure.pl>.
+
+=cut
+
+use strict;
+use warnings;
+
+use Test::More tests => 21;
+
+use lib qw( lib t/configure/testlib );
+use Parrot::Configure;
+use Parrot::Configure::Options 'process_options';
+use Parrot::Configure::Test qw(
+    test_step_thru_runstep
+    rerun_defaults_for_testing
+    test_step_constructor_and_description
+);
+
+use_ok('config::init::defaults');
+use_ok('config::auto::extra_nci_thunks');
+
+my ($args, $step_list_ref) = process_options( {
+	    argv => [ q{--without-extra-nci-thunks} ],
+	    mode => 'configure',
+} );
+
+my $conf = Parrot::Configure->new;
+my $serialized = $conf->pcfreeze();
+
+test_step_thru_runstep( $conf, 'init::defaults', $args );
+
+my $pkg = 'auto::extra_nci_thunks';
+my ($step, $ret);
+
+$conf->add_steps($pkg);
+$conf->options->set(%$args);
+$step = test_step_constructor_and_description($conf);
+$ret = $step->runstep($conf);
+ok( $ret, "runstep() returned true value" );
+is( $step->result(), 'no', "Result is 'no', as expected" );
+is( $conf->data->get( 'HAS_EXTRA_NCI_THUNKS' ), 0,
+    "Got the expected result with '--without-extra-nci-thunks' option" );
+
+$conf->replenish($serialized);
+
+($args, $step_list_ref) = process_options( {
+	    argv => [ ],
+	    mode => 'configure',
+} );
+rerun_defaults_for_testing($conf, $args);
+$conf->add_steps($pkg);
+$conf->options->set( %{$args} );
+$step = test_step_constructor_and_description($conf);
+$ret = $step->runstep($conf);
+ok( $ret, "runstep() returned a true value" );
+is( $step->result(), 'yes', "Default result is 'yes' as expected" );
+is( $conf->data->get( 'has_extra_nci_thunks' ), 1,
+    "Get the expected result without '--without-extra-nci-thunks' option" );
+
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:


More information about the parrot-commits mailing list