Permalink
Browse files

Replace the C VM with the RPython VM.

The RPython VM will still need work e.g. for portability, but for many
purposes it's now a complete replacement.
  • Loading branch information...
1 parent c43538b commit 84bb9d6064ddf81fb3080c1b302972d25918eff5 @ltratt committed Dec 19, 2011
Showing with 190 additions and 27,365 deletions.
  1. +0 −1 .gitignore
  2. +0 −3 Makefile.bootstrap
  3. +3 −4 Makefile.in
  4. +1 −1 Makefile.inc.in
  5. +10 −12 compiler/Makefile.in
  6. +108 −0 configure
  7. +0 −902 configure.in
  8. +8 −8 lib/Makefile.Stdlib.in
  9. +1 −2 manuals/Makefile.in
  10. +0 −3 pypyvm/.gitignore
  11. +0 −41 pypyvm/README
  12. +2 −5 vm/.gitignore
  13. +0 −30 vm/Arch.h
  14. +0 −323 vm/Bootstrap.c
  15. +0 −30 vm/Bootstrap.h
  16. +22 −3 {pypyvm → vm}/Builtins.py
  17. +0 −95 vm/Builtins/Atom_Def_Atom.c
  18. +0 −42 vm/Builtins/Atom_Def_Atom.h
  19. +0 −357 vm/Builtins/Class/Atom.c
  20. +0 −66 vm/Builtins/Class/Atom.h
  21. +0 −501 vm/Builtins/Class/Class.c
  22. +0 −27 vm/Builtins/Class/Class.h
  23. +0 −208 vm/Builtins/Closure/Atom.c
  24. +0 −42 vm/Builtins/Closure/Atom.h
  25. +0 −58 vm/Builtins/Closure/Class.c
  26. +0 −29 vm/Builtins/Closure/Class.h
  27. +0 −1,505 vm/Builtins/Con_Stack/Atom.c
  28. +0 −179 vm/Builtins/Con_Stack/Atom.h
  29. +0 −61 vm/Builtins/Con_Stack/Class.c
  30. +0 −29 vm/Builtins/Con_Stack/Class.h
  31. +0 −167 vm/Builtins/Dict/Atom.c
  32. +0 −49 vm/Builtins/Dict/Atom.h
  33. +0 −530 vm/Builtins/Dict/Class.c
  34. +0 −29 vm/Builtins/Dict/Class.h
  35. +0 −182 vm/Builtins/Exception/Atom.c
  36. +0 −53 vm/Builtins/Exception/Atom.h
  37. +0 −186 vm/Builtins/Exception/Class.c
  38. +0 −27 vm/Builtins/Exception/Class.h
  39. +0 −99 vm/Builtins/Float/Atom.c
  40. +0 −41 vm/Builtins/Float/Atom.h
  41. +0 −360 vm/Builtins/Float/Class.c
  42. +0 −29 vm/Builtins/Float/Class.h
  43. +0 −196 vm/Builtins/Func/Atom.c
  44. +0 −51 vm/Builtins/Func/Atom.h
  45. +0 −144 vm/Builtins/Func/Class.c
  46. +0 −29 vm/Builtins/Func/Class.h
  47. +0 −171 vm/Builtins/Int/Atom.c
  48. +0 −55 vm/Builtins/Int/Atom.h
  49. +0 −499 vm/Builtins/Int/Class.c
  50. +0 −29 vm/Builtins/Int/Class.h
  51. +0 −201 vm/Builtins/List/Atom.c
  52. +0 −41 vm/Builtins/List/Atom.h
  53. +0 −995 vm/Builtins/List/Class.c
  54. +0 −29 vm/Builtins/List/Class.h
  55. +0 −565 vm/Builtins/Module/Atom.c
  56. +0 −68 vm/Builtins/Module/Atom.h
  57. +0 −316 vm/Builtins/Module/Class.c
  58. +0 −29 vm/Builtins/Module/Class.h
  59. +0 −61 vm/Builtins/Number/Class.c
  60. +0 −29 vm/Builtins/Number/Class.h
  61. +0 −301 vm/Builtins/Object/Class.c
  62. +0 −29 vm/Builtins/Object/Class.h
  63. +0 −119 vm/Builtins/Partial_Application/Atom.c
  64. +0 −41 vm/Builtins/Partial_Application/Atom.h
  65. +0 −191 vm/Builtins/Partial_Application/Class.c
  66. +0 −31 vm/Builtins/Partial_Application/Class.h
  67. +0 −281 vm/Builtins/Set/Atom.c
  68. +0 −50 vm/Builtins/Set/Atom.h
  69. +0 −625 vm/Builtins/Set/Class.c
  70. +0 −29 vm/Builtins/Set/Class.h
  71. +0 −105 vm/Builtins/Slots_Atom_Def.c
  72. +0 −49 vm/Builtins/Slots_Atom_Def.h
  73. +0 −335 vm/Builtins/String/Atom.c
  74. +0 −69 vm/Builtins/String/Atom.h
  75. +0 −774 vm/Builtins/String/Class.c
  76. +0 −29 vm/Builtins/String/Class.h
  77. +0 −64 vm/Builtins/Thread/Atom.h
  78. +0 −27 vm/Builtins/Thread/Class.h
  79. +0 −78 vm/Builtins/Unique_Atom_Def.c
  80. +0 −43 vm/Builtins/Unique_Atom_Def.h
  81. +0 −1,859 vm/Builtins/VM/Atom.c
  82. +0 −74 vm/Builtins/VM/Atom.h
  83. +0 −60 vm/Builtins/VM/Class.c
  84. +0 −27 vm/Builtins/VM/Class.h
  85. +0 −163 vm/Bytecode.c
  86. +0 −31 vm/Bytecode.h
  87. 0 {pypyvm → vm}/Bytecode.py
  88. +0 −237 vm/Core.h
  89. 0 {pypyvm → vm}/Core.py
  90. +0 −102 vm/Hash.c
  91. +0 −29 vm/Hash.h
  92. +8 −47 vm/Makefile.in
  93. +0 −849 vm/Memory.c
  94. +0 −143 vm/Memory.h
  95. +0 −137 vm/Misc.c
  96. +0 −31 vm/Misc.h
  97. +0 −214 vm/Modules.c
  98. +0 −40 vm/Modules.h
  99. +0 −763 vm/Modules/Array.c
  100. +0 −71 vm/Modules/Builtins.c
  101. +0 −1,309 vm/Modules/C_Earley_Parser.c
  102. +0 −138 vm/Modules/C_Platform_Env.c
  103. +0 −82 vm/Modules/C_Platform_Exec.c
  104. +0 −95 vm/Modules/C_Platform_Host.c
  105. +0 −81 vm/Modules/C_Platform_Properties.c
  106. +0 −136 vm/Modules/C_Strings.c
  107. +0 −88 vm/Modules/C_Time.c
  108. 0 {pypyvm → vm}/Modules/Con_Array.py
  109. 0 {pypyvm → vm}/Modules/Con_C_Earley_Parser.py
  110. 0 {pypyvm → vm}/Modules/Con_C_Platform_Env.py
  111. 0 {pypyvm → vm}/Modules/Con_C_Platform_Exec.py
  112. 0 {pypyvm → vm}/Modules/Con_C_Platform_Host.py
  113. 0 {pypyvm → vm}/Modules/Con_C_Platform_Properties.py
  114. 0 {pypyvm → vm}/Modules/Con_C_Strings.py
  115. 0 {pypyvm → vm}/Modules/Con_C_Time.py
  116. 0 {pypyvm → vm}/Modules/Con_Curses.py
  117. 0 {pypyvm → vm}/Modules/Con_Exceptions.py
  118. 0 {pypyvm → vm}/Modules/Con_PCRE.py
  119. 0 {pypyvm → vm}/Modules/Con_POSIX_File.py
  120. +2 −2 {pypyvm → vm}/Modules/Con_Sys.py
  121. 0 {pypyvm → vm}/Modules/Con_Thread.py
  122. 0 {pypyvm → vm}/Modules/Con_VM.py
  123. +0 −182 vm/Modules/Curses.c
  124. +0 −498 vm/Modules/Exceptions.c
  125. +0 −377 vm/Modules/PCRE.c
  126. +0 −175 vm/Modules/Random.c
  127. +0 −183 vm/Modules/Sys.c
  128. +0 −89 vm/Modules/Thread.c
  129. +0 −133 vm/Modules/VM.c
  130. 0 {pypyvm → vm}/Modules/__init__.py
  131. +0 −255 vm/Modules/libXML2.c
  132. 0 {pypyvm → vm}/Modules/libXML2.py
  133. +0 −128 vm/Numbers.c
  134. +0 −30 vm/Numbers.h
  135. +0 −624 vm/Object.c
  136. +0 −50 vm/Object.h
  137. +0 −36 vm/Platform/Arch/sun4u/Arch.c
  138. +0 −33 vm/Platform/Arch/sun4u/Arch.h
  139. +0 −36 vm/Platform/Arch/x86/Arch.c
  140. +0 −33 vm/Platform/Arch/x86/Arch.h
  141. +0 −111 vm/Platform/Arch/x86/memmove.S
  142. +0 −36 vm/Platform/Arch/x86_64/Arch.c
  143. +0 −33 vm/Platform/Arch/x86_64/Arch.h
  144. +0 −85 vm/Platform/Arch/x86_64/memmove.S
  145. +0 −35 vm/Platform/MinGW/realpath.c
  146. +0 −27 vm/Platform/MinGW/realpath.h
  147. +0 −784 vm/Platform/POSIX/Modules/POSIX_File.c
  148. +0 −208 vm/Platform/Targets/32bit.h
  149. +0 −205 vm/Platform/Targets/64bit.h
  150. +0 −639 vm/Platform/Threads/PThreads/PThreads_Atom.c
  151. +0 −55 vm/Platform/Threads/PThreads/PThreads_Atom.h
  152. +0 −243 vm/Platform/Threads/PThreads/PThreads_Class.c
  153. +0 −48 vm/Platform/Threads/PThreads/PThreads_Module.c
  154. +0 −137 vm/Platform/Threads/Single_Thread/Single_Thread_Atom.c
  155. +0 −35 vm/Platform/Threads/Single_Thread/Single_Thread_Atom.h
  156. +0 −56 vm/Platform/Threads/Single_Thread/Single_Thread_Class.c
  157. +0 −111 vm/Platform/endian.h
  158. +0 −48 vm/Platform/err.c
  159. +0 −39 vm/Platform/err.h
  160. +0 −78 vm/Platform/fgetln.c
  161. +0 −27 vm/Platform/fgetln.h
  162. +0 −55 vm/Platform/strlcat.c
  163. +0 −51 vm/Platform/strlcpy.c
  164. +0 −212 vm/Shortcuts.h
  165. +0 −279 vm/Slots.c
  166. +0 −54 vm/Slots.h
  167. 0 {pypyvm → vm}/Stdlib_Modules.py
  168. +0 −29 vm/Target.c
  169. +0 −35 vm/Target.h
  170. 0 {pypyvm → vm}/Target.py
  171. 0 {pypyvm → vm}/VM.py
  172. +0 −4 vm/Version.h.in
  173. +2 −2 pypyvm/Version.py → vm/Version.py.in
  174. +0 −835 vm/main.c
  175. +23 −2 {pypyvm → vm}/main.py
View
@@ -7,7 +7,6 @@
autom4te.cache
config.log
config.status
-configure
*.core
*.cvb
*.cvl
View
@@ -1,3 +0,0 @@
-configure: configure.in
- autoconf
- autoheader
View
@@ -29,7 +29,7 @@ clean:
cd manuals && ${MAKE} ${MFLAGS} clean
cd tests && ${MAKE} ${MFLAGS} clean
-ifdef TARGET
+ifdef CON_TARGET
cross: all
cd lib && ${MAKE} ${MFLAGS} cross
cd compiler && ${MAKE} ${MFLAGS} cross
@@ -47,16 +47,15 @@ distclean:
cd examples && ${MAKE} ${MFLAGS} distclean
cd manuals && ${MAKE} ${MFLAGS} distclean
cd tests && ${MAKE} ${MFLAGS} distclean
- rm -rf autom4te.cache Makefile Makefile.inc configure config.log config.status
+ rm -rf Makefile Makefile.inc
regress: all
cd examples && ${MAKE} ${MFLAGS} regress
cd tests && ${MAKE} ${MFLAGS} regress
release: distclean
mkdir converge-@CONVERGE_VERSION@
- ${MAKE} -f Makefile.bootstrap configure
- find . -type d | grep -v "\.git" | grep -v "^\.$$" | sed "s/^\..//" | grep -v "^autom4te.cache" | grep -v "converge-@CONVERGE_VERSION@" | xargs -I {} mkdir -p converge-@CONVERGE_VERSION@/{}
+ find . -type d | grep -v "\.git" | grep -v "^\.$$" | sed "s/^\..//" | grep -v "converge-@CONVERGE_VERSION@" | xargs -I {} mkdir -p converge-@CONVERGE_VERSION@/{}
find . \! -type d | grep -v "\.git" | sed "s/^\..//" | grep -v "^autom4te.cache" | grep -v "config\..*" | grep -v "\.binaries" | grep -v "\.gitignore" | grep -v "\.core$$" | grep -v ".depend$$" | grep -v "converge-@CONVERGE_VERSION@" | xargs -I {} cp -r {} converge-@CONVERGE_VERSION@/{}
tar cfz converge-@CONVERGE_VERSION@.tar.gz converge-@CONVERGE_VERSION@
@echo "\nMake sure that this distribution has the correct version and date!\n @CONVERGE_VERSION@ (@CONVERGE_DATE@)"
View
@@ -1,4 +1,4 @@
-CONVERGE_DIR=@abs_srcdir@
+CONVERGE_DIR=@abs_top_srcdir@
CONVERGE_VM_DIR=${CONVERGE_DIR}/vm
CONVERGE_VM=${CONVERGE_VM_DIR}/converge
View
@@ -1,7 +1,5 @@
include @abs_top_srcdir@/Makefile.inc
-prefix = @prefix@
-exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
conlibdir = ${libdir}/converge-@CONVERGE_VERSION@
@@ -43,21 +41,21 @@ endif
${INSTALL} -c -m 444 Compiler.cvl ${DESTDIR}${conlibdir}
-ifdef TARGET
-CROSS_OBJS = ${OBJS:.cvb=.${TARGET}.cvb}
+ifdef CON_TARGET
+CROSS_OBJS = ${OBJS:.cvb=.${CON_TARGET}.cvb}
-%.${TARGET}.cvb: %.cv
- ${CONVERGE_VM} ${CONVERGEC} -T ${TARGET} -I ${CONVERGE_STDLIB_DIR} -o $@ $<
+%.${CON_TARGET}.cvb: %.cv
+ ${CONVERGE_VM} ${CONVERGEC} -T ${CON_TARGET} -I ${CONVERGE_STDLIB_DIR} -o $@ $<
-%.${TARGET}.cvb: %
- ${CONVERGE_VM} ${CONVERGEC} -T ${TARGET} -o $@ $<
+%.${CON_TARGET}.cvb: %
+ ${CONVERGE_VM} ${CONVERGEC} -T ${CON_TARGET} -o $@ $<
-cross: ${CROSS_OBJS} ${CONVERGE_LIB_DIR}/Stdlib.${TARGET}.cvl
- ${CONVERGE_VM} ${CONVERGEL} -T ${TARGET} -o convergec.${TARGET} convergec.${TARGET}.cvb ${CROSS_OBJS} ${CONVERGE_LIB_DIR}/Stdlib.${TARGET}.cvl
- ${CONVERGE_VM} ${CONVERGEL} -T ${TARGET} -o convergel.${TARGET} convergel.${TARGET}.cvb ${CROSS_OBJS} ${CONVERGE_LIB_DIR}/Stdlib.${TARGET}.cvl
+cross: ${CROSS_OBJS} ${CONVERGE_LIB_DIR}/Stdlib.${CON_TARGET}.cvl
+ ${CONVERGE_VM} ${CONVERGEL} -T ${CON_TARGET} -o convergec.${CON_TARGET} convergec.${CON_TARGET}.cvb ${CROSS_OBJS} ${CONVERGE_LIB_DIR}/Stdlib.${CON_TARGET}.cvl
+ ${CONVERGE_VM} ${CONVERGEL} -T ${CON_TARGET} -o convergel.${CON_TARGET} convergel.${CON_TARGET}.cvb ${CROSS_OBJS} ${CONVERGE_LIB_DIR}/Stdlib.${CON_TARGET}.cvl
cross-clean:
- rm -f ${CROSS_OBJS} convergec.${TARGET} convergel.${TARGET}
+ rm -f ${CROSS_OBJS} convergec.${CON_TARGET} convergel.${CON_TARGET}
endif
View
108 configure
@@ -0,0 +1,108 @@
+#! /bin/sh
+
+# If shipping a production release, these two variables should be changed
+# to e.g.:
+#
+# converge_version=0.7
+# converge_date=2006/01/04
+
+converge_version=current
+converge_date=`date '+%Y/%m/%d %H:%M:%S'`
+
+prefix=""
+rpython_opt="jit"
+while [ $# -ge 1 ]; do
+ case $1 in
+ --prefix=* ) prefix=`echo $1 | sed "s/--prefix=//g"`; shift;;
+ --opt=* ) rpython_opt=`echo $1 | sed "s/--opt=//g"`; shift;;
+ * ) echo "Unknown switch $1"; exit 1;;
+ esac
+done
+
+if [[ X$prefix == "X" ]]; then
+ prefix="/usr/local/"
+fi
+
+echo -n "Checking for Python interpreter... "
+
+which pypy-c 2> /dev/null > /dev/null
+if [ $? -eq 0 ]; then
+ PYTHON=`which pypy-c`
+elif [ $? -ne 0 ]; then
+ which python 2> /dev/null > /dev/null
+ if [ $? -eq 0 ]; then
+ PYTHON=`which python`
+ else
+ echo "not found."
+ exit 1
+ fi
+fi
+echo $PYTHON
+
+echo -n "Checking for RPython translate.py... "
+if [[ X$PYPY_SRC != "X" ]]; then
+ TRANSLATE_PY=$PYPY_SRC/pypy/translator/goal/translate.py
+ if [[ ! -f $TRANSLATE_PY ]]; then
+ TRANSLATE_PY=""
+ fi
+fi
+
+if [[ X$TRANSLATE_PY == "X" ]]; then
+ echo "not found (try setting \$PYPY_SRC)."
+fi
+echo $TRANSLATE_PY
+
+operating_system=`uname -s`
+machine_type=`uname -m`
+if [[ $operating_system == "Darwin" && $machine_type == "i386" ]]; then
+ # On modern Darwin machine it now seems that it's easier to build 64 bit
+ # binaries than 32 bit. Why? I don't know.
+ machine_type=x86_64
+fi
+case $operating_system in
+ CYGWIN_NT* | MINGW* )
+ EXEC_EXT=".exe"
+ DIR_SEP="\\";;
+ * )
+ DIR_SEP="/";;
+esac
+
+case $machine_type in
+ i386 | i686 )
+ bootstrap_dir="bootstrap/32bit_little_endian";;
+ amd64 | x86_64 )
+ bootstrap_dir="bootstrap/64bit_little_endian";;
+ *) echo Unknown machine type "$machine_type"; exit 1;;
+esac
+
+echo -n "Copying bootstrap compiler... "
+
+cp -p $bootstrap_dir/convergec.bootstrap compiler/convergec
+cp -p $bootstrap_dir/convergel.bootstrap compiler/convergel
+
+echo "done."
+
+echo -n "Writing .in files... "
+
+rewriter=`mktemp`
+cat << EOF > $rewriter
+import sys
+fin=file(sys.argv[1], "r")
+d=fin.read(-1)
+fin.close()
+i = 3
+while i < len(sys.argv):
+ d=d.replace(sys.argv[i], sys.argv[i + 1])
+ i += 2
+fout=file(sys.argv[2], "w")
+fout.write(d)
+fout.close()
+EOF
+abs_top_srcdir=`pwd`
+for p_in in `find . -name "*.in"`; do
+ p=`echo $p_in | sed "s/.in$//g"`
+ $PYTHON $rewriter $p_in $p "@abs_top_srcdir@" "$abs_top_srcdir" "@PYTHON@" "$PYTHON" "@TRANSLATE_PY@" "$TRANSLATE_PY" "@RPYTHON_OPT@" "$rpython_opt" "@prefix@" "$prefix" "@bindir@" "$prefix/bin" "@libdir@" "$prefix/share" "@libdir@" "$prefix/lib" "@INSTALL@" "$abs_top_srcdir/install.sh" "@CONVERGE_VERSION@" "$converge_version" "@CONVERGE_DATE@" "$converge_date" "@PLATFORM@" "$operating_system" "@EXEC_EXT" "$exec_ext" "@DIR_SEP@" "$DIR_SEP"
+done
+rm -f $rewriter
+
+echo "done."
Oops, something went wrong.

0 comments on commit 84bb9d6

Please sign in to comment.