[svn:parrot] r41338 - in branches/kill_jit: . config/auto config/auto/frames config/auto/jit

darbelo at svn.parrot.org darbelo at svn.parrot.org
Fri Sep 18 20:48:56 UTC 2009


Author: darbelo
Date: Fri Sep 18 20:48:55 2009
New Revision: 41338
URL: https://trac.parrot.org/parrot/changeset/41338

Log:
Recycle the old auto::jit exec_protect probes for auto::frames. Shuffle some files around.

Added:
   branches/kill_jit/config/auto/frames/
      - copied from r41337, branches/kill_jit/config/auto/jit/
Deleted:
   branches/kill_jit/config/auto/frames/test_c.in
   branches/kill_jit/config/auto/jit/
Modified:
   branches/kill_jit/MANIFEST
   branches/kill_jit/config/auto/frames.pm

Modified: branches/kill_jit/MANIFEST
==============================================================================
--- branches/kill_jit/MANIFEST	Fri Sep 18 19:23:58 2009	(r41337)
+++ branches/kill_jit/MANIFEST	Fri Sep 18 20:48:55 2009	(r41338)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Thu Sep 17 04:23:40 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Sep 18 20:14:23 2009 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -233,6 +233,9 @@
 config/auto/env/test_unsetenv_c.in                          []
 config/auto/format.pm                                       []
 config/auto/frames.pm                                       []
+config/auto/frames/test_exec_cygwin_c.in                    []
+config/auto/frames/test_exec_linux_c.in                     []
+config/auto/frames/test_exec_openbsd_c.in                   []
 config/auto/funcptr.pm                                      []
 config/auto/funcptr/test_c.in                               []
 config/auto/gc.pm                                           []
@@ -256,10 +259,6 @@
 config/auto/isreg.pm                                        []
 config/auto/isreg/test_c.in                                 []
 config/auto/jit.pm                                          []
-config/auto/jit/test_c.in                                   []
-config/auto/jit/test_exec_cygwin_c.in                       []
-config/auto/jit/test_exec_linux_c.in                        []
-config/auto/jit/test_exec_openbsd_c.in                      []
 config/auto/memalign.pm                                     []
 config/auto/memalign/test2_c.in                             []
 config/auto/memalign/test_c.in                              []

Modified: branches/kill_jit/config/auto/frames.pm
==============================================================================
--- branches/kill_jit/config/auto/frames.pm	Fri Sep 18 19:23:58 2009	(r41337)
+++ branches/kill_jit/config/auto/frames.pm	Fri Sep 18 20:48:55 2009	(r41338)
@@ -40,11 +40,9 @@
     if (defined $conf->options->get('buildframes')) {
         $can_build_call_frames = $conf->options->get('buildframes');
     }
-    elsif ($nvsize == 8 && $cpuarch eq 'i386' && $osname ne 'darwin') {
-        $can_build_call_frames = 1;
-    }
     else {
-        $can_build_call_frames = 0;
+        $can_build_call_frames = ($nvsize == 8 && $cpuarch eq 'i386'
+            && $osname ne 'darwin');
     }
 
     if ( $can_build_call_frames ) {
@@ -58,11 +56,41 @@
         );
     }
 
+    if ( $can_build_call_frames ) {
+        # test for executable malloced memory
+        if ( -e "config/auto/frames/test_exec_${osname}_c.in" ) {
+            $conf->cc_gen("config/auto/frames/test_exec_${osname}_c.in");
+            eval { $conf->cc_build(); };
+            if ($@) {
+                $conf->data->set( has_exec_protect => 0 );
+            }
+            else {
+                my $exec_protect_test = (
+                    $conf->cc_run(0) !~ /ok/ && $conf->cc_run(1) =~ /ok/
+                );
+                _handle_exec_protect($conf, $exec_protect_test);
+            }
+            $conf->cc_clean();
+        }
+        else {
+            $conf->data->set( has_exec_protect => 0 );
+        }
+    }
 
     $self->set_result($can_build_call_frames?'yes':'no');
     return 1;
 }
 
+sub _handle_exec_protect {
+    my ($conf, $exec_protect_test) = @_;
+    if ($exec_protect_test) {
+        $conf->data->set( has_exec_protect => 1 );
+    }
+    else {
+        $conf->data->set( has_exec_protect => 0 );
+    }
+}
+
 1;
 
 # Local Variables:

Deleted: branches/kill_jit/config/auto/jit/test_c.in
==============================================================================
--- branches/kill_jit/config/auto/jit/test_c.in	Fri Sep 18 20:48:55 2009	(r41337)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,53 +0,0 @@
-/*
-Copyright (C) 2002-2009, Parrot Foundation.
-$Id$
-
-test for the fcomip float instruction
-*/
-
-#include <stdio.h>
-
-/*
- * c equiv:
-  int t(int i, int j) {
-  return (double)i == (double)j;
-}
-*/
-
-/* this code leaves one op on the fp stack, but this shouldn't harm */
-
-char code[] = {
-    0x55,               /* pushl %ebp */
-    0x89, 0xE5,         /* movl %esp,%ebp */
-    0x83, 0xEC, 0x18,   /* subl $24,%esp */
-    0xDB, 0x45, 0x08,   /* fildl 8(%ebp) */
-    0xDB, 0x45, 0x0C,   /* fildl 12(%ebp)*/
-    0xDF, 0xE9,         /* fucomip */
-    0x0F, 0x94, 0xC0,   /* sete %al */
-    0x31, 0xD2,         /* xorl %edx,%edx */
-    0x88, 0xC2,         /* movb %al,%dl */
-    0x89, 0xD0,         /* movl %edx,%eax */
-    0x89, 0xEC,         /* movl %ebp,%esp */
-    0x5D,               /* popl %ebp */
-    0xC3                /* ret */
-};
-
-typedef int (*pf)(int, int);
-
-int
-main()
-{
-    pf t  = (pf) code;
-    if (t(10, 10) && !t(10, 20))
-        puts("ok");
-    else
-        return 1;
-    return 0;
-}
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */


More information about the parrot-commits mailing list