[svn:parrot] r43153 - in branches/noalignptrs: . config/auto config/auto/alignptrs config/gen/config_h config/gen/config_pm lib/Parrot/Configure/Step src/pmc t/steps/auto

jkeenan at svn.parrot.org jkeenan at svn.parrot.org
Sat Dec 19 04:03:03 UTC 2009


Author: jkeenan
Date: Sat Dec 19 04:02:54 2009
New Revision: 43153
URL: https://trac.parrot.org/parrot/changeset/43153

Log:
See what happens when we eliminate configuration step auto::alignptrs. (http://trac.parrot.org/parrot/ticket/1382)

Deleted:
   branches/noalignptrs/config/auto/alignptrs.pm
   branches/noalignptrs/config/auto/alignptrs/test_c.in
   branches/noalignptrs/t/steps/auto/alignptrs-01.t
   branches/noalignptrs/t/steps/auto/alignptrs-02.t
Modified:
   branches/noalignptrs/MANIFEST
   branches/noalignptrs/config/gen/config_h/config_h.in
   branches/noalignptrs/config/gen/config_pm/myconfig.in
   branches/noalignptrs/lib/Parrot/Configure/Step/List.pm
   branches/noalignptrs/src/pmc/unmanagedstruct.pmc

Modified: branches/noalignptrs/MANIFEST
==============================================================================
--- branches/noalignptrs/MANIFEST	Sat Dec 19 03:34:49 2009	(r43152)
+++ branches/noalignptrs/MANIFEST	Sat Dec 19 04:02:54 2009	(r43153)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Dec 16 15:31:13 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Sat Dec 19 03:44:59 2009 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -201,8 +201,6 @@
 compilers/tge/TGE/Rule.pir                                  [tge]
 compilers/tge/TGE/Tree.pir                                  [tge]
 compilers/tge/tgc.pir                                       [tge]
-config/auto/alignptrs.pm                                    []
-config/auto/alignptrs/test_c.in                             []
 config/auto/arch.pm                                         []
 config/auto/attributes.pm                                   []
 config/auto/attributes/test_c.in                            []
@@ -1979,8 +1977,6 @@
 t/src/exit.t                                                [test]
 t/src/extend.t                                              [test]
 t/src/warnings.t                                            [test]
-t/steps/auto/alignptrs-01.t                                 [test]
-t/steps/auto/alignptrs-02.t                                 [test]
 t/steps/auto/arch-01.t                                      [test]
 t/steps/auto/attributes-01.t                                [test]
 t/steps/auto/backtrace-01.t                                 [test]

Deleted: branches/noalignptrs/config/auto/alignptrs.pm
==============================================================================
--- branches/noalignptrs/config/auto/alignptrs.pm	Sat Dec 19 04:02:54 2009	(r43152)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,110 +0,0 @@
-# Copyright (C) 2001-2005, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-config/auto/alignptrs.pm - pointer alignment
-
-=head1 DESCRIPTION
-
-Determine the minimum pointer alignment.
-
-=cut
-
-package auto::alignptrs;
-
-use strict;
-use warnings;
-
-use base qw(Parrot::Configure::Step);
-
-use Parrot::Configure::Utils ':auto';
-
-sub _init {
-    my $self = shift;
-    my %data;
-    $data{description} = q{Determine your minimum pointer alignment};
-    $data{result}      = q{};
-    return \%data;
-}
-
-sub runstep {
-    my ( $self, $conf ) = ( shift, shift );
-
-    my $result_str = '';
-    my $align;
-    if ( defined( $conf->data->get('ptr_alignment') ) ) {
-        $align = $conf->data->get('ptr_alignment');
-        $result_str .= "configured: ";
-    }
-    elsif ( $conf->data->get('OSNAME_provisional') eq 'hpux'
-            && $conf->data->get('ccflags_provisional') !~ /DD64/ ) {
-
-        # HP-UX 10.20/32 hangs in this test.
-        $align = 4;
-        $conf->data->set( ptr_alignment => $align );
-        $result_str .= "for hpux: ";
-    }
-    else {
-
-        # Now really test by compiling some code
-        $conf->cc_gen('config/auto/alignptrs/test_c.in');
-        $conf->cc_build();
-        my $minimum_valid_align;
-        my @aligns = (1, 2, 4, 8, 16, 32, 64);
-        TRY_ALIGN: while ( defined( my $try_align = shift(@aligns) ) ) {
-            my $results = $conf->cc_run_capture($try_align);
-            $align = _evaluate_results($results, $try_align);
-            if (defined $align) {
-                $minimum_valid_align = $align;
-                last TRY_ALIGN;
-            }
-            else {
-                next TRY_ALIGN;
-            }
-        }
-        $conf->cc_clean();
-
-        _evaluate_ptr_alignment($conf, $minimum_valid_align);
-
-        # If at this point we haven't died, then we can assign
-        # $minimum_valid_align to $align.
-        $align = $minimum_valid_align;
-    }
-
-    $self->_finalize_result_str($align, $result_str);
-
-    return 1;
-}
-
-sub _evaluate_results {
-    my ($results, $try_align) = @_;
-    my $align;
-    if ( $results =~ /OK/ && $results !~ /align/i ) {
-        $align = $try_align;
-    }
-    return $align;
-}
-
-sub _evaluate_ptr_alignment {
-    my ($conf, $minimum_valid_align) = @_;
-    die "Can't determine alignment!\n" unless defined $minimum_valid_align;
-    $conf->data->set( ptr_alignment => $minimum_valid_align );
-}
-
-sub _finalize_result_str {
-    my $self = shift;
-    my ($align, $result_str) = @_;
-    $result_str .= " $align byte";
-    $result_str .= "s" unless $align == 1;
-    $self->set_result($result_str);
-}
-
-1;
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Deleted: branches/noalignptrs/config/auto/alignptrs/test_c.in
==============================================================================
--- branches/noalignptrs/config/auto/alignptrs/test_c.in	Sat Dec 19 04:02:54 2009	(r43152)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,63 +0,0 @@
-/*
-Copyright (C) 2002-2009, Parrot Foundation.
-$Id$
-
-figure out our minimum pointer alignment
-*/
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <signal.h>
-/* Try to catch bus errors */
-#ifdef SIGBUS
-#  include <stdlib.h>
-void bletch(int s) { exit(1); }
-#endif
-
-int
-main(int argc, char **argv)
-{
-    int i;
-    char *c;
-
-    long space[32];
-    void **ptr;
-
-    int align = 0;
-
-    if (argc != 2) {
-        printf("FAILED - single command-line parameter required!\n");
-        return 1;
-    }
-
-#ifdef SIGBUS
-    signal(SIGBUS, bletch);
-#endif
-
-    for (i = 0; i < 32; i ++) space[i] = 0;
-
-    for (c = argv[1]; *c; c++) align = align * 10 + ((int)*c - '0');
-
-#if defined(__alpha)
-    if (align < 8) {
-        printf("Soft failure hack for systems that simulate unaligned access\n");
-        return 1;
-    }
-#endif
-
-    ptr = (void **)((char *)space + align);
-
-    if (*ptr == (void *)0)
-        printf("%d OK\n", align);
-    else
-        printf("%d OK but didnt equal zero\n", align);
-
-    return 0;
-}
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/noalignptrs/config/gen/config_h/config_h.in
==============================================================================
--- branches/noalignptrs/config/gen/config_h/config_h.in	Sat Dec 19 03:34:49 2009	(r43152)
+++ branches/noalignptrs/config/gen/config_h/config_h.in	Sat Dec 19 04:02:54 2009	(r43153)
@@ -94,7 +94,6 @@
 #define PARROT_OS_NAME          "@jitosname@"
 #define PARROT_BYTEORDER        0x at byteorder@
 #define PARROT_BIGENDIAN        @bigendian@
-#define PARROT_PTR_ALIGNMENT    @ptr_alignment@
 
 #define PARROT_LITTLEENDIAN	!(PARROT_BIGENDIAN)
 

Modified: branches/noalignptrs/config/gen/config_pm/myconfig.in
==============================================================================
--- branches/noalignptrs/config/gen/config_pm/myconfig.in	Sat Dec 19 03:34:49 2009	(r43152)
+++ branches/noalignptrs/config/gen/config_pm/myconfig.in	Sat Dec 19 04:02:54 2009	(r43153)
@@ -17,5 +17,5 @@
     load_ext='@load_ext@', ld_load_flags='@ld_load_flags@'
   Types:
     iv=@iv@, intvalsize=@intvalsize@, intsize=@intsize@, opcode_t=@opcode_t@, opcode_t_size=@opcode_t_size@,
-    ptrsize=@ptrsize@, ptr_alignment=@ptr_alignment@ byteorder=@byteorder@, 
+    ptrsize=@ptrsize@,  byteorder=@byteorder@, 
     nv=@nv@, numvalsize=@numvalsize@, doublesize=@doublesize@, longdoublesize=@hugefloatvalsize@

Modified: branches/noalignptrs/lib/Parrot/Configure/Step/List.pm
==============================================================================
--- branches/noalignptrs/lib/Parrot/Configure/Step/List.pm	Sat Dec 19 03:34:49 2009	(r43152)
+++ branches/noalignptrs/lib/Parrot/Configure/Step/List.pm	Sat Dec 19 04:02:54 2009	(r43153)
@@ -31,7 +31,6 @@
     inter::types
     auto::ops
     auto::pmc
-    auto::alignptrs
     auto::headers
     auto::sizes
     auto::byteorder

Modified: branches/noalignptrs/src/pmc/unmanagedstruct.pmc
==============================================================================
--- branches/noalignptrs/src/pmc/unmanagedstruct.pmc	Sat Dec 19 03:34:49 2009	(r43152)
+++ branches/noalignptrs/src/pmc/unmanagedstruct.pmc	Sat Dec 19 04:02:54 2009	(r43153)
@@ -185,7 +185,9 @@
             /* now point ptr to the real data */
             if (*type == enum_type_struct_ptr) {
                 /* that is either a pointer */
+                /*
                 PARROT_ASSERT((PTR2INTVAL(p) & (PARROT_PTR_ALIGNMENT - 1)) == 0);
+                */
                 VTABLE_set_pointer(interp, init, *(void**)p);
             }
 
@@ -199,7 +201,9 @@
              * p is the location of the struct pointer in the
              * outer struct, the inner is at PMC_data(init) */
 
+            /*
             PARROT_ASSERT((PTR2INTVAL(p) & (PARROT_PTR_ALIGNMENT - 1)) == 0);
+            */
             *(void **)p = VTABLE_get_pointer(interp, init);
         }
 

Deleted: branches/noalignptrs/t/steps/auto/alignptrs-01.t
==============================================================================
--- branches/noalignptrs/t/steps/auto/alignptrs-01.t	Sat Dec 19 04:02:54 2009	(r43152)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,96 +0,0 @@
-#! perl
-# Copyright (C) 2007, Parrot Foundation.
-# $Id$
-# auto/alignptrs-01.t
-
-use strict;
-use warnings;
-use Test::More tests => 12;
-use Carp;
-use lib qw( lib t/configure/testlib );
-use_ok('config::auto::alignptrs');
-use Parrot::Configure::Options qw( process_options );
-use Parrot::Configure::Step::Test;
-use Parrot::Configure::Test qw(
-    test_step_constructor_and_description
-);
-
-
-########## regular; singular ##########
-
-my ($args, $step_list_ref) = process_options(
-    {
-        argv => [ ],
-        mode => q{configure},
-    }
-);
-
-my $conf = Parrot::Configure::Step::Test->new;
-$conf->include_config_results( $args );
-
-my $serialized = $conf->pcfreeze();
-
-my $pkg = q{auto::alignptrs};
-$conf->add_steps($pkg);
-$conf->options->set( %{$args} );
-my $step = test_step_constructor_and_description($conf);
-my $align = 1;
-$conf->data->set('ptr_alignment' => $align);
-my $ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
-is($step->result(), qq{configured:  $align byte}, "Expected result was set");
-
-$conf->replenish($serialized);
-
-########## regular; plural ##########
-
-($args, $step_list_ref) = process_options(
-    {
-        argv => [ ],
-        mode => q{configure},
-    }
-);
-
-$conf->add_steps($pkg);
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-$align = 2;
-$conf->data->set('ptr_alignment' => $align);
-$ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
-is($step->result(), qq{configured:  $align bytes}, "Expected result was set");
-
-pass("Completed all tests in $0");
-
-################### DOCUMENTATION ###################
-
-=head1 NAME
-
-auto/alignptrs-01.t - test auto::alignptrs
-
-=head1 SYNOPSIS
-
-    % prove t/steps/auto/alignptrs-01.t
-
-=head1 DESCRIPTION
-
-The files in this directory test functionality used by F<Configure.pl>.
-
-The tests in this file test auto::alignptrs.
-
-=head1 AUTHOR
-
-James E Keenan
-
-=head1 SEE ALSO
-
-config::auto::alignptrs, F<Configure.pl>.
-
-=cut
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Deleted: branches/noalignptrs/t/steps/auto/alignptrs-02.t
==============================================================================
--- branches/noalignptrs/t/steps/auto/alignptrs-02.t	Sat Dec 19 04:02:54 2009	(r43152)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,117 +0,0 @@
-#! perl
-# Copyright (C) 2007, Parrot Foundation.
-# $Id$
-# auto/alignptrs-02.t
-
-use strict;
-use warnings;
-use Test::More tests =>  13;
-use Carp;
-use lib qw( lib t/configure/testlib );
-use_ok('config::auto::alignptrs');
-use Parrot::Configure::Options qw( process_options );
-use Parrot::Configure::Step::Test;
-use Parrot::Configure::Test qw(
-    test_step_constructor_and_description
-);
-
-########## mock hpux ##########
-
-my ($args, $step_list_ref) = process_options(
-    {
-        argv => [ ],
-        mode => q{configure},
-    }
-);
-
-my $conf = Parrot::Configure::Step::Test->new;
-$conf->include_config_results( $args );
-
-my $pkg = q{auto::alignptrs};
-
-$conf->add_steps($pkg);
-$conf->options->set( %{$args} );
-my $step = test_step_constructor_and_description($conf);
-
-my $serialized = $conf->pcfreeze();
-
-{
-    $conf->data->set( ptr_alignment => undef );
-    $conf->data->set( OSNAME_provisional => 'hpux' );
-    my $ret = $step->runstep($conf);
-    ok( $ret, "runstep() returned true value" );
-    if ( $conf->data->get('ccflags_provisional') !~ /DD64/ ) {
-        is($conf->data->get('ptr_alignment'), 4,
-            "Got expected pointer alignment for HP Unix");
-        is($step->result(), qq{for hpux:  4 bytes},
-            "Expected result was set");
-    } else {
-        pass("Cannot mock \%Config");
-        pass("Cannot mock \%Config");
-    }
-}
-
-$conf->replenish($serialized);
-
-########## _evaluate_ptr_alignment()  ##########
-
-my $align = 2;
-auto::alignptrs::_evaluate_ptr_alignment($conf, $align);
-is($conf->data->get( 'ptr_alignment' ), 2,
-    "Got expected pointer alignment");
-
-$conf->replenish($serialized);
-
-########## _evaluate_ptr_alignment()  ##########
-
-$align = undef;
-eval { auto::alignptrs::_evaluate_ptr_alignment($conf, $align); };
-like($@, qr/Can't determine alignment!/, #'
-    "Got expected 'die' message");
-
-$conf->replenish($serialized);
-
-########## _evaluate_results()  ##########
-
-my ($results, $try_align);
-is(auto::alignptrs::_evaluate_results(q{OK}, 2), 2,
-    "Got expected alignment");
-is(auto::alignptrs::_evaluate_results(q{OK align}, 2), undef,
-    "Got undef as expected");
-is(auto::alignptrs::_evaluate_results(q{foobar}, 2), undef,
-    "Got undef as expected");
-
-pass("Completed all tests in $0");
-
-################### DOCUMENTATION ###################
-
-=head1 NAME
-
-auto/alignptrs-02.t - test auto::alignptrs
-
-=head1 SYNOPSIS
-
-    % prove t/steps/auto/alignptrs-02.t
-
-=head1 DESCRIPTION
-
-The files in this directory test functionality used by F<Configure.pl>.
-
-The tests in this file test auto::alignptrs.
-
-=head1 AUTHOR
-
-James E Keenan
-
-=head1 SEE ALSO
-
-config::auto::alignptrs, F<Configure.pl>.
-
-=cut
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:


More information about the parrot-commits mailing list