fix 'set-box!' slow path; use C compiler for pthreadrwlock test

svn: r18778
This commit is contained in:
Matthew Flatt 2010-04-10 13:29:53 +00:00
parent c4dfc1df05
commit 6c9c747e7e
4 changed files with 171 additions and 171 deletions

228
src/configure vendored
View File

@ -9472,6 +9472,120 @@ _ACEOF
fi
############### places ###################
if test "${enable_places}" = "yes" ; then
cat >>confdefs.h <<\_ACEOF
#define MZ_USE_PLACES 1
_ACEOF
enable_mzrt=yes
fi
############### futures ###################
if test "${enable_futures_by_default}" = "yes" ; then
if test "${enable_futures}" = "" ; then
enable_futures=yes
fi
fi
if test "${enable_futures}" = "yes" ; then
cat >>confdefs.h <<\_ACEOF
#define MZ_USE_FUTURES 1
_ACEOF
enable_mzrt=yes
fi
############### OS threads ###################
if test "${enable_mzrt}" = "yes" ; then
MZRT_CGC_FLAGS="$GC_THREADS_FLAG -DTHREAD_LOCAL_ALLOC"
LIBATOM="LIBATOM_USE"
enable_pthread=yes
fi
############### pthread ###################
if test "${enable_pthread}" = "yes" ; then
# FIXME: the following two flags are GCC-specific:
PREFLAGS="$PREFLAGS -pthread"
LDFLAGS="$LDFLAGS -pthread"
cat >>confdefs.h <<\_ACEOF
#define USE_PTHREAD_INSTEAD_OF_ITIMER 1
_ACEOF
msg="whether pthread_rwlock is available"
{ echo "$as_me:$LINENO: checking $msg" >&5
echo $ECHO_N "checking $msg... $ECHO_C" >&6; }
if test "$cross_compiling" = yes; then
rwlockavail=no
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <pthread.h>
pthread_rwlock_t l;
int main() {
return pthread_rwlock_init(&l, NULL);
}
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
rwlockavail=yes
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
rwlockavail=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $rwlockavail" >&5
echo "${ECHO_T}$rwlockavail" >&6; }
if test "$rwlockavail" = "yes" ; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_PTHREAD_RWLOCK 1
_ACEOF
fi
fi
if test "${enable_pthread}" = "" ; then
enable_pthread=no
fi
############## Solaris grunge ################
if test "$check_gcc_dash_e" = "yes" ; then
@ -10416,10 +10530,6 @@ if test "${enable_gl}" = "" ; then
enable_gl=yes
fi
if test "${enable_pthread}" = "" ; then
enable_pthread=no
fi
if test "${enable_gl}" = "yes" ; then
# Check for header
if test "${ac_cv_header_GL_glx_h+set}" = set; then
@ -10714,116 +10824,6 @@ if test "${enable_gl}" = "yes" ; then
MROPTIONS="$MROPTIONS -DUSE_GL"
fi
############### places ###################
if test "${enable_places}" = "yes" ; then
cat >>confdefs.h <<\_ACEOF
#define MZ_USE_PLACES 1
_ACEOF
enable_mzrt=yes
fi
############### futures ###################
if test "${enable_futures_by_default}" = "yes" ; then
if test "${enable_futures}" = "" ; then
enable_futures=yes
fi
fi
if test "${enable_futures}" = "yes" ; then
cat >>confdefs.h <<\_ACEOF
#define MZ_USE_FUTURES 1
_ACEOF
enable_mzrt=yes
fi
############### OS threads ###################
if test "${enable_mzrt}" = "yes" ; then
MZRT_CGC_FLAGS="$GC_THREADS_FLAG -DTHREAD_LOCAL_ALLOC"
LIBATOM="LIBATOM_USE"
enable_pthread=yes
fi
############### pthread ###################
if test "${enable_pthread}" = "yes" ; then
# FIXME: the following two flags are GCC-specific:
PREFLAGS="$PREFLAGS -pthread"
LDFLAGS="$LDFLAGS -pthread"
cat >>confdefs.h <<\_ACEOF
#define USE_PTHREAD_INSTEAD_OF_ITIMER 1
_ACEOF
msg="whether pthread_rwlock is available"
{ echo "$as_me:$LINENO: checking $msg" >&5
echo $ECHO_N "checking $msg... $ECHO_C" >&6; }
if test "$cross_compiling" = yes; then
rwlockavail=no
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <pthread.h>
pthread_rwlock_t l;
int main() {
return pthread_rwlock_init(&l, NULL);
}
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
rwlockavail=yes
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
rwlockavail=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $rwlockavail" >&5
echo "${ECHO_T}$rwlockavail" >&6; }
if test "$rwlockavail" = "yes" ; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_PTHREAD_RWLOCK 1
_ACEOF
fi
fi
################ Xrender ##################
if test "${enable_xrender}" = "" ; then

View File

@ -983,6 +983,60 @@ if test "${endianness}" = "big" ; then
AC_DEFINE(SCHEME_BIG_ENDIAN,1,[Big endian])
fi
############### places ###################
if test "${enable_places}" = "yes" ; then
AC_DEFINE(MZ_USE_PLACES,1,[Places enabled])
enable_mzrt=yes
fi
############### futures ###################
if test "${enable_futures_by_default}" = "yes" ; then
if test "${enable_futures}" = "" ; then
enable_futures=yes
fi
fi
if test "${enable_futures}" = "yes" ; then
AC_DEFINE(MZ_USE_FUTURES,1,[Futures enabled])
enable_mzrt=yes
fi
############### OS threads ###################
if test "${enable_mzrt}" = "yes" ; then
MZRT_CGC_FLAGS="$GC_THREADS_FLAG -DTHREAD_LOCAL_ALLOC"
LIBATOM="LIBATOM_USE"
enable_pthread=yes
fi
############### pthread ###################
if test "${enable_pthread}" = "yes" ; then
# FIXME: the following two flags are GCC-specific:
PREFLAGS="$PREFLAGS -pthread"
LDFLAGS="$LDFLAGS -pthread"
AC_DEFINE(USE_PTHREAD_INSTEAD_OF_ITIMER, 1, [Pthread timer enabled])
[ msg="whether pthread_rwlock is available" ]
AC_MSG_CHECKING($msg)
AC_TRY_RUN(
[ #include <pthread.h>]
pthread_rwlock_t l;
int main() {
return pthread_rwlock_init(&l, NULL);
}, rwlockavail=yes, rwlockavail=no, rwlockavail=no)
AC_MSG_RESULT($rwlockavail)
if test "$rwlockavail" = "yes" ; then
AC_DEFINE(HAVE_PTHREAD_RWLOCK,1,[Have pthread_rwlock])
fi
fi
if test "${enable_pthread}" = "" ; then
enable_pthread=no
fi
############## Solaris grunge ################
if test "$check_gcc_dash_e" = "yes" ; then
@ -1109,10 +1163,6 @@ if test "${enable_gl}" = "" ; then
enable_gl=yes
fi
if test "${enable_pthread}" = "" ; then
enable_pthread=no
fi
if test "${enable_gl}" = "yes" ; then
# Check for header
AC_CHECK_HEADER(GL/glx.h, GLX_HEADER=yes, GLX_HEADER=no)
@ -1144,56 +1194,6 @@ if test "${enable_gl}" = "yes" ; then
MROPTIONS="$MROPTIONS -DUSE_GL"
fi
############### places ###################
if test "${enable_places}" = "yes" ; then
AC_DEFINE(MZ_USE_PLACES,1,[Places enabled])
enable_mzrt=yes
fi
############### futures ###################
if test "${enable_futures_by_default}" = "yes" ; then
if test "${enable_futures}" = "" ; then
enable_futures=yes
fi
fi
if test "${enable_futures}" = "yes" ; then
AC_DEFINE(MZ_USE_FUTURES,1,[Futures enabled])
enable_mzrt=yes
fi
############### OS threads ###################
if test "${enable_mzrt}" = "yes" ; then
MZRT_CGC_FLAGS="$GC_THREADS_FLAG -DTHREAD_LOCAL_ALLOC"
LIBATOM="LIBATOM_USE"
enable_pthread=yes
fi
############### pthread ###################
if test "${enable_pthread}" = "yes" ; then
# FIXME: the following two flags are GCC-specific:
PREFLAGS="$PREFLAGS -pthread"
LDFLAGS="$LDFLAGS -pthread"
AC_DEFINE(USE_PTHREAD_INSTEAD_OF_ITIMER, 1, [Pthread timer enabled])
[ msg="whether pthread_rwlock is available" ]
AC_MSG_CHECKING($msg)
AC_TRY_RUN(
[ #include <pthread.h>]
pthread_rwlock_t l;
int main() {
return pthread_rwlock_init(&l, NULL);
}, rwlockavail=yes, rwlockavail=no, rwlockavail=no)
AC_MSG_RESULT($rwlockavail)
if test "$rwlockavail" = "yes" ; then
AC_DEFINE(HAVE_PTHREAD_RWLOCK,1,[Have pthread_rwlock])
fi
fi
################ Xrender ##################
if test "${enable_xrender}" = "" ; then

View File

@ -10663,14 +10663,14 @@ static int do_generate_common(mz_jit_state *jitter, void *_data)
/* *** set_box_code *** */
/* R0 is box, R1 is value */
set_box_code = jit_get_ip().ptr;
mz_prolog(JIT_R1);
mz_prolog(JIT_R2);
jit_prepare(2);
jit_pusharg_p(JIT_R1);
jit_pusharg_p(JIT_R0);
(void)mz_finish(ts_scheme_set_box);
CHECK_LIMIT();
/* returns if proxied */
mz_epilog(JIT_R1);
mz_epilog(JIT_R2);
register_sub_func(jitter, set_box_code, scheme_false);
/* *** bad_vector_length_code *** */

View File

@ -379,7 +379,7 @@ void scheme_init_os_thread_like(void *other) XFORM_SKIP_PROC
void scheme_init_os_thread() XFORM_SKIP_PROC
{
return scheme_init_os_thread_like(NULL);
scheme_init_os_thread_like(NULL);
}
/************************************************************************/