harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r294974 [2/25] - in /incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm: ./ jchevm/ jchevm/doc/ jchevm/etc/ jchevm/include/ jchevm/java/ jchevm/java/org/ jchevm/java/org/dellroad/ jchevm/java/org/dellroad/jc/ jchevm/java/org/dellroad/...
Date Wed, 05 Oct 2005 02:20:10 GMT
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/NOTES
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/NOTES?rev=294974&view=auto
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/NOTES (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/NOTES Tue Oct  4 19:19:16
@@ -0,0 +1,135 @@
+TO-DO list
+  Virtual machine
+    - Make _jc_env * have per-thread linkage:
+      http://people.redhat.com/drepper/tls.pdf
+    - Compress vtables by mapping overridden methods to superclass.
+      Requires virtual method lookup at generation time.
+    - Why does a conglomerated ELF object save a lot of memory?
+    - Add a flag to control on-demand heap initialization. Perform GC
+      attempts before heap is completely full. Implement jc.heap.initial.
+    - Put the line number tables in a custom ELF section, then
+      remove the section hack from _JC_STRING().
+    - _jc_type contains pointer to bs->hint; use to inline allocations
+      of small objects when the hint is correct and it's not the last
+      block in the page. For large object, pointer always points to NULL.
+    - Fix _JC_STACK_ALLOC() to detect stack overflows.
+    - Handle the case where _JC_FULL_ALIGNMENT > sizeof(_jc_word). If so,
+      then objects with an odd number of references could have primitive
+      fields that are not aligned.
+    - Use libunwind: http://www.hpl.hp.com/research/linux/libunwind/
+      Should make the common case of uncaught exceptions faster.
+    - http://www.cl.cam.ac.uk/Research/SRG/netos/lock-free/
+    - Sun's SIGQUIT debugging menu:
+	    http://docs.sun.com/db/doc/806-1367/6jalj6mv1?a=view
+    - Show locked objects in SIGUSR1 output (by examining stack)
+    - Fix all broken Mauve tests
+    - Try jack benchmark; use gprof to find & optimize hotspots
+    - Add support for retaining line numbers of inlined methods
+    - Generational garbage collection: mark each heap pages as
+      part of some generation. When a full page survives GC without
+      losing any objects, bump it's generation.
+  Code generation
+    - Record inlined method information to fix disappearing stack frames.
+    - Add lots of "restrict" keywords in the generated code.
+    - Support enable/disable assertions; when disabled, use Soot
+      to remove the assertion checking bytecode.
+    - Find class initializers that just fill in static arrays with
+      non-String constants and pre-generate them instead.
+    - Make the dependency analysis more precise to avoid unecessary
+      recompilations due to non-structural changes.
+    - Implement thin-lock locking inline in the generated code.
+  Other random ideas:
+    - New gc/heap algorithm: single space, compacting, generational,
+      compare-and-swap alloc. generational via starting point for compact.
+Known bugs
+    - _jc_cs_fmod() is probably wrong on at least some platforms
+    - Java 'volatile' longs and doubles should be accessed atomically.
+      Need a new macro for reading&writing volatile longs & doubles.
+    - Should impose global memory read barrier with MONITORENTER and global
+      memory write barrier with MONITOREXIT in thin lock case. In the fat
+      lock case, pthread_mutex_*() guarantees this for us.
+Random Notes
+    - http://developer.java.sun.com/developer/bugParade/bugs/4329831.html
+      What exactly is the memory model that we inherit from C? Are we
+      violating the current JVM spec in any way?
+    - Interesting Sun JVM bug:
+      http://developer.java.sun.com/developer/bugParade/bugs/4699981.html
+    - New classfile format with CONSTANT_Class literals
+	http://jcp.org/en/jsr/detail?id=202
+    - Assertions
+	http://java.sun.com/docs/books/jls/assert-spec.html#semantics
+	http://java.sun.com/j2se/1.4/docs/guide/lang/assert.html
+    - New Java memory model and JSR-133
+	http://gee.cs.oswego.edu/dl/jmm/cookbook.html
+    - JVM changes
+	http://java.sun.com/docs/books/jls/jls-proposed-changes.html
+	http://java.sun.com/docs/books/vmspec/2nd-edition/jvms-proposed-changes.html
+	http://java.sun.com/docs/books/vmspec/2nd-edition/jvms-java5.html
+    - GC
+	http://www.cs.kent.ac.uk/people/staff/rej/gc.html
+        http://java.sun.com/docs/hotspot/gc/
+    - JNI 1.4
+	http://java.sun.com/j2se/1.4.2/docs/guide/jni/jni-14.html
+	http://java.sun.com/j2se/1.4.2/docs/guide/jni/spec/jniTOC.html
+    - LLVM:
+      http://llvm.cs.uiuc.edu/
+    - MMTk:
+      http://csdl.computer.org/comp/proceedings/icse/2004/2163/00/21630137abs.htm
+$Id: NOTES,v 1.36 2005/07/03 19:34:18 archiecobbs Exp $

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/README
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/README?rev=294974&view=auto
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/README (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/README Tue Oct  4 19:19:16
@@ -0,0 +1,30 @@
+Welcome to JC!
+JC is a Java virtual machine implementation that converts class files
+into C source files using the Soot Java bytecode analysis framework,
+compiles them with GCC, and loads them using a built-in ELF object
+file loader. JC utilizes the GNU Classpath class library and provides
+a fairly complete Java runtime including sophisticated optimizations to
+increase runtime performance. JC also includes a bytecode interpreter,
+and supports execution in either or mixed modes.
+Although JC has good interpreter performance, JC doesn't try to be
+fast in every situation. Instead, JC focuses on this question: how
+fast can we go if we know some or all of the class files ahead of
+time? The answer is: very fast! Optimizations that are just too
+complex and expensive to perform at runtime are instead performed
+at code generation time. JC's code generator is written in Java,
+using the powerful Soot bytecode analysis framework. When combined
+with the proven power of GCC's C optimizer the results are impressive.
+As an additional benefit, JC contains very little architecture-specific
+code and is highly portable.
+See INSTALL for installation instructions.
+Once installed, documentation is available via the jc(1) man page
+and the JC manual in info(1), and HTML form under $prefix/share/jc/doc.
+Visit the JC home page at http://jcvm.sourceforge.net/
+$Id: README,v 1.5 2005/05/14 21:42:18 archiecobbs Exp $

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/configure.in
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/configure.in?rev=294974&view=auto
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/configure.in (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/configure.in Tue Oct 
4 19:19:16 2005
@@ -0,0 +1,188 @@
+# $Id: configure.in,v 1.56 2005/07/23 15:31:05 archiecobbs Exp $
+AC_INIT([JC Virtual Machine], [1.4.6], [http://sourceforge.net/projects/jcvm], [jc])
+AC_REVISION($Id: configure.in,v 1.56 2005/07/23 15:31:05 archiecobbs Exp $)
+# Definitions
+[JC_CFLAGS='-g -O3 -pipe -Wall -Waggregate-return -Wcast-align -Wchar-subscripts -Wcomment
-Wformat -Wimplicit -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-long-long
-Wparentheses -Wpointer-arith -Wredundant-decls -Wreturn-type -Wswitch -Wtrigraphs -Wuninitialized
-Wunused -Wwrite-strings']
+# -Wshadow -Wstrict-prototypes -Wcast-qual
+# -fstrict-aliasing -foptimize-sibling-calls
+# Compile flags for Linux
+AC_DEFINE(_GNU_SOURCE, 1, GNU functions)
+AC_DEFINE(_BSD_SOURCE, 1, BSD functions)
+# Get the install root
+[if test "x$prefix" = xNONE; then
+    JC_PREFIX="$ac_default_prefix"
+    JC_PREFIX="$prefix"
+# Get Classpath home, default to same as prefix
+    [AC_HELP_STRING([--with-classpath=DIR],
+	[specify Classpath installation home])],
+    [test x"${withval}" != "xyes" && CLASSPATH_HOME="${withval}"])
+# Verify Classpath is really there
+AC_CHECK_FILE([${CLASSPATH_HOME}/share/classpath/glibj.zip], ,
+    [AC_MSG_ERROR([classpath not found in ${CLASSPATH_HOME}])])
+# Optional features
+    AC_HELP_STRING([--enable-assertions],
+        [enable debugging sanity checks (default NO)]),
+    [test x"$enableval" = "xyes" || AC_DEFINE(NDEBUG, 1, [disable assertions])],
+    [AC_DEFINE(NDEBUG, 1, [disable assertions])])
+    AC_HELP_STRING([--enable-werror],
+        [include -Werror GCC compiler flag (default NO)]),
+    [test x"$enableval" = "xyes" && JC_CFLAGS="${JC_CFLAGS} -Werror"])
+    AC_HELP_STRING([--enable-pregenerated-sources],
+        [install and compile pregenerated sources (default YES)]),
+    [JC_PREGENERATED_SOURCES="$enableval"],
+# Check for required programs
+AC_ARG_VAR(JIKES, [path to jikes Java compiler])
+AC_ARG_VAR(ZIP, [path to zip program])
+AC_ARG_VAR(UNZIP, [path to unzip program])
+AC_PATH_PROG(JAVA, java, /usr/bin/java, [$PATH:/usr/local/java/bin])
+AC_ARG_VAR(JAVA, [path to java executable])
+AC_PATH_PROG(JAVADOC, javadoc, /usr/bin/javadoc, [$PATH:/usr/local/java/bin])
+AC_ARG_VAR(JAVADOC, [path to javadoc executable])
+AC_ARG_VAR(TAR, [path to tar executable])
+AC_ARG_VAR(HOSTGCC, [path to GCC compiler for host architecture])
+# Check for required libraries
+AC_CHECK_LIB(m, fmod,,
+	[AC_MSG_ERROR([required library libm missing])])
+AC_CHECK_LIB(z, inflateInit_,,
+	[AC_MSG_ERROR([required library libz missing])])
+AC_CHECK_LIB(crypto, MD5_Init,,
+	[AC_MSG_ERROR([required library crypto missing])])
+AC_CHECK_LIB(popt, poptGetContext,,
+	[AC_MSG_ERROR([required library libpopt missing])])
+# Check for pthread library, linking either via -pthread or -lpthread
+AC_MSG_CHECKING([whether -pthread gets us the pthread library])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>
+	    void *x=&pthread_create;]])],
+	[AC_MSG_RESULT(yes)],
+	AC_CHECK_LIB(pthread, pthread_create,,
+	    [AC_MSG_ERROR([required library libpthread missing])])])
+# Check for thread local storage support
+AC_MSG_CHECKING([for thread local variable support])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[__thread int foo;]])],
+# Check for required header files
+AC_CHECK_HEADERS(sys/mman.h sys/wait.h pthread.h fcntl.h signal.h \
+	ctype.h errno.h dlfcn.h sched.h math.h pwd.h elf.h \
+	zlib.h openssl/md5.h, [],
+	[AC_MSG_ERROR([required header file missing])])
+AC_CHECK_HEADERS([ucontext.h], [],
+	[AC_MSG_ERROR([required header file missing])],
+# include <signal.h>
+# endif
+# Check for required library functions
+AC_CHECK_FUNCS([getcwd gettimeofday memmove memset munmap], , \
+    [AC_MSG_ERROR([required function missing])])
+# Check for optional library functions
+# See if pthread_attr_setstack() is available
+# Check for declarations
+    [environ explicitly declared somewhere])])
+# Libtool stuff
+# Get host architecture
+[JC_ARCH=`uname -m | sed -e 's/i[456]86/i386/g'`]
+# Generated files

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/doc/Makefile.am
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/doc/Makefile.am?rev=294974&view=auto
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/doc/Makefile.am (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/doc/Makefile.am Tue Oct
 4 19:19:16 2005
@@ -0,0 +1,23 @@
+## $Id: Makefile.am,v 1.5 2005/04/23 22:35:16 archiecobbs Exp $
+info_TEXINFOS=	jc.texi
+htmldir=	$(datadir)/jc/doc
+html_DATA=	jc.html
+man_MANS=	jc.1
+jc.1:		Makefile $(srcdir)/jc.1.in
+	rm -f jc.1
+	sed -e 's,@libdir\@,$(libdir),g' \
+	    -e 's,@datadir\@,$(datadir),g' \
+	    -e 's,@sysconfdir\@,$(sysconfdir),g' \
+	    $(srcdir)/jc.1.in > jc.1
+EXTRA_DIST=	jc.html jc.1.in
+SUFFIXES=	.info .html
+	makeinfo -I $(srcdir) -o $@ --html --no-split $<

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/doc/jc.1.in
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/doc/jc.1.in?rev=294974&view=auto
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/doc/jc.1.in (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/doc/jc.1.in Tue Oct  4
19:19:16 2005
@@ -0,0 +1,196 @@
+.\" Copyright 2005 The Apache Software Foundation or its licensors,
+.\" as applicable.
+.\"  Licensed under the Apache License, Version 2.0 (the "License");
+.\"  you may not use this file except in compliance with the License.
+.\"  You may obtain a copy of the License at
+.\"     http://www.apache.org/licenses/LICENSE-2.0
+.\"  Unless required by applicable law or agreed to in writing, software
+.\"  distributed under the License is distributed on an "AS IS" BASIS,
+.\"  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+.\"  See the License for the specific language governing permissions and
+.\"  limitations under the License.
+.\" Author: Archie Cobbs <archie@dellroad.org>
+.\" $Id: jc.1.in,v 1.11 2005/05/04 13:59:55 archiecobbs Exp $
+.Dd January 1, 2004
+.Dt JC 1
+.Nm jc
+.Nd JC Java Virtual Machine
+.Op options
+.Ar classname
+.Ar ...
+.Op options
+.Fl j
+.Ar jarfile
+.Ar ...
+is a Java virtual machine implementation optimized for ``way ahead of time''
+JC converts Java class files into C program source and header files using
+the Soot framework, compiles these with GCC into ELF objects, and then loads
+the resulting ELF objects into the virtual machine using a built-in ELF loader.
+is more completely described in the accompianing
+.Xr info 1
+style online documentation.
+The command line options are as follows:
+.Bl -tag -compact -width XXXX
+.It Fl j
+.It Fl jar
+.It Fl -jar
+Execute the main class of the JAR file specified as the
+first parameter.
+.It Fl c Ar path
+.It Fl cp Ar path
+.It Fl classpath Ar path
+.It Fl -classpath Ar path
+Set the application class loader's search path.
+.It Fl b Ar path
+.It Fl -bootclasspath Ar path
+Set the bootstrap class loader's search path.
+.It Fl l Ar path
+.It Fl -librarypath Ar path
+Set the search path for native libraries.
+.It Fl L Ar filename
+.It Fl -loadlist Ar filename
+Write the pathnames of all ELF objects successfully loaded during
+execution to the named file.
+.It Fl p Ar name=value
+.It Fl Dname=value
+.It Fl -property Ar name=value
+Set a system property.
+.It Fl v Ar opt1,opt2,...
+.It Fl verbose Ar opt1,opt2,...
+.It Fl -verbose Ar opt1,opt2,...
+Enable verbose output flag(s). The verbose flags are:
+.Bl -tag -compact -width exceptionsXX
+.It gc
+Garbage collection progress
+.It class
+Java class loading
+.It jni
+Native library loading and JNI invocation API calls
+.It jni-invoke
+Native method function invocations
+.It exceptions
+Exceptions posted, thrown, and caught
+.It resolution
+Java class resolution
+.It gen
+Code generation
+.It init
+Java class initialization
+.It obj
+ELF object file loading
+.It Fl V
+.It Fl version
+.It Fl -version
+Display version and exit.
+.It Fl ?
+.It Fl help
+.It Fl -help
+Display command line usage and exit.
+.It Fl mxNNN
+.It Fl XmxNNN
+Same as -p jc.heap.size=NNN
+.It Fl msNNN
+.It Fl XmsNNN
+Same as -p jc.heap.initial=NNN
+.It Fl ssNNN
+.It Fl XssNNN
+Same as -p jc.stack.default=NNN
+.It Fl Xint
+Disable the ELF loader.
+All method execution will use the Java bytecode interpreter.
+Same as -p jc.object.loader.enabled=false.
+.It Fl Xnogen
+Disable on demand code generation, yielding ``mixed mode'' execution.
+ELF objects will be loaded and used if they exist, otherwise
+method execution will use the Java bytecode interpreter.
+Same as -p jc.object.generation.enabled=false
+.It Fl client
+.It Fl server
+.It Fl hotspot
+Ignored for compatibility with Sun's JDK.
+See the online documentation for further information about the various
+verbose flags and system properties.
+JC responds specially to the following signals:
+.Bl -tag -width SIGUSR1X -compact
+Dump debug information to standard output.
+The information includes stack traces of all threads,
+number of loaded classes and memory usage for each active class loader,
+.Bl -tag -width @datadir@/jc/docXX -compact
+.It Pa @libdir@/jc/obj
+System-wide generated JC ELF objects.
+.It Pa @sysconfdir@/jc.conf
+System-wide default command line flags.
+.It Pa @datadir@/jc
+Directory for JC system classes.
+.It Pa @datadir@/jc/doc
+JC documentation.
+.It Pa @datadir@/jc/src
+System-wide generated JC source files.
+.It Pa ~/.jc_src
+Per-user generated JC source files.
+.It Pa ~/.jc_obj
+Per-user generated JC ELF objects.
+.It Pa ~/.jc
+Per-user default command line flags.
+.%T "JC home page"
+.%O http://jcvm.sourceforge.net/
+.%T "SOOT home page"
+.%O http://www.sable.mcgill.ca/soot/
+.An Archie L. Cobbs Aq archie@dellroad.org

View raw message