harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arc...@apache.org
Subject svn commit: r355889 [1/2] - in /incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm: include/ libjc/ libjc/arch/ libjc/arch/i386/ libjc/native/
Date Sun, 11 Dec 2005 03:40:18 GMT
Author: archie
Date: Sat Dec 10 19:40:08 2005
New Revision: 355889

URL: http://svn.apache.org/viewcvs?rev=355889&view=rev
Log:
Many changes further the removal of vestiges of ELF/executable mode support.
This eliminates a lot of code and (as a side effect) simplifies porting.

Removed:
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/c_support.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/class_file.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/class_object.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/debug_line.c
Modified:
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/include/jc_defs.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/Makefile.am
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/arch_definitions.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/arch_libjc.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/arch_structures.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/i386/i386_definitions.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/i386/i386_libjc.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/i386/i386_structures.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/bootstrap.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/class_bytes.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/class_loader.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/definitions.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/derive.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/derive2.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/exception.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/gc_root.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/initialize.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/instance.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/interp.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/invoke.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/jc_invoke.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/libjc.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/load.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/misc.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/native/java_lang_VMThrowable.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/properties.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/resolve.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/resolve2.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/signals.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/stack.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/structures.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/tables.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/thread.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/vm.c

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/include/jc_defs.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/include/jc_defs.h?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/include/jc_defs.h (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/include/jc_defs.h Sat Dec 10 19:40:08 2005
@@ -15,7 +15,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: jc_defs.h,v 1.39 2005/05/08 21:12:07 archiecobbs Exp $
+ * $Id$
  */
 
 #ifndef _JC_DEFS_H_
@@ -32,12 +32,6 @@
  *			      Definitions				*
  ************************************************************************/
 
-/*
- * Binary compatibility version for this header file. This should
- * be incremented after each incompatible change to this file.
- */
-#define _JC_LIBJC_VERSION		0x000c
-
 /* C stuff */
 #define _JC_NULL			((void *)0)
 #define _JC_OFFSETOF(s, f)		((_jc_word)&((s *)0)->f)
@@ -60,8 +54,6 @@
 
 /* Additional flags stored with access flags */
 #define _JC_ACC_JCNI			0x1000	/* JCNI native method (!JNI) */
-#define _JC_ACC_INTERP			0x2000	/* interpreted class/method */
-#define _JC_ACC_PCMAP			0x4000	/* method pc map created */
 
 /*
  * Flags for 'flags' field of the '_jc_type' structure,
@@ -108,25 +100,18 @@
 typedef struct _jc_nonarray_type	_jc_nonarray_type;
 typedef struct _jc_classfile		_jc_classfile;
 typedef struct _jc_super_info		_jc_super_info;
-typedef struct _jc_elf			_jc_elf;
 
 typedef struct _jc_type			_jc_type;
 typedef struct _jc_method		_jc_method;
-typedef struct _jc_method_exec		_jc_method_exec;
 typedef struct _jc_method_code		_jc_method_code;
-typedef struct _jc_linenum_info		_jc_linenum_info;
-typedef struct _jc_pc_map_info		_jc_pc_map_info;
 typedef struct _jc_array		_jc_array;
 typedef struct _jc_object_array		_jc_object_array;
 typedef union _jc_value			_jc_value;
-typedef struct _jc_linenum		_jc_linenum;
 typedef struct _jc_catch_frame		_jc_catch_frame;
-typedef struct _jc_pc_map		_jc_pc_map;
 typedef struct _jc_env_head		_jc_env_head;
 
 typedef struct _jc_field		_jc_field;
 typedef struct _jc_trap_info		_jc_trap_info;
-typedef struct _jc_class_depend		_jc_class_depend;
 typedef struct _jc_inner_class		_jc_inner_class;
 
 typedef struct _jc_lookup		_jc_lookup;
@@ -290,28 +275,6 @@
 	void			*initial_value;	/* initialized static only */
 };
 
-/* Executable method info */
-struct _jc_linenum_info {
-	_jc_linenum		*table;
-	_jc_uint16		len;
-};
-
-struct _jc_pc_map_info {
-	_jc_pc_map		*map;
-	_jc_uint16		len;
-};
-
-struct _jc_method_exec {
-	union {
-		_jc_linenum_info	linenum;    /* from generated code */
-		_jc_pc_map_info		pc_map;	    /* computed at runtime */
-	}			u;
-	_jc_uint16		trap_table_len;
-	_jc_trap_info		*trap_table;
-	const void		*function_end;
-	_jc_splay_node		node;		/* in vm->method_tree */
-};
-
 /* Interpreted method info */
 struct _jc_method_code {
 	unsigned char	*opcodes;
@@ -342,10 +305,7 @@
 	_jc_uint16		num_parameters;
 	_jc_uint16		num_exceptions;
 	const void		*native_function;
-	union {
-		_jc_method_exec		exec;		/* if executable */
-		_jc_method_code		code;		/* if interpreted */
-	}			u;
+	_jc_method_code		code;
 };
 
 /* Type info specific to array types */
@@ -361,14 +321,13 @@
  * The field and method lists must be sorted by name, then signature.
  */
 struct _jc_nonarray_type {
-	jshort			block_size_index;	/* _JC_LIBJC_VERSION */
+	jshort			block_size_index;
 	_jc_uint16		num_vmethods;
 	_jc_uint16		num_fields;
 	_jc_uint16		num_methods;
 	_jc_uint16		num_virtual_refs;
 	_jc_uint16		num_inner_classes;
 	_jc_uint32		instance_size;
-	jlong			hash;
 	const char		*source_file;
 	_jc_field		**fields;	
 	_jc_method		**methods;
@@ -376,14 +335,9 @@
 	void			*class_fields;
 	_jc_inner_class		*inner_classes;
 	_jc_type		*outer_class;
-	int			num_class_depends;
-	_jc_class_depend	*class_depends;
 
 	/* These fields are filled in at run-time */
-	union {
-		_jc_elf		*elf;			/* if executable */
-		_jc_classfile	*cfile;			/* if interpreted */
-	}			u;
+	_jc_classfile		*cfile;
 	_jc_env			*initializing_thread;
 	_jc_super_info		*supers;
 	_jc_method		**mtable;		/* "method vtable" */
@@ -418,24 +372,12 @@
 	const void		*vtable[0];
 };
 
-/* Class dependency info */
-struct _jc_class_depend {
-	const char		*name;
-	jlong			hash;
-};
-
 /* Inner class info */
 struct _jc_inner_class {
 	_jc_type		*type;
 	_jc_uint16		access_flags;
 };
 
-/* Line number table entry */
-struct _jc_linenum {
-	_jc_uint32		cline;		/* c line number */
-	_jc_uint16		jline;		/* java line number */
-};
-
 /* Trap table entry */
 struct _jc_trap_info {
 	_jc_type		*type;		/* (sub)class of Throwable */
@@ -446,8 +388,6 @@
 /* Exception catcher */
 struct _jc_catch_frame {
 	_jc_catch_frame		*next;		/* next deeper catch frame */
-	const _jc_method	*method;	/* method doing the catching */
-	volatile _jc_uint16	region;		/* current method trap region */
 	sigjmp_buf		context;	/* how to catch the exception */
 };
 
@@ -463,273 +403,6 @@
  ************************************************************************/
 
 /*
- * Define the start of the line number table. We force it into the .data
- * section and build it one element at a time via _JC_LINE_NUMBER().
- * This macro must immediately preceed the function itself. The function
- * must not contain any static data that would go into the .data section.
- */
-#define _JC_LINENUM_TABLE(class, method)				\
-static _jc_linenum _jc_ ## class ## $linenum_table$ ## method[]		\
-	__attribute__ ((section(".data"))) = { }
-
-/*
- * Line number table entry. This allows us to map a C source line number
- * to a Java source line number for exception traces and to determine if
- * thrown exceptions are caught within the method's various trap ranges.
- * In turn, ELF debug sections allow us to map PC values to C line numbers.
- */
-#define _JC_LINE_NUMBER(_jline)						\
-    do {								\
-	static volatile _jc_linenum _linenum				\
-	    __attribute__ ((section(".data"))) = {			\
-		.cline=		__LINE__,				\
-		.jline=		_jline,					\
-	};								\
-	asm volatile ("" : : );						\
-    } while (0)
-
-/*
- * Trap table entry.
- */
-#define _JC_TRAP(_type, _start, _end)					\
-    {									\
-    	.type=		(_type),					\
-	.start=		(_start),					\
-	.end=		(_end),						\
-    }
-
-/*
- * Set the current trap region.
- */
-#define _JC_TRAP_REGION(catch, _region)					\
-    do {								\
-	asm volatile ("" : : );						\
-	(catch).region = (_region);					\
-	asm volatile ("" : : );						\
-    } while (0)
-
-/*
- * Macro to establish a return point for C functions catching exceptions.
- * The second parameter points to a local _jc_catch_frame structure. The
- * _JC_CANCEL_TRAPS() macro must be called before this function exits.
- *
- * Because the target list is 'const' it will go into the .rodata section
- * and so won't interfere with the line number table.
- */
-#define _JC_DEFINE_TRAPS(env, catch, method_info, targets...)		\
-    do {								\
-	_jc_env_head *const _eh = (_jc_env_head *)(env);		\
-	static const void *const _targets[]				\
-	    /* __attribute__ ((section(".rodata"))) */			\
-	    = { _JC_NULL, targets };					\
-	int _target_index;						\
-									\
-	(catch).next = _eh->catch_list;					\
-	_eh->catch_list = &(catch);					\
-	(catch).method = (method_info);					\
-	(catch).region = 0;						\
-	if ((_target_index = sigsetjmp((catch).context, 0)) != 0) 	\
-		goto *_targets[_target_index];				\
-    } while (0)
-
-/*
- * Methods that use _JC_DEFINE_TRAPS() must use this macro before
- * returning to the caller.
- */
-#define _JC_CANCEL_TRAPS(env, catch)					\
-    do {								\
-	_jc_env_head *const _eh = (_jc_env_head *)(env);		\
-									\
-	_eh->catch_list = (catch).next;					\
-    } while (0)
-
-/*
- * Retrieve the last exception caught. The "last caught exception" is
- * not traced by GC and so must be copied into a safe place immediately
- * after the exception is caught.
- */
-#define _JC_CAUGHT_EXCEPTION(env)					\
-    ({									\
-	_jc_env_head *const _eh = (_jc_env_head *)(env);		\
-									\
-	_eh->caught;							\
-    })
-
-/*
- * Explicit null pointer check. This is used in cases where we must check
- * for a null pointer but where invoking the method won't necessarily
- * cause a signal to be generated (the only case is invoke-nonvirtual).
- */
-#define _JC_EXPLICIT_NULL_CHECK(env, obj)				\
-    do {								\
-	_jc_object *const _obj0 = (_jc_object *)(obj);			\
-									\
-	*((volatile char *)_obj0);					\
-    } while (0)
-
-/*
- * Stack overflow check.
- *
- * This is performed at the beginning of each method. We simply try
- * to reference a memory address further "up" the (unallocated) stack.
- * When the stack gets almost full, this reference will hit the guard
- * page and cause a fault which we trap with a signal handler.
- */
-#if _JC_DOWNWARD_STACK
-#define _JC_STACK_OVERFLOW_CHECK(env)					\
-	(void)(((volatile char *)&(env))[-_JC_STACK_OVERFLOW_MARGIN])
-#else
-#define _JC_STACK_OVERFLOW_CHECK(env)					\
-	(void)(((volatile char *)&(env))[_JC_STACK_OVERFLOW_MARGIN])
-#endif
-
-/*
- * Thread periodic check.
- *
- * When one thread needs to cause other threads to do a periodic check,
- * we unmap a page of memory referenced by all executing threads when
- * taking backward branches. This causes them to quickly receive a signal.
- */
-#define _JC_PERIODIC_CHECK(env)						\
-    do {								\
-	extern volatile _jc_word _jc_check_address;			\
-									\
-	(void)(_jc_check_address);					\
-    } while (0)
-
-/*
- * Notify of an "active use" of a class or interface, which causes
- * the class or interface to be initialized if it hasn't been already.
- *
- * This is required before the first static field access, static
- * method invocation, or instance creation of a class.
- *
- * Warning: this macro is included in other macros and so must use
- * unique internal variable names.
- */
-#define _JC_ACTIVE_USE(env, class)					\
-    do {								\
-	_jc_type *const _type0 = &_jc_ ## class ## $type.type;		\
-									\
-	if ((_type0->flags & _JC_TYPE_INITIALIZED) == 0)		\
-		_jc_cs_initialize_type((env), _type0);			\
-    } while (0)
-
-/*
- * Invoke the virtual method 'meth' of class 'class' using object 'obj'.
- */
-#define _JC_INVOKE_VIRTUAL(env, class, meth, obj, args...)		\
-    ({									\
-	_jc_ ## class ## $object *const _obj = (obj);			\
-									\
-	(*_obj->vtype->vtable.class.meth)((env), _obj , ## args);	\
-    })
-
-/*
- * Invoke the non-virtual method 'meth' of class 'class' using object 'obj'.
- * If 'nullchk' is non-zero, an explicit null pointer check will be done.
- */
-#define _JC_INVOKE_NONVIRTUAL(env, class, meth, nullchk, obj, args...)	\
-    ({									\
-	_jc_env *const _env = (env);					\
-	_jc_ ## class ## $object *const _obj				\
-	    = (struct _jc_ ## class ## $object *)(obj);			\
-									\
-	if (nullchk)							\
-		_JC_EXPLICIT_NULL_CHECK(_env, _obj);			\
-	_jc_ ## class ## $method$ ## meth(_env, _obj , ## args);	\
-    })
-
-/*
- * Invoke a static method 'meth' of class 'class'. If 'omitchk' is
- * non-zero then no class initialization is performed.
- */
-#define _JC_INVOKE_STATIC(env, class, meth, omitchk, args...)		\
-    ({									\
-	_jc_env *const _env = (env);					\
-									\
-	if (!(omitchk))							\
-		_JC_ACTIVE_USE(_env, class);				\
-	_jc_ ## class ## $method$ ## meth(_env , ## args);		\
-    })
-
-/*
- * Invoke an interface method with parameter types 'pdecl', returning
- * 'rtype', and having method signature hash 'sighash', on object 'obj'.
- *
- * First we try the "quick" lookup table, and if that fails, fall back
- * to searching the interface method hash table.
- */
-#define _JC_INVOKE_INTERFACE(env, obj, hash, rtype, pdecl, args...)	\
-    ({									\
-	_jc_env *const _env = (env);					\
-	const jlong _hash = (hash);					\
-	_jc_object *const _obj = (_jc_object *)(obj);			\
-	_jc_type *const _type = _obj->type;				\
-	const jint _bucket = (jint)(_hash) & (_JC_IMETHOD_HASHSIZE - 1);\
-	rtype (*_func) pdecl _JC_JCNI_ATTR;				\
-									\
-	if ((_func = _type->imethod_quick_table[_bucket]) == _JC_NULL)	\
-		_func = _jc_cs_lookup_interface(_env, _obj, _hash);	\
-	(*_func)(_env, _obj , ## args);					\
-    })
-
-/*
- * Access a static field 'field' of class 'class'. If 'omitchk' is
- * non-zero then no class initialization is performed.
- */
-#define _JC_STATIC_FIELD(env, class, field, omitchk)			\
-    (*({								\
-	if (!(omitchk))							\
-		_JC_ACTIVE_USE((env), class);				\
-	&_jc_ ## class ## $class_fields.field;				\
-    }))
-
-/*
- * Access a reference instance field 'field' of class 'class' from
- * object 'obj'.
- */
-#define _JC_REF_FIELD(env, obj, class, field)				\
-    (*({								\
-	_jc_ ## class ## $object *const _obj				\
-	    = (struct _jc_ ## class ## $object *)(obj);			\
-									\
-	&_obj->refs[-1].class.field;					\
-    }))
-
-/*
- * Access a non-reference instance field 'field' of class 'class' from
- * object 'obj'.
- */
-#define _JC_PRIM_FIELD(env, obj, class, field)				\
-    (*({								\
-	_jc_ ## class ## $object *const _obj				\
-	    = (struct _jc_ ## class ## $object *)(obj);			\
-									\
-	&_obj->nonrefs.class.field;					\
-    }))
-
-/*
- * Return an intern'd String created from the supplied UTF-8 C string.
- * This macro is used for embedding String constants in the code.
- *
- * Note the static variable which constitutes an implicit object
- * reference within the code that must be accounted for during GC.
- *
- * We must put this reference in the .rodata section so it won't
- * interfere with the line number table. Since we don't actually load
- * the .rodata with read-only protection, this won't cause problems.
- */
-#define _JC_STRING(env, utf8)						\
-    ({									\
-	static _jc_object *_obj __attribute__ ((section(".rodata")));	\
-									\
-	if (_obj == _JC_NULL)						\
-		_obj = _jc_cs_intern_string_utf8((env), &_obj, (utf8));	\
-	(struct _jc_java_lang_String$object *)_obj;			\
-    })
-
-/*
  * Compare two long values.
  */
 #define _JC_LCMP(x, y)							\
@@ -855,266 +528,6 @@
 	(ctype)_val;							\
     })
 
-/*
- * Access an element in an array of type 'type', where 'type' is one of
- * 'boolean', 'byte', 'char', 'short', 'int', 'long', 'float', or 'double'.
- */
-#define _JC_PRIM_ELEMENT(env, type, array, index, chklo, chkhi)		\
-    (*({								\
-	_jc_env *const _env = (env);					\
-	_jc_ ## type ## _array *const _obj				\
-	    = (struct _jc_ ## type ## _array *)(array);			\
-	const jint _index = (index);					\
-									\
-	if ((chklo) && _index < 0)					\
-		_jc_cs_throw_array_index_exception(_env, _index);	\
-	if ((chkhi) && _index >= _obj->length)				\
-		_jc_cs_throw_array_index_exception(_env, _index);	\
-	&_obj->elems[index];						\
-    }))
-
-/*
- * Access an element in an array of objects. Note that the array grows
- * backwards in memory from the base of the object.
- */
-#define _JC_REF_ELEMENT(env, array, index, chklo, chkhi)		\
-    (*({								\
-	_jc_env *const _env = (env);					\
-	_jc_object_array *const _obj					\
-	    = (struct _jc_object_array *)(array);			\
-	const jint _index = (index);					\
-									\
-	if ((chklo) && _index < 0)					\
-		_jc_cs_throw_array_index_exception(_env, _index);	\
-	if ((chkhi) && _index >= _obj->length)				\
-		_jc_cs_throw_array_index_exception(_env, _index);	\
-	&_obj->elems[~(index)];						\
-    }))
-
-/*
- * Check type compatibility before storing to a reference array.
- * This will also cause a NullPointerException if 'array' is null.
- */
-#define _JC_ARRAYSTORE_CHECK(env, ary, obj)				\
-    do {								\
-	_jc_env *const _env = (env);					\
-	_jc_type *const _etype = (ary)->type->u.array.element_type;	\
-	_jc_object *const _obj = (obj);					\
-									\
-	if (_obj != _JC_NULL && !_jc_cs_instanceof(_env, _obj, _etype))	\
-		_jc_cs_throw_array_store_exception(_env, _obj, _etype);	\
-    } while (0)
-
-/*
- * Get the length of an array. This is a read-only value.
- */
-#define _JC_ARRAY_LENGTH(env, array)					\
-    ({									\
-	_jc_array *const _obj = (_jc_array *)(array);			\
-									\
-	_obj->length;							\
-    })
-
-/*
- * Create a new object of type 'class'.
- */
-#define _JC_NEW(env, class)						\
-    ({									\
-	_jc_cs_new_object(env, &_jc_ ## class ## $type.type);		\
-    })
-
-/*
- * Same as _JC_NEW() but for stack-allocated objects.
- */
-#define _JC_STACK_NEW(env, mem, class)					\
-    ({									\
-	_jc_cs_init_object(env, mem, &_jc_ ## class ## $type.type);	\
-    })
-
-/*
- * Create a new N-dimensional array of 'type', where 'type' is one of
- * 'boolean', 'byte', 'char', 'short', 'int', 'long', 'float', or 'double',
- * and having length 'size', where N is 'dims'.
- *
- * Only the first array dimension is instantiated.
- *
- * Note: 'dims' must be a plain decimal integer constant with no
- * leading zeroes.
- */
-#define _JC_NEW_PRIM_ARRAY(env, type, dims, size)			\
-	((_jc_ ## type ## _array *)_jc_cs_new_array(env,		\
-	    &_jc_ ## type ## $array ## dims ## $prim$type, size))
-
-/*
- * Same as _JC_NEW_PRIM_ARRAY() but for stack-allocated arrays.
- */
-#define _JC_STACK_NEW_PRIM_ARRAY(env, mem, type, dims, size)		\
-    ({									\
-	const jint _size = (size);					\
-	    								\
-	(_jc_ ## type ## _array *)_jc_cs_init_array(env,		\
-	    mem, &_jc_ ## type ## $array ## dims ## $prim$type, _size);	\
-    })
-
-/*
- * Create a new N-dimensional array of objects of class 'class'
- * having length 'size', where N is 'dims'.
- *
- * Only the first array dimension is instantiated.
- *
- * Note: 'dims' must be a plain decimal integer constant with no
- * leading zeroes.
- */
-#define _JC_NEW_REF_ARRAY(env, class, dims, size)			\
-	((_jc_object_array *)_jc_cs_new_array(env,			\
-	    &_jc_ ## class ## $array ## dims ## $type, size))
-
-/*
- * Same as _JC_NEW_REF_ARRAY() but for stack-allocated arrays.
- */
-#define _JC_STACK_NEW_REF_ARRAY(env, mem, class, dims, size)		\
-    ({									\
-	const jint _size = (size);					\
-	    								\
-	(_jc_object_array *)_jc_cs_init_array(env,			\
-	    mem, &_jc_ ## class ## $array ## dims ## $type, _size);	\
-    })
-
-/*
- * Create a new multi-dimensional array of 'base_class' objects having
- * dimensions 'dims'. There must be 'dims' subsequent parameters to the
- * macro giving the sub-array sizes (or -1 for no subarray creation).
- * If -1 appears, all following sizes must also be -1.
- *
- * Note: 'dims' must be a plain decimal integer constant with no
- * leading zeroes.
- */
-#define _JC_NEW_REF_MULTIARRAY(env, base_class, dims, nsizes, sizes...)	\
-    ({									\
-	const jint _sizes[] = { sizes };				\
-									\
-	_jc_cs_new_multiarray((env),					\
-	    &_jc_ ## base_class ## $array ## dims ## $type,		\
-	    (nsizes), _sizes);						\
-    })
-
-/*
- * Same as _JC_NEW_REF_MULTIARRAY() but for stack-allocated arrays.
- */
-#define _JC_STACK_NEW_REF_MULTIARRAY(env, mem, base_class, dims, nsizes, sizes...)\
-    ({									\
-	const jint _sizes[] = { sizes };				\
-									\
-	_jc_cs_init_multiarray((env),					\
-	    mem, &_jc_ ## base_class ## $array ## dims ## $type,	\
-	    (nsizes), _sizes);						\
-    })
-
-/*
- * Create a new multi-dimensional array of 'type' having dimensions 'dims'
- * and lengths 'sizes', where 'type' is one of 'boolean', 'byte', 'char',
- * 'short', 'int', 'long', 'float', or 'double'.
- *
- * Note: 'dims' must be a plain decimal integer constant.
- */
-#define _JC_NEW_PRIM_MULTIARRAY(env, type, dims, nsizes, sizes...)	\
-    ({									\
-	int _sizes[] = { sizes };					\
-									\
-	_jc_cs_new_multiarray((env),					\
-	    &_jc_ ## type ## $array ## dims ## $prim$type,		\
-	    (nsizes), _sizes);						\
-    })
-
-/*
- * Same as _JC_NEW_PRIM_MULTIARRAY() but for stack-allocated arrays.
- */
-#define _JC_STACK_NEW_PRIM_MULTIARRAY(env, mem, type, dims, nsizes, sizes...)\
-    ({									\
-	int _sizes[] = { sizes };					\
-									\
-	_jc_cs_init_multiarray((env),					\
-	    mem, &_jc_ ## type ## $array ## dims ## $prim$type,	\
-	    (nsizes), _sizes);						\
-    })
-
-/*
- * Determine if the object 'obj' is an instance of 'type'.
- */
-#define _JC_INSTANCEOF(env, obj, type)					\
-	_jc_cs_instanceof((env), (_jc_object *)(obj), (type))
-
-/*
- * Determine if the object 'obj' is an instance of 'type'
- * when 'type' is known to be a final class.
- */
-#define _JC_INSTANCEOF_FINAL(env, obj, typ)				\
-    ({									\
-	_jc_object *const _obj = (obj);					\
-	_jc_type *const _type = (typ);					\
-									\
-	_obj != _JC_NULL && _obj->type == _type;			\
-    })
-
-/*
- * Cast 'obj' to type 'type', which must not be primitive.
- */
-#define _JC_CAST(env, type, obj)					\
-    ({									\
-	_jc_env *const _env = (env);					\
-	_jc_object *const _obj = (obj);					\
-	_jc_type *const _type = (type);					\
-									\
-	if (_obj != _JC_NULL && !_jc_cs_instanceof(_env, _obj, _type))	\
-		_jc_cs_throw_class_cast_exception(_env, _obj, _type);	\
-	_obj;								\
-    })
-
-/*
- * Optimization of _JC_CAST() where 'type' is a type with no sub-types.
- */
-#define _JC_CAST_FINAL(env, typ, obj)					\
-    ({									\
-	_jc_env *const _env = (env);					\
-	_jc_object *const _obj = (obj);					\
-	_jc_type *const _type = (typ);					\
-									\
-	if (_obj != _JC_NULL && _obj->type != _type)			\
-		_jc_cs_throw_class_cast_exception(_env, _obj, _type);	\
-	_obj;								\
-    })
-
-/*
- * Resolve and invoke a native method.
- *
- * 'jvalp' points to a _jc_value into which the return value is copied.
- * This should only be used within the generated native method function.
- * 'params' should include the instance object iff method is not static.
- */
-#define _JC_INVOKE_NATIVE_METHOD(env, minfo, jvalp, params...)	\
-	_jc_cs_invoke_native_method((env), (minfo), (jvalp) , ## params)
-
-/*
- * This macro "implements" abstract methods.
- * It causes an AbstractMethodError to be thrown.
- */
-#define _JC_ABSTRACT_METHOD(env, minfo)					\
-	_jc_cs_throw_abstract_method_error((env), (minfo))
-
-/*
- * Enter/exit object monitor.
- */
-#define _JC_MONITOR_ENTER(env, obj)					\
-	_jc_cs_monitorenter((env), (_jc_object *)(obj))
-#define _JC_MONITOR_EXIT(env, obj)					\
-	_jc_cs_monitorexit((env), (_jc_object *)(obj))
-
-/*
- * Throw an exception.
- */
-#define _JC_THROW(env, obj)						\
-	_jc_cs_throw((env), (_jc_object *)(obj))
-
 /************************************************************************
  *				External data				*
  ************************************************************************/
@@ -1139,57 +552,6 @@
 _JC_DECL_ARRAYS(long, prim$type);
 _JC_DECL_ARRAYS(float, prim$type);
 _JC_DECL_ARRAYS(double, prim$type);
-
-/* C support functions */
-extern void		_jc_cs_initialize_type(_jc_env *env, _jc_type *type)
-				_JC_JCNI_ATTR;
-extern jboolean		_jc_cs_instanceof(_jc_env *env, _jc_object *obj,
-				_jc_type *type) _JC_JCNI_ATTR;
-extern _jc_object	*_jc_cs_intern_string_utf8(_jc_env *env,
-				_jc_object **refp, const char *utf8)
-				_JC_JCNI_ATTR;
-extern void		_jc_cs_invoke_native_method(_jc_env *env,
-				_jc_method *minfo, _jc_value *retval, ...)
-				_JC_JCNI_ATTR;
-extern const void	*_jc_cs_lookup_interface(_jc_env *env, _jc_object *obj,
-				jlong sig_hash) _JC_JCNI_ATTR;
-extern void		_jc_cs_monitorenter(_jc_env *env, _jc_object *obj)
-				_JC_JCNI_ATTR;
-extern void		_jc_cs_monitorexit(_jc_env *env, _jc_object *obj)
-				_JC_JCNI_ATTR;
-extern _jc_array	*_jc_cs_new_array(_jc_env *env, _jc_type *type,
-				jint size) _JC_JCNI_ATTR;
-extern _jc_array	*_jc_cs_init_array(_jc_env *env, void *mem,
-				_jc_type *type, jint size) _JC_JCNI_ATTR;
-extern _jc_array	*_jc_cs_new_multiarray(_jc_env *env, _jc_type *type,
-				jint num_sizes, const jint *sizes)
-				_JC_JCNI_ATTR;
-extern _jc_array	*_jc_cs_init_multiarray(_jc_env *env, void *mem,
-				_jc_type *type, jint num_sizes,
-				const jint *sizes) _JC_JCNI_ATTR;
-extern _jc_object	*_jc_cs_new_object(_jc_env *env, _jc_type *type)
-				_JC_JCNI_ATTR;
-extern _jc_object	*_jc_cs_init_object(_jc_env *env, void *mem,
-				_jc_type *type) _JC_JCNI_ATTR;
-extern void		_jc_cs_panic(_jc_env *env, const char *fmt, ...)
-				__attribute__ ((noreturn)) _JC_JCNI_ATTR;
-extern void		_jc_cs_throw(_jc_env *env, _jc_object *obj)
-				__attribute__ ((noreturn)) _JC_JCNI_ATTR;
-extern void		_jc_cs_throw_abstract_method_error(_jc_env *env,
-				_jc_method *minfo) __attribute__ ((noreturn))
-				_JC_JCNI_ATTR;
-extern void		_jc_cs_throw_array_index_exception(_jc_env *env,
-				jint indx) __attribute__ ((noreturn))
-				_JC_JCNI_ATTR;
-extern void		_jc_cs_throw_array_store_exception(_jc_env *env,
-				_jc_object *obj, _jc_type *type)
-				__attribute__ ((noreturn)) _JC_JCNI_ATTR;
-extern void		_jc_cs_throw_class_cast_exception(_jc_env *env,
-				_jc_object *obj, _jc_type *type)
-				__attribute__ ((noreturn)) _JC_JCNI_ATTR;
-extern void		_jc_cs_throw_null_pointer_exception(_jc_env *env)
-				__attribute__ ((noreturn)) _JC_JCNI_ATTR;
-extern jdouble		_jc_cs_fmod(jdouble x, jdouble y) _JC_JCNI_ATTR;
 
 /* Empty interface method lookup tables */
 extern const		void *_jc_empty_quick_table[_JC_IMETHOD_HASHSIZE];

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/Makefile.am
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/Makefile.am?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/Makefile.am (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/Makefile.am Sat Dec 10 19:40:08 2005
@@ -10,14 +10,10 @@
 libjc_la_SOURCES= \
 			array.c \
 			bootstrap.c \
-			c_support.c \
 			cf_parse.c \
 			cl_alloc.c \
 			class_bytes.c \
-			class_file.c \
 			class_loader.c \
-			class_object.c \
-			debug_line.c \
 			derive.c \
 			derive2.c \
 			exception.c \

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/arch_definitions.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/arch_definitions.h?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/arch_definitions.h (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/arch_definitions.h Sat Dec 10 19:40:08 2005
@@ -68,10 +68,6 @@
     _JC_PAGE_SHIFT	log_2 of the size of a VM page (as returned by
 			getpagesize(3)). E.g., 4096 byte pages -> 12.
 
-    _JC_ELF_CLASS	ELF object class
-    _JC_ELF_DATA	ELF object data format
-    _JC_ELF_MACHINE	ELF object machine type
-
     _JC_STACK_ALIGN	Runtime stack alignment
 
     _JC_BIG_ENDIAN	1 if big endian, 0 if little endian
@@ -81,7 +77,8 @@
 
     _JC_REGISTER_OFFS	Initializer for an array of integers representing
     			the offsets into a mcontext_t structure where the
-			registers live. Used for garbage collection.
+			registers possibly containing references live.
+			Used for garbage collection.
 
 */
 

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/arch_libjc.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/arch_libjc.h?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/arch_libjc.h (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/arch_libjc.h Sat Dec 10 19:40:08 2005
@@ -91,80 +91,17 @@
 	the given range of memory (if appropriate), as the memory
 	contains newly loaded executable code.
 
-Stack Functions
----------------
-
-The following functions all manipulate '_jc_stack_frame' objects.
-A stack frame object is associated with a specific function invocation.
-Typically a '_jc_stack_frame' is just functionA()'s saved frame pointer.
+Stack Pointer Functions
+-----------------------
 
 These functions must not call any other functions that could allocate
 memory, etc. See "arch/arch_structures.h".
 
-    void
-    _jc_stack_frame_init(_jc_stack_frame *framep)
-
-	Initialize 'frame' to the invalid stack frame value.
-
-    jboolean
-    _jc_stack_frame_valid(_jc_stack_frame frame)
-
-	Returns JNI_TRUE if the frame is not the invalid frame.
-
-    jboolean
-    _jc_stack_frame_equal(_jc_stack_frame frame1, _jc_stack_frame frame2)
-
-	Returns JNI_TRUE if the two frames are the same.
-
-    void
-    _jc_stack_frame_current(_jc_stack_frame *framep)
-
-	Initialize 'frame' to refer to the stack frame associated with
-	the invocation from functionA() -> functionB(), where functionB()
-	is the function calling _jc_stack_frame_current().
-
-    void
-    _jc_stack_frame_next(_jc_stack_frame *frame, const void **pcp)
-
-	Advance 'frame' to the frame one deeper on the stack
-	and update *pcp to be the PC address in the deeper frame.
-
-    const void *
-    _jc_stack_frame_sp(_jc_stack_frame frame)
-
-	Convert a stack frame into a stack address. If 'frame' is associated
-	with functionA(), then the stack address is only required to include
-	the stack variables of the fuction that invoked functionA() (but not
-	functionA() itself). The pointer must be aligned to _JC_STACK_ALIGN.
-
     const void *
     _jc_mcontext_sp(const mcontext_t *mctx)
 
     	Returns the saved stack pointer from an mcontext_t structure.
 
-    const void *
-    _jc_mcontext_pc(const mcontext_t *mctx)
-
-    	Returns the saved PC from an mcontext_t structure. This should
-	correspond to the PC address in functionA() where functionA() is
-	the function that called getcontext() or caught the signal.
-
-    _jc_stack_frame
-    _jc_mcontext_frame(const mcontext_t *mctx)
-
-    	Returns the stack frame from an mcontext_t structure. This
-	should correspond to functionA() calling functionB(), where
-	functionA() is the function that called getcontext() or
-	caught the signal.
-
-    const void *
-    _jc_signal_fault_address(int sig_num, siginfo_t *info, ucontext_t *uctx)
-
-	This function is invoked during signal handling. The three
-	parameters are copied unchanged by the POSIX SIG_INFO style
-	handler. This function should return the fault address, i.e.,
-	the illegal memory address which could not be accessed, if any.
-
 */
 
 /************************************************************************
@@ -181,19 +118,8 @@
 				int nparams, const u_char *ptypes, int nwords,
 				_jc_word *words, _jc_value *retval);
 
-/* Stack frame functions */
-extern void		_jc_stack_frame_init(_jc_stack_frame *framep);
-extern void		_jc_stack_frame_next(_jc_stack_frame *prev,
-				const void **pcp);
-extern jboolean		_jc_stack_frame_valid(_jc_stack_frame frame);
-extern jboolean		_jc_stack_frame_equal(_jc_stack_frame frame1,
-			_jc_stack_frame frame2);
-extern const void	*_jc_stack_frame_sp(_jc_stack_frame frame);
+/* Stack pointer functions */
 extern const void	*_jc_mcontext_sp(const mcontext_t *mctx);
-extern const void	*_jc_mcontext_pc(const mcontext_t *mctx);
-extern _jc_stack_frame	_jc_mcontext_frame(const mcontext_t *mctx);
-extern const void	*_jc_signal_fault_address(int sig_num,
-				siginfo_t *info, ucontext_t *uctx);
 
 /************************************************************************
  *			Architecture-specific functions			*

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/arch_structures.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/arch_structures.h?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/arch_structures.h (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/arch_structures.h Sat Dec 10 19:40:08 2005
@@ -28,26 +28,7 @@
 /*
 
 This purpose of this file is to define architecture-specific structures.
-Here is a summary of structures that need to be defined by this file or
-an included file:
-
-Stack Frames
-------------
-
-This file must define a '_jc_stack_frame' type, an opaque type
-representing a stack frame, with the following properties:
-
-    - A stack frame is always associated with a function invocation,
-      i.e., there is a calling function and a called function.
-    - A stack frame is cabable of providing the return address in the
-      calling function, i.e., the address of the next instruction to
-      execute in the calling function after the called function returns.
-    - A stack frame does not need to remain valid after the calling
-      function returns.
-    - Two stack frames can be compared for equality, where equality means
-      they refer to the same caller -> callee invocation on the stack.
-    - There must be an 'invalid' value not equal to any other value.
-    - It is possible to get the 'current' stack frame.
+Currently there are none.
 
 */
 

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/i386/i386_definitions.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/i386/i386_definitions.h?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/i386/i386_definitions.h (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/i386/i386_definitions.h Sat Dec 10 19:40:08 2005
@@ -15,7 +15,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: i386_definitions.h,v 1.6 2005/05/08 21:12:07 archiecobbs Exp $
+ * $Id$
  */
 
 #ifndef _ARCH_I386_DEFINITIONS_H_
@@ -26,10 +26,6 @@
 #endif
 
 #define	_JC_PAGE_SHIFT		12		/* 4096 byte pages */
-
-#define _JC_ELF_CLASS		ELFCLASS32
-#define _JC_ELF_DATA		ELFDATA2LSB
-#define _JC_ELF_MACHINE		EM_386
 
 #define _JC_STACK_ALIGN		2
 

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/i386/i386_libjc.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/i386/i386_libjc.h?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/i386/i386_libjc.h (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/i386/i386_libjc.h Sat Dec 10 19:40:08 2005
@@ -15,7 +15,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: i386_libjc.h,v 1.7 2005/05/08 21:12:07 archiecobbs Exp $
+ * $Id$
  */
 
 #ifndef _ARCH_I386_LIBJC_H_
@@ -45,44 +45,6 @@
 	/* nothing to do: i386 has coherent data and instruction caches */
 }
 
-extern inline void
-_jc_stack_frame_init(_jc_stack_frame *framep)
-{
-	*framep = NULL;
-}
-
-#define _jc_stack_frame_current(framep)					\
-    do {								\
-	*(framep) = __builtin_frame_address(0);				\
-    } while (0)
-
-extern inline void
-_jc_stack_frame_next(_jc_stack_frame *framep, const void **pcp)
-{
-	_jc_word *const ebp = *framep;
-
-	*pcp = (const void *)ebp[1];	/* saved %eip is one slot above %ebp */
-	*framep = (_jc_word *)ebp[0];	/* %ebp points to saved %ebp */
-}
-
-extern inline jboolean
-_jc_stack_frame_valid(_jc_stack_frame frame)
-{
-	return frame != NULL;
-}
-
-extern inline jboolean
-_jc_stack_frame_equal(_jc_stack_frame frame1, _jc_stack_frame frame2)
-{
-	return frame1 == frame2;
-}
-
-extern inline const void *
-_jc_stack_frame_sp(_jc_stack_frame frame)
-{
-	return (const void *)frame;
-}
-
 #ifdef __FreeBSD__
 
 extern inline const void *
@@ -91,48 +53,12 @@
 	return (const void *)mctx->mc_esp;
 }
 
-extern inline const void *
-_jc_mcontext_pc(const mcontext_t *mctx)
-{
-	return (const void *)mctx->mc_eip;
-}
-
-extern inline _jc_stack_frame
-_jc_mcontext_frame(const mcontext_t *mctx)
-{
-	return (_jc_word *)mctx->mc_ebp;
-}
-
-extern inline const void *
-_jc_signal_fault_address(int sig_num, siginfo_t *info, ucontext_t *uctx)
-{
-	return (const void *)uctx->uc_mcontext.mc_err;
-}
-
 #elif defined(__linux__)
 
 extern inline const void *
 _jc_mcontext_sp(const mcontext_t *mctx)
 {
 	return (const void *)mctx->gregs[REG_ESP];
-}
-
-extern inline const void *
-_jc_mcontext_pc(const mcontext_t *mctx)
-{
-	return (const void *)mctx->gregs[REG_EIP];
-}
-
-extern inline _jc_stack_frame
-_jc_mcontext_frame(const mcontext_t *mctx)
-{
-	return (_jc_word *)mctx->gregs[REG_EBP];
-}
-
-extern inline const void *
-_jc_signal_fault_address(int sig_num, siginfo_t *info, ucontext_t *uctx)
-{
-	return (const void *)info->si_addr;
 }
 
 #else

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/i386/i386_structures.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/i386/i386_structures.h?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/i386/i386_structures.h (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/arch/i386/i386_structures.h Sat Dec 10 19:40:08 2005
@@ -15,33 +15,11 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: i386_structures.h,v 1.1.1.1 2004/02/20 05:15:49 archiecobbs Exp $
+ * $Id$
  */
 
 #ifndef _ARCH_I386_STRUCTURES_H_
 #define _ARCH_I386_STRUCTURES_H_
-
-/*
- * i386 stack frame:
- *
- *	| ...         |
- *	+-------------+
- *	| param2      |
- *	+-------------+
- *	| param1      |
- *	+-------------+
- *	| param0      |
- *	+-------------+
- *	| return addr |
- *	+-------------+
- *	| saved %epb  |    <== %ebp
- *	+-------------+
- *	| locals...   |
- *
- * So all we need is a pointer to the saved %epb register.
- */
-
-typedef _jc_word	*_jc_stack_frame;	/* pointer to saved %epb */
 
 #endif	/* _ARCH_I386_STRUCTURES_H_ */
 

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/bootstrap.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/bootstrap.c?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/bootstrap.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/bootstrap.c Sat Dec 10 19:40:08 2005
@@ -15,7 +15,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: bootstrap.c,v 1.17 2005/11/09 18:14:22 archiecobbs Exp $
+ * $Id$
  */
 
 #include "libjc.h"
@@ -205,8 +205,6 @@
 	BOOTSTRAP_TYPE("[Ljava/lang/reflect/Method;", Method_array);
 	for (i = _JC_TYPE_BOOLEAN; i <= _JC_TYPE_VOID; i++)
 		BOOTSTRAP_TYPE(_jc_prim_wrapper_class[i], prim_wrapper[i]);
-	if (vm->generation_enabled)
-		BOOTSTRAP_TYPE("org/dellroad/jc/Generate", Generate);
 
 	/* Find special constructors */
 	RESOLVE_CONSTRUCTOR(StackTraceElement,
@@ -272,12 +270,6 @@
 
 		snprintf(mname, sizeof(mname), "%sValue", _jc_prim_names[i]);
 		RESOLVE_METHOD1(prim_wrapper[i], value, mname, signature, 0);
-	}
-	if (vm->generation_enabled) {
-		RESOLVE_METHOD(Generate, v,
-		    "()Lorg/dellroad/jc/Generate;", _JC_ACC_STATIC);
-		RESOLVE_METHOD(Generate, generateObject,
-		    "(Ljava/lang/String;Ljava/lang/ClassLoader;)V", 0);
 	}
 
 	/* Find special fields */

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/class_bytes.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/class_bytes.c?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/class_bytes.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/class_bytes.c Sat Dec 10 19:40:08 2005
@@ -15,13 +15,12 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: class_bytes.c,v 1.5 2005/03/18 23:16:28 archiecobbs Exp $
+ * $Id$
  */
 
 #include "libjc.h"
 
 /* Internal functions */
-static void		_jc_hash_classbytes(_jc_classbytes *bytes);
 static void		_jc_munmap_freer(_jc_classbytes *bytes);
 static void		_jc_free_freer(_jc_classbytes *bytes);
 
@@ -196,12 +195,8 @@
 	}
 	bytes->bytes = addr;
 	bytes->length = info.st_size;
-	bytes->refs = 1;
 	bytes->freer = _jc_munmap_freer;
 
-	/* Compute hash */
-	_jc_hash_classbytes(bytes);
-
 	/* Set return value to the bytes found */
 	*bytesp = bytes;
 
@@ -254,7 +249,6 @@
 	memset(bytes, 0, sizeof(*bytes));
 	bytes->bytes = (u_char *)bytes + sizeof(*bytes);
 	bytes->length = zent->uncomp_len;
-	bytes->refs = 1;
 	bytes->freer = _jc_free_freer;
 
 	/* Extract file contents from ZIP file */
@@ -263,9 +257,6 @@
 		return JNI_ERR;
 	}
 
-	/* Compute hash */
-	_jc_hash_classbytes(bytes);
-
 	/* Set return value to the bytes found */
 	*bytesp = bytes;
 	return JNI_OK;
@@ -287,76 +278,30 @@
 	memset(bytes, 0, sizeof(*bytes));
 	bytes->bytes = (u_char *)bytes + sizeof(*bytes);
 	bytes->length = len;
-	bytes->refs = 1;
 	bytes->freer = _jc_free_freer;
 
 	/* Copy bytes */
 	memcpy(bytes->bytes, data, len);
 
-	/* Compute hash */
-	_jc_hash_classbytes(bytes);
-
 	/* Done */
 	return bytes;
 }
 
 /*
- * Add a reference to a _jc_classbytes structure.
- */
-_jc_classbytes *
-_jc_dup_classbytes(_jc_classbytes *bytes)
-{
-	_jc_word old_refs;
-
-	_JC_ASSERT(bytes->refs > 0);
-	do
-		old_refs = bytes->refs;
-	while (!_jc_compare_and_swap(&bytes->refs, old_refs, old_refs + 1));
-	return bytes;
-}
-
-/*
  * Unreference a _jc_classbytes structure.
  */
 void
 _jc_free_classbytes(_jc_classbytes **bytesp)
 {
 	_jc_classbytes *bytes = *bytesp;
-	_jc_word old_refs;
 
 	/* Sanity check */
 	if (bytes == NULL)
 		return;
 	*bytesp = NULL;
 
-	/* Decrement ref count */
-	_JC_ASSERT(bytes->refs > 0);
-	do
-		old_refs = bytes->refs;
-	while (!_jc_compare_and_swap(&bytes->refs, old_refs, old_refs - 1));
-
-	/* Free structure if that was the last reference */
-	if (bytes->refs == 0)
-		(*bytes->freer)(bytes);
-}
-
-/*
- * Compute the hash value of a class' bytes.
- */
-static void
-_jc_hash_classbytes(_jc_classbytes *bytes)
-{
-	u_char md5[MD5_DIGEST_LENGTH];
-	MD5_CTX ctx;
-	int i;
-
-	MD5_Init(&ctx);
-	MD5_Update(&ctx, bytes->bytes, bytes->length);
-	MD5_Final(md5, &ctx);
-	for (bytes->hash = i = 0; i < 8; i++) {
-		bytes->hash = (bytes->hash << 8)
-		    | md5[MD5_DIGEST_LENGTH - 8 + i];
-	}
+	/* Free structure */
+	(*bytes->freer)(bytes);
 }
 
 /*

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/class_loader.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/class_loader.c?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/class_loader.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/class_loader.c Sat Dec 10 19:40:08 2005
@@ -139,10 +139,8 @@
 	_JC_MUTEX_ASSERT(env, vm->mutex);
 
 	/* Create and initialize new structure */
-	if ((loader = _jc_vm_zalloc(env, sizeof(*loader)
-	    + vm->object_path_len * sizeof(*loader->objects_loaded))) == NULL)
+	if ((loader = _jc_vm_zalloc(env, sizeof(*loader))) == NULL)
 		return NULL;
-	loader->objects_loaded = (jboolean *)(loader + 1);
 
 	/* Initialize class loader memory manager */
 	_jc_uni_alloc_init(&loader->uni, _JC_CL_ALLOC_MIN_PAGES,
@@ -214,10 +212,7 @@
 	 * 3. Destroy any associated ELF linking information
 	 */
 	while (loader->defined_types.size > 0) {
-		_jc_class_node *cnode;
-		_jc_class_node key;
 		_jc_type *type;
-		int j;
 
 		/* Get type at the root of the tree */
 		_JC_ASSERT(loader->defined_types.root != NULL);
@@ -228,33 +223,8 @@
 		if (_JC_FLG_TEST(type, ARRAY))
 			goto remove_type;
 
-		/* Remove all this class' methods from the method tree */
-		if (!_JC_ACC_TEST(type, INTERP)) {
-			for (j = 0; j < type->u.nonarray.num_methods; j++) {
-				_jc_method *const method
-				    = type->u.nonarray.methods[j];
-
-				if (method->function == NULL)
-					continue;
-				_jc_splay_remove(&vm->method_tree, method);
-			}
-		}
-
-		/* Unreference the class file associated with this class */
-		key.name = type->name;
-		cnode = _jc_splay_find(&vm->classfiles, &key);
-		_JC_ASSERT(cnode != NULL);
-		_jc_unref_class_node(vm, &cnode);
-
-		/* Unreference class files this class depends on */
-		_jc_unref_class_deps(vm, type->u.nonarray.class_depends,
-		    type->u.nonarray.num_class_depends);
-
 		/* Free supers info (unresolved ELF types) */
 		_jc_vm_free(&type->u.nonarray.supers);
-
-		/* Unreference parsed class file */
-		_jc_destroy_classfile(&type->u.nonarray.u.cfile);
 
 remove_type:
 		/* Remove this type from the tree */

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/definitions.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/definitions.h?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/definitions.h (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/definitions.h Sat Dec 10 19:40:08 2005
@@ -90,9 +90,7 @@
 	_JC_VERBOSE_EXCEPTIONS,
 	_JC_VERBOSE_RESOLUTION,
 	_JC_VERBOSE_INIT,
-	_JC_VERBOSE_GEN,
 	_JC_VERBOSE_JNI_INVOKE,
-	_JC_VERBOSE_OBJ,
 	_JC_VERBOSE_MAX
 };
 
@@ -335,68 +333,6 @@
 #define _JC_NATIVE_REF_MARK_IN_USE(frame, i)				\
 	((frame)->flags &= ~(1 << (i + 3)))
 
-/*
- * ELF types (32/64 bit)
- */
-#undef Elf_Addr
-#undef Elf_Ehdr
-#undef Elf_Off
-#undef Elf_Rel
-#undef Elf_Rela
-#undef Elf_Shdr
-#undef Elf_Word
-#undef Elf_Sym
-#undef ELF_R_TYPE
-#undef ELF_R_SYM
-#if _JC_ELF_CLASS == ELFCLASS32
-#define Elf_Addr Elf32_Addr
-#define Elf_Ehdr Elf32_Ehdr
-#define Elf_Off Elf32_Off
-#define Elf_Rel Elf32_Rel
-#define Elf_Rela Elf32_Rela
-#define Elf_Shdr Elf32_Shdr
-#define Elf_Word Elf32_Word
-#define Elf_Sym Elf32_Sym
-#define ELF_R_TYPE(x) ELF32_R_TYPE(x)
-#define ELF_R_SYM(x) ELF32_R_SYM(x)
-#elif _JC_ELF_CLASS == ELFCLASS64
-#define Elf_Addr Elf64_Addr
-#define Elf_Ehdr Elf64_Ehdr
-#define Elf_Off Elf64_Off
-#define Elf_Rel Elf64_Rel
-#define Elf_Rela Elf64_Rela
-#define Elf_Shdr Elf64_Shdr
-#define Elf_Word Elf64_Word
-#define Elf_Sym Elf64_Sym
-#define ELF_R_TYPE(x) ELF64_R_TYPE(x)
-#define ELF_R_SYM(x) ELF64_R_SYM(x)
-#else
-#error "Invalid value for _JC_ELF_CLASS"
-#endif
-
-/*
- * Supported ELF line info debug sections supported.
- */
-enum {
-	_JC_LINE_DEBUG_NONE,
-	_JC_LINE_DEBUG_DWARF1,
-	_JC_LINE_DEBUG_DWARF2,
-	_JC_LINE_DEBUG_STABS,
-};
-
-/* Stabs debugging section entry types */
-#define STAB_FUN		0x24
-#define STAB_SLINE		0x44
-
-/* DWARF 2.0 .debug_line sections definitions (partial list) */
-#define DW_LNE_end_sequence	1
-#define DW_LNE_set_address	2
-#define DW_LNS_copy		1
-#define DW_LNS_advance_pc	2
-#define DW_LNS_advance_line	3
-#define DW_LNS_const_add_pc	8
-#define DW_LNS_fixed_advance_pc	9
-
 /* Size of one page */
 #define _JC_PAGE_SIZE			(1 << _JC_PAGE_SHIFT)
 
@@ -408,6 +344,10 @@
 #define _JC_PAGE_INDEX(heap, ptr)					\
 	(((char *)(ptr) - (char *)(heap)->pages) / _JC_PAGE_SIZE)
 
+/* How to compute the instanceof hash table hash bucket */
+#define _JC_INSTANCEOF_HASH(t)						\
+	((int)(((_jc_word)(t)) / 30031) & (_JC_INSTANCEOF_HASHSIZE - 1))
+
 /*
  * Heap page info layout
  * ---------------------
@@ -503,9 +443,6 @@
 #endif	/* HAVE_INTTYPES_H */
 
 #define _JC_LIBRARY_PATH	_JC_CLASSPATH_HOME "/lib/classpath"
-#define _JC_INCLUDE_DIR		_AC_INCLUDEDIR "/jc"
-#define _JC_BOOT_SOURCE_DIR	_AC_DATADIR "/jc/src"
-#define _JC_BOOT_OBJECT_DIR	_AC_LIBDIR "/jc/obj"
 
 #define _JC_BOOT_CLASS_PATH						\
     _AC_DATADIR "/jc/jc.zip"						\
@@ -519,11 +456,6 @@
 	    || strncmp((name), "gnu/java/", 9) == 0)
 
 /*
- * Package object file name
- */
-#define _JC_PACKAGE_OBJECT_NAME		"_package.o"
-
-/*
  * Class path entry types.
  */
 #define _JC_CPATH_UNKNOWN		0
@@ -532,20 +464,6 @@
 #define _JC_CPATH_ERROR			3
 
 /*
- * Object path entry types.
- */
-#define _JC_OBJPATH_UNKNOWN		0
-#define _JC_OBJPATH_DIRECTORY		1
-#define _JC_OBJPATH_ELFFILE		2
-#define _JC_OBJPATH_ERROR		3
-
-/*
- * Macro to check if a PC value lies within a method.
- */
-#define _JC_INMETHOD(meth, pc)						\
-	((pc) > (meth)->function && (pc) <= (meth)->function_end)
-
-/*
  * Array bounds check for offset + length. Returns true if bounds are OK.
  *
  * We have to be careful because of potential 32-bit overflow.
@@ -687,9 +605,6 @@
 									\
 	_JC_ASSERT(_env == NULL || (mutex ## _owner) != _env);		\
 	_r = pthread_mutex_lock(_mutex);				\
-	/* TODO: remove the following two lines... */ \
-	if(_r==EINVAL) fprintf(stdout, "EINVAL\n"); \
-	else if(_r==EDEADLK) fprintf(stdout, "EDEADLK\n"); \
 	_JC_ASSERT(_r == 0);						\
 	(mutex ## _owner) = _env;					\
     } while (0)

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/derive.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/derive.c?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/derive.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/derive.c Sat Dec 10 19:40:08 2005
@@ -50,10 +50,7 @@
 {
 	_jc_jvm *const vm = env->vm;
 	jboolean deriving_node = JNI_FALSE;
-	_jc_type *const key = (_jc_type *)((char *)&name
-	    - _JC_OFFSETOF(_jc_type, name));
 	_jc_super_info *supers = NULL;
-	_jc_class_node *cnode = NULL;
 	_jc_classfile *cfile;
 	_jc_type_node node;
 	_jc_type *type = NULL;
@@ -86,20 +83,6 @@
 		goto fail;
 	}
 
-	/* Lock VM */
-	_JC_MUTEX_LOCK(env, vm->mutex);
-
-	/* Add class file to VM class file tree */
-	if ((cnode = _jc_ref_class_node(env,
-	    name, cbytes->hash, cbytes)) == NULL) {
-		_JC_MUTEX_UNLOCK(env, vm->mutex);
-		_jc_post_exception_info(env);
-		return NULL;
-	}
-
-	/* Unlock VM */
-	_JC_MUTEX_UNLOCK(env, vm->mutex);
-
 	/* Create a temporary fake type node for the deriving types tree */
 	memset(&node, 0, sizeof(node));
 	node.type = (_jc_type *)((char *)&name - _JC_OFFSETOF(_jc_type, name));
@@ -134,13 +117,10 @@
 	_JC_MUTEX_UNLOCK(env, loader->mutex);
 
 	/* Allocate structure for temporarily saving super types */
-	if (!vm->loader_enabled || !vm->generation_enabled) {
-		if ((supers = _jc_vm_alloc(env,
-		    sizeof(*supers) + cfile->num_interfaces
-		      * sizeof(*supers->interfaces))) == NULL) {
-			_jc_post_exception_info(env);
-			goto fail;
-		}
+	if ((supers = _jc_vm_alloc(env, sizeof(*supers)
+	    + cfile->num_interfaces * sizeof(*supers->interfaces))) == NULL) {
+		_jc_post_exception_info(env);
+		goto fail;
 	}
 
 	/* Skip loading superclass for java.lang.Object */
@@ -182,67 +162,7 @@
 			supers->interfaces[i] = siface;
 	}
 
-	/* Loading supertypes may have loaded ELF object with type as well */
-	_JC_MUTEX_LOCK(env, loader->mutex);
-	type = _jc_splay_find(&loader->defined_types, key);
-	_JC_MUTEX_UNLOCK(env, loader->mutex);
-	if (type != NULL)
-		goto done;
-
-	/* If the ELF loader is disabled, we must interpret */
-	if (!vm->loader_enabled)
-		goto create_type;
-
-	/* Try to load an ELF object containing the type */
-	if (_jc_load_object(env, loader, name) == JNI_OK)
-		goto find_type;
-
-	/* If something unexpected happened, bail out */
-	if (env->ex.num != _JC_LinkageError) {
-		_jc_post_exception_info(env);
-		goto fail;
-	}
-
-	/* If on-demand object generation is disabled, interpret */
-	if (!vm->generation_enabled)
-		goto create_type;
-
-	/* Generate a new ELF object file for this class */
-	if (_jc_generate_object(env, loader, name) != JNI_OK)
-		goto fail;
-
-	/* Try again to load object file containing the type */
-	if (_jc_load_object(env, loader, name) != JNI_OK) {
-		_jc_post_exception_info(env);
-		goto fail;
-	}
-
-find_type:
-	/*
-	 * We've done our best to load the right ELF object.
-	 * Look in the types tree to see if our type is there.
-	 */
-	_JC_MUTEX_LOCK(env, loader->mutex);
-	type = _jc_splay_find(&loader->defined_types, key);
-	_JC_MUTEX_UNLOCK(env, loader->mutex);
-	if (type == NULL) {
-		_jc_post_exception_msg(env, _JC_LinkageError,
-		    "no ELF object found containing `%s'", name);
-		goto fail;
-	}
-
-	/* Save super types (so we can access them before resolution) */
-	type->u.nonarray.supers = supers;
-	supers = NULL;
-
-	/* Done */
-	goto done;
-
-create_type:
-	/*
-	 * We are unable or unwilling to find or create an ELF object.
-	 * We must interpret this Java class.
-	 */
+	/* Derive type */
 	if ((type = _jc_derive_type_interp(env, loader, cbytes)) == NULL) {
 		_jc_post_exception_info(env);
 		goto fail;
@@ -260,27 +180,8 @@
 		_JC_MUTEX_UNLOCK(env, loader->mutex);
 	}
 
-	/* Unreference class file in VM class file tree */
-	_JC_MUTEX_LOCK(env, vm->mutex);
-	_jc_unref_class_node(vm, &cnode);
-	_JC_MUTEX_UNLOCK(env, vm->mutex);
-
 	/* Destroy parsed class file */
 	_jc_destroy_classfile(&cfile);
-
-	/* If this thread wants to save class file, save it */
-	if (type == NULL) {
-		_jc_class_save *csave;
-
-		for (csave = env->class_save;
-		    csave != NULL; csave = csave->next) {
-			if (strcmp(csave->name, name) == 0) {
-				_JC_ASSERT(csave->bytes == NULL);
-				csave->bytes = _jc_dup_classbytes(cbytes);
-				break;
-			}
-		}
-	}
 
 	/* Free leftover supers info (if any) */
 	_jc_vm_free(&supers);

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/derive2.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/derive2.c?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/derive2.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/derive2.c Sat Dec 10 19:40:08 2005
@@ -15,7 +15,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: derive2.c,v 1.4 2005/05/08 21:12:07 archiecobbs Exp $
+ * $Id$
  */
 
 #include "libjc.h"
@@ -42,7 +42,6 @@
 	_jc_class_loader *loader, _jc_classbytes *cbytes)
 {
 	_jc_jvm *const vm = env->vm;
-	_jc_class_node *cnode = NULL;
 	int num_class_vmethods;
 	int num_super_vmethods;
 	int num_vmethods;
@@ -129,11 +128,10 @@
 	ntype = &type->u.nonarray;
 	ntype->num_vmethods = num_vmethods;
 	type->superclass = superclass;
-	type->access_flags = cfile->access_flags | _JC_ACC_INTERP;
+	type->access_flags = cfile->access_flags;
 	type->flags = _JC_TYPE_REFERENCE | _JC_TYPE_LOADED;
 	type->loader = loader;
-	ntype->u.cfile = cfile;
-	ntype->hash = cbytes->hash;
+	ntype->cfile = cfile;
 
 	/* Allocate memory for mtable */
 	if (num_vmethods > 0
@@ -268,18 +266,6 @@
 	_JC_ASSERT(vtable_index == num_vmethods);
 
 skip_vtable:
-	/*
-	 * Find/create this class' class file node and add a reference to it.
-	 * This also acts as an implicit dependency on the class file.
-	 */
-	_JC_MUTEX_LOCK(env, vm->mutex);
-	if ((cnode = _jc_ref_class_node(env, type->name, ntype->hash,
-	    loader != vm->boot.loader ? cbytes : NULL)) == NULL) {
-		_JC_MUTEX_UNLOCK(env, vm->mutex);
-		goto fail;
-	}
-	_JC_MUTEX_UNLOCK(env, vm->mutex);
-
 	/* Allocate and initialize type node */
 	if ((node = _jc_cl_zalloc(env, loader, sizeof(*node))) == NULL)
 		goto fail;
@@ -302,13 +288,6 @@
 	/* Give back class loader memory */
 	_jc_uni_reset(&loader->uni, mark);
 
-	/* Release class file reference */
-	if (cnode != NULL) {
-		_JC_MUTEX_LOCK(env, vm->mutex);
-		_jc_unref_class_node(vm, &cnode);
-		_JC_MUTEX_UNLOCK(env, vm->mutex);
-	}
-
 	/* Free parsed class file */
 	_jc_destroy_classfile(&cfile);
 
@@ -324,11 +303,10 @@
 _jc_derive_fields(_jc_env *env, _jc_type *type)
 {
 	_jc_nonarray_type *const ntype = &type->u.nonarray;
-	_jc_classfile *const cfile = ntype->u.cfile;
+	_jc_classfile *const cfile = ntype->cfile;
 	int i;
 
 	/* Sanity check */
-	_JC_ASSERT(_JC_ACC_TEST(type, INTERP));
 	_JC_MUTEX_ASSERT(env, type->loader->mutex);
 
 	/* Allocate fields array */
@@ -360,7 +338,7 @@
 		field->signature = field->name + nlen;
 		memcpy((char *)field->signature, cfield->descriptor, slen);
 		field->class = type;
-		field->access_flags = cfield->access_flags | _JC_ACC_INTERP;
+		field->access_flags = cfield->access_flags;
 	}
 
 	/* Done */
@@ -374,11 +352,10 @@
 _jc_derive_methods(_jc_env *env, _jc_type *type)
 {
 	_jc_nonarray_type *const ntype = &type->u.nonarray;
-	_jc_classfile *const cfile = ntype->u.cfile;
+	_jc_classfile *const cfile = ntype->cfile;
 	int i;
 
 	/* Sanity check */
-	_JC_ASSERT(_JC_ACC_TEST(type, INTERP));
 	_JC_MUTEX_ASSERT(env, type->loader->mutex);
 
 	/* Allocate methods array */
@@ -413,7 +390,7 @@
 		method->signature = method->name + nlen;
 		memcpy((char *)method->signature, cmethod->descriptor, slen);
 		method->class = type;
-		method->access_flags = cmethod->access_flags | _JC_ACC_INTERP;
+		method->access_flags = cmethod->access_flags;
 
 		/* Parse signature and count number of parameters */
 		if ((nparam = _jc_resolve_signature(env, method, NULL)) == -1)

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/exception.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/exception.c?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/exception.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/exception.c Sat Dec 10 19:40:08 2005
@@ -15,7 +15,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: exception.c,v 1.15 2005/03/16 15:31:12 archiecobbs Exp $
+ * $Id$
  */
 
 #include "libjc.h"
@@ -277,9 +277,6 @@
 _jc_throw_exception(_jc_env *env)
 {
 	_jc_jvm *const vm = env->vm;
-	_jc_stack_crawl crawl;
-	_jc_catch_frame *catch;
-	int target_index = 1;
 
 	/* Sanity check */
 	_JC_ASSERT(env->status == _JC_THRDSTAT_RUNNING_NORMAL
@@ -299,121 +296,8 @@
 		_jc_printf(vm, "]\n");
 	}
 
-	/* Lock VM */
-	_JC_MUTEX_LOCK(env, vm->mutex);
-
-	/*
-	 * Crawl up the stack, searching for a method that:
-	 *
-	 *   (a) Matches the current catch frame (i.e., same method); and
-	 *   (b) Has a matching trap table entry for the exception
-	 *
-	 * If we find a method that satisfies (a) but not (b) then
-	 * the current catch frame is discarded, as it corresponds to
-	 * a frame that might have caught the exception but didn't.
-	 * The corresponding method must be (indirectly) recursive.
-	 */
-	catch = env->head.catch_list;
-	for (_jc_stack_crawl_first(env, &crawl);
-	    JNI_TRUE; _jc_stack_crawl_next(vm, &crawl)) {
-		_jc_method *const method = crawl.method;
-		int i;
-
-		/* We should never run out of stack or catch frames */
-		_JC_ASSERT(method != NULL);
-		_JC_ASSERT(catch != NULL);
-		_JC_ASSERT(!_JC_ACC_TEST(method, INTERP));
-
-		/* Does this frame's method correspond to the catch frame? */
-		if (method != catch->method)
-			continue;
-
-		/*
-		 * If the method doesn't have a trap table, it must be
-		 * _jc_invoke_jcni_a(), which catches all exceptions.
-		 */
-		if (method->u.exec.trap_table_len == 0) {
-			_JC_ASSERT(method == &vm->invoke_method);
-			if ((env->vm->verbose_flags
-			    & (1 << _JC_VERBOSE_EXCEPTIONS)) != 0) {
-				_jc_printf(vm, "[verbose %s: caught via %s()"
-				    " in thread %p: ",
-				    _jc_verbose_names[_JC_VERBOSE_EXCEPTIONS],
-				    method->name, env);
-				_jc_fprint_exception_headline(env,
-				    stdout, env->head.caught);
-				_jc_printf(vm, "]\n");
-			}
-			break;
-		}
-		_JC_ASSERT(method->class != NULL);
-
-		/* If not within any trap region, skip the trap scan */
-		if (catch->region == 0)
-			goto not_caught;
-
-		/* Search trap table for a matching range and exception */
-		for (i = 0; i < method->u.exec.trap_table_len; i++) {
-			_jc_trap_info *const trap
-			    = &method->u.exec.trap_table[i];
-
-			/* Sanity check */
-			_JC_ASSERT(trap->start > 0 && trap->end > trap->start);
-
-			/* Did the exception happen within the trap region? */
-			if (catch->region < trap->start
-			    || catch->region >= trap->end)
-				continue;
-
-			/* Does the exception type match what's caught? */
-			if (trap->type != NULL
-			    && !_jc_subclass_of(env->head.caught, trap->type))
-				continue;
-
-			/* Derive trap target index from trap table index */
-			target_index = i + 1;
-
-			/* Verbosity */
-			if ((env->vm->verbose_flags
-			    & (1 << _JC_VERBOSE_EXCEPTIONS)) != 0) {
-				_jc_printf(vm, "[verbose %s: caught via trap"
-				    " %d (%d-%d) in %s.%s%s in thread %p: ",
-				    _jc_verbose_names[_JC_VERBOSE_EXCEPTIONS],
-				    target_index - 1, trap->start, trap->end,
-				    method->class->name, method->name,
-				    method->signature, env);
-				_jc_fprint_exception_headline(env,
-				    stdout, env->head.caught);
-				_jc_printf(vm, "]\n");
-			}
-
-			/* Unwind the stack */
-			goto found;
-		}
-
-not_caught:
-		/* Exception not caught; discard the current catch frame */
-		catch = catch->next;
-	}
-
-found:
-	/* Unlock VM */
-	_JC_MUTEX_UNLOCK(env, vm->mutex);
-
-	/* Unlink all catch frames added after the target catch frame */
-	env->head.catch_list = catch;
-
-	/* Reset the top Java stack frame */
-	env->java_stack = crawl.stack;
-	_JC_ASSERT(env->java_stack == NULL || !env->java_stack->interp);
-	((_jc_exec_stack *)env->java_stack)->pc = NULL;
-#ifndef NDEBUG
-	_jc_stack_frame_init(&((_jc_exec_stack *)env->java_stack)->frame);
-#endif
-
-	/* Jump back to the catching method, supplying the target trap index */
-	_JC_ASSERT(target_index > 0);
-	siglongjmp(catch->context, target_index);
+	/* Jump back to most recent invocation of _jc_invoke_jcni_a() */
+	siglongjmp(env->head.catch_list->context, 1);
 }
 
 /*

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/gc_root.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/gc_root.c?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/gc_root.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/gc_root.c Sat Dec 10 19:40:08 2005
@@ -20,6 +20,10 @@
 
 #include "libjc.h"
 
+/* Internal definitions */
+#define _JC_NUM_REGISTER_OFFS						\
+	(sizeof(_jc_register_offs) / sizeof(*_jc_register_offs))
+
 /* Internal functions */
 static _jc_object	*_jc_locate_object(_jc_jvm *vm,
 				const _jc_word *info, const void *ptr);
@@ -27,10 +31,15 @@
 				const _jc_word *info, _jc_object ***refsp);
 static int		_jc_root_walk_native_refs(_jc_native_frame_list *list,
 				_jc_object ***refsp);
+static int		_jc_scan_exec_stack(_jc_jvm *vm, _jc_exec_stack *stack,
+				const _jc_word *info, _jc_object ***refsp);
 static int		_jc_scan_interp_stack(_jc_jvm *vm,
 				_jc_interp_stack *stack, const _jc_word *info,
 				_jc_object ***refsp);
 
+/* Internal variables */
+static const int	_jc_register_offs[] = _JC_REGISTER_OFFS;
+
 /*
  * Find the head of the object given a pointer into its interior.
  * This is used for conservative GC scan.
@@ -233,25 +242,22 @@
 	/* Sanity check */
 	_JC_ASSERT(thread->java_stack == NULL
 	    || thread->java_stack->interp
-	    || ((_jc_exec_stack *)thread->java_stack)->pc != NULL);
+	    || thread->java_stack->clipped);
 
 	/* Scan each contiguous Java stack segment */
 	for (jstack = thread->java_stack;
 	    jstack != NULL; jstack = jstack->next) {
-		count += _jc_scan_interp_stack(vm,
-		      (_jc_interp_stack *)jstack, info, &refs);
+		count += jstack->interp ?
+		    _jc_scan_interp_stack(vm,
+		      (_jc_interp_stack *)jstack, info, &refs) :
+		    _jc_scan_exec_stack(vm,
+		      (_jc_exec_stack *)jstack, info, &refs);
 	}
 
 	/* Get implicit references from Java methods to their classes */
 	for (_jc_stack_crawl_first(thread, &crawl);
 	    crawl.method != NULL; _jc_stack_crawl_next(vm, &crawl)) {
 
-		/* Skip _jc_invoke_jcni_a() */
-		if (crawl.method->class == NULL) {
-			_JC_ASSERT(crawl.method == &vm->invoke_method);
-			continue;
-		}
-
 		/* Add the Class instance */
 		_JC_ASSERT(crawl.method->class->instance != NULL);
 		if (refs != NULL)
@@ -295,16 +301,13 @@
 _jc_scan_interp_stack(_jc_jvm *vm, _jc_interp_stack *stack,
 	const _jc_word *info, _jc_object ***refsp)
 {
-	_jc_method *const method = stack->method;
-	_jc_method_code *const code = &method->u.code;
+	_jc_method *const method = stack->jstack.method;
+	_jc_method_code *const code = &method->code;
 	_jc_object **refs = *refsp;
 	_jc_object *obj;
 	int count = 0;
 	int i;
 
-	/* Sanity check */
-	_JC_ASSERT(_JC_ACC_TEST(method, INTERP));
-
 	/* Any state in this method yet? */
 	if (stack->locals == NULL)
 		return 0;
@@ -315,6 +318,71 @@
 
 		/* Find object pointed to, if any */
 		if ((obj = _jc_locate_object(vm, info, ref)) == NULL)
+			continue;
+
+		/* Add object to list */
+		if (refs != NULL)
+			*refs++ = obj;
+		count++;
+	}
+
+	/* Done */
+	*refsp = refs;
+	return count;
+}
+
+/*
+ * Scan a contiguous executable stack chunk.
+ */
+static int
+_jc_scan_exec_stack(_jc_jvm *vm, _jc_exec_stack *stack,
+	const _jc_word *info, _jc_object ***refsp)
+{
+	const size_t stack_step = (_JC_STACK_ALIGN < sizeof(void *)) ?
+	    _JC_STACK_ALIGN : sizeof(void *);
+	_jc_object **refs = *refsp;
+	const char *stack_bot = NULL;
+	const char *stack_top = NULL;
+	_jc_object *obj;
+	const char *ptr;
+	int count = 0;
+	int regnum;
+
+	/* Get references from saved registers */
+	for (regnum = 0; regnum < _JC_NUM_REGISTER_OFFS; regnum++) {
+
+		/* Find object pointed to by register, if any */
+		if ((obj = _jc_locate_object(vm, info,
+		    *(_jc_word **)((char *)&stack->regs
+		      + _jc_register_offs[regnum]))) == NULL)
+			continue;
+
+		/* Add object to list */
+		if (refs != NULL)
+			*refs++ = obj;
+		count++;
+	}
+
+	/* Compute the top of this Java stack segment */
+	stack_top = _jc_mcontext_sp(&stack->regs);
+
+	/* Find the bottom of this Java stack segment */
+	stack_bot = stack->start_sp;
+
+	/* Sanity check stack alignment */
+	_JC_ASSERT(((_jc_word)stack_top & (_JC_STACK_ALIGN - 1)) == 0);
+	_JC_ASSERT(((_jc_word)stack_bot & (_JC_STACK_ALIGN - 1)) == 0);
+
+	/* Conservatively find references in this Java stack segment */
+#if _JC_DOWNWARD_STACK
+	for (ptr = stack_top; ptr < stack_bot; ptr += stack_step)
+#else
+	for (ptr = stack_bot; ptr < stack_top; ptr += stack_step)
+#endif
+	{
+		/* Find object pointed into, if any */
+		if ((obj = _jc_locate_object(vm,
+		    info, *(_jc_word **)ptr)) == NULL)
 			continue;
 
 		/* Add object to list */

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/initialize.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/initialize.c?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/initialize.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/initialize.c Sat Dec 10 19:40:08 2005
@@ -15,7 +15,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: initialize.c,v 1.7 2005/03/12 04:24:17 archiecobbs Exp $
+ * $Id$
  */
 
 #include "libjc.h"
@@ -267,23 +267,14 @@
 		    {
 			const u_char *const b = field->initial_value;
 
-			if (_JC_ACC_TEST(type, INTERP)) {
-				memcpy(value, b, sizeof(jfloat));
-				break;
-			}
-			*((jfloat *)value) = _JC_FCONST(b[0], b[1], b[2], b[3]);
+			memcpy(value, b, sizeof(jfloat));
 			break;
 		    }
 		case _JC_TYPE_DOUBLE:
 		    {
 			const u_char *const b = field->initial_value;
 
-			if (_JC_ACC_TEST(type, INTERP)) {
-				memcpy(value, b, sizeof(jdouble));
-				break;
-			}
-			*((jdouble *)value) = _JC_DCONST(b[0],
-			    b[1], b[2], b[3], b[4], b[5], b[6], b[7]);
+			memcpy(value, b, sizeof(jdouble));
 			break;
 		    }
 		case _JC_TYPE_REFERENCE:

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/instance.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/instance.c?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/instance.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/instance.c Sat Dec 10 19:40:08 2005
@@ -15,7 +15,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: instance.c,v 1.4 2005/03/12 04:24:17 archiecobbs Exp $
+ * $Id$
  */
 
 #include "libjc.h"
@@ -82,7 +82,7 @@
 
 	/* Search instanceof hash table */
 	if ((entry = from->u.nonarray.instanceof_hash_table[
-	    (int)to->u.nonarray.hash & (_JC_INSTANCEOF_HASHSIZE - 1)]) == NULL)
+	    _JC_INSTANCEOF_HASH(to)]) == NULL)
 		return 0;
 	while (*entry != NULL) {
 		if (*entry++ == to)

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/interp.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/interp.c?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/interp.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/interp.c Sat Dec 10 19:40:08 2005
@@ -15,7 +15,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: interp.c,v 1.7 2005/07/10 21:03:54 archiecobbs Exp $
+ * $Id$
  */
 
 #include "libjc.h"
@@ -259,7 +259,7 @@
 		ACTION(swap),
 		ACTION(tableswitch),
 	};
-	_jc_method_code *const code = &method->u.code;
+	_jc_method_code *const code = &method->code;
 	int ticker = PERIODIC_CHECK_TICKS;
 	_jc_interp_stack state;
 	_jc_object *lock = NULL;
@@ -290,14 +290,13 @@
 	_JC_ASSERT(!_JC_ACC_TEST(method->class, INTERFACE)
 	    || strcmp(method->name, "<clinit>") == 0);
 	_JC_ASSERT(_JC_FLG_TEST(method->class, RESOLVED));
-	_JC_ASSERT(_JC_ACC_TEST(method, INTERP));
 	_JC_ASSERT(!_JC_ACC_TEST(method, NATIVE));
 
 	/* Push Java stack frame */
 	memset(&state, 0, sizeof(state));
 	state.jstack.interp = JNI_TRUE;
 	state.jstack.next = env->java_stack;
-	state.method = method;
+	state.jstack.method = method;
 	state.pcp = &pc;
 	env->java_stack = &state.jstack;
 
@@ -1051,12 +1050,8 @@
 	/* Invoke the method */
 	if (_JC_ACC_TEST(imethod, NATIVE))
 		status = _jc_invoke_native_method(env, imethod, JNI_TRUE, sp);
-	else if (_JC_ACC_TEST(imethod, INTERP))
+	else
 		status = _jc_interp(env, imethod, obj, params);
-	else {
-		status = _jc_invoke_jcni_a(env,
-		    imethod, imethod->function, obj, params);
-	}
 
 	/* Did method throw an exception? */
 	if (status != JNI_OK)
@@ -1612,12 +1607,11 @@
 int
 _jc_interp_pc_to_jline(_jc_method *method, int index)
 {
-	_jc_method_code *const code = &method->u.code;
+	_jc_method_code *const code = &method->code;
 	_jc_linemap *base;
 	int span;
 
 	/* Sanity check */
-	_JC_ASSERT(_JC_ACC_TEST(method, INTERP));
 	_JC_ASSERT(_JC_FLG_TEST(method->class, RESOLVED));
 	_JC_ASSERT(index >= 0 && index < code->num_insns);
 
@@ -1692,13 +1686,11 @@
 	int i;
 
 	/* Sanity check */
-	_JC_ASSERT(_JC_ACC_TEST(method, INTERP));
 	_JC_ASSERT(!_JC_ACC_TEST(method, NATIVE));
 	_JC_ASSERT(_JC_FLG_TEST(method->class, RESOLVED));
 
 	/* Allocate space for parameter array */
-	if ((params = _JC_STACK_ALLOC(env,
-	    method->u.code.num_params2)) == NULL) {
+	if ((params = _JC_STACK_ALLOC(env, method->code.num_params2)) == NULL) {
 		_jc_post_exception_info(env);
 		_jc_throw_exception(env);
 	}
@@ -1757,7 +1749,7 @@
 			break;
 		}
 	}
-	_JC_ASSERT(pnum == method->u.code.num_params2);
+	_JC_ASSERT(pnum == method->code.num_params2);
 
 	/* Clip the current top of the Java stack */
 	clipped_stack = !env->java_stack->interp && _jc_stack_clip(env);
@@ -1783,7 +1775,6 @@
 	_jc_method *const method = env->interp;
 
 	/* Sanity check */
-	_JC_ASSERT(_JC_ACC_TEST(method, INTERP));
 	_JC_ASSERT(_JC_ACC_TEST(method, NATIVE));
 	_JC_ASSERT(_JC_FLG_TEST(method->class, RESOLVED));
 

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/invoke.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/invoke.c?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/invoke.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/invoke.c Sat Dec 10 19:40:08 2005
@@ -15,7 +15,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: invoke.c,v 1.17 2005/07/10 21:03:54 archiecobbs Exp $
+ * $Id$
  */
 
 #include "libjc.h"
@@ -841,16 +841,6 @@
  * parameter as JCNI does not pass the Class object to static methods.
  */
 
-/*
- * Method descriptor for _jc_invoke_jcni_a(), so that it can be found
- * in a stack trace like compiled Java methods. Note the "function" and
- * "function_end" values are computed at runtime in _jc_create_vm().
- */
-const _jc_method _jc_invoke_jcni_a$method_info = {
-	.name=			"_jc_invoke_jcni_a",
-	.signature=		"()V",
-};
-
 jint
 _jc_invoke_jcni_a(_jc_env *env, _jc_method *method,
 	const void *func, _jc_object *volatile obj, _jc_word *volatile params)
@@ -870,8 +860,11 @@
 	int nparams2;
 	int i;
 
-	/* Define exception traps */
-	_JC_DEFINE_TRAPS(env, catch, &vm->invoke_method, &&exception);
+	/* Catch exceptions here */
+	catch.next = env->head.catch_list;
+	env->head.catch_list = &catch;
+	if (sigsetjmp(catch.context, 0) != 0)
+		goto exception;
 
 	/* Sanity check */
 	_JC_ASSERT(env->status == _JC_THRDSTAT_RUNNING_NORMAL
@@ -951,14 +944,12 @@
 		got_monitor = JNI_TRUE;
 	}
 
-	/* Start a new contiguous Java stack frame sequence */
+	/* Start a new contiguous executable Java stack frame sequence */
 	memset(&java_stack, 0, sizeof(java_stack));
 	java_stack.jstack.interp = JNI_FALSE;
 	java_stack.jstack.next = env->java_stack;
-	java_stack.pc = NULL;
-#ifndef NDEBUG
-	_jc_stack_frame_init(&java_stack.frame);
-#endif
+	java_stack.jstack.method = method;
+	java_stack.start_sp = &java_stack;
 	env->java_stack = &java_stack.jstack;
 	pushed_java_stack = JNI_TRUE;
 
@@ -1005,8 +996,8 @@
 	if (status != JNI_OK)
 		memset(&env->retval, 0, sizeof(env->retval));
 
-	/* Unlink catch frame */
-	_JC_CANCEL_TRAPS(env, catch);
+	/* Unlink exception catcher */
+	env->head.catch_list = catch.next;
 
 	/* Done */
 	return status;

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/jc_invoke.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/jc_invoke.c?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/jc_invoke.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/jc_invoke.c Sat Dec 10 19:40:08 2005
@@ -15,7 +15,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: jc_invoke.c,v 1.8 2005/05/19 22:52:28 archiecobbs Exp $
+ * $Id$
  */
 
 #include <stdio.h>
@@ -51,7 +51,6 @@
 	OPT_PROPERTY,
 	OPT_VERBOSE,
 	OPT_VERSION,
-	OPT_LOADLIST,
 	OPT_COMPATOPTS,
 };
 
@@ -69,10 +68,8 @@
 	"gc",
 	"Xexceptions",
 	"Xresolution",
-	"Xgen",
 	"Xjni-invoke",
 	"Xinit",
-	"Xobj",
 	NULL
 };
 
@@ -100,14 +97,10 @@
 		", gc=Garbage collection"
 		", exceptions=Exceptions"
 		", resolution=Class resolution"
-		", gen=ELF object generation"
 		", jni-invoke=Native method calls"
 		", init=Class initialization"
-		", obj=ELF object loading"
 		".",
 		"opt1,opt2,..." },
-    {	"loadlist",		'L', POPT_ARG_STRING, NULL, OPT_LOADLIST,
-	"Record loaded ELF objects in file", "filename" },
     {	"jar",			'j', POPT_ARG_NONE, NULL, OPT_JAR,
 	"Execute main class of JAR file", NULL },
     {	"show-options",		'X', POPT_ARG_NONE,   NULL, OPT_COMPATOPTS,
@@ -136,11 +129,6 @@
     {	"-Xms",		NULL,		0,	"jc.heap.initial" },
     {	"-ss",		NULL,		0,	"jc.stack.default" },
     {	"-Xss",		NULL,		0,	"jc.stack.default" },
-    {	"-Xint",	"false",	0,	"jc.object.loader.enabled" },
-    {	"-Xnogen",	"false",	0,	"jc.object.generation.enabled"},
-    {	"-Xnoln",	"false",	0,	"jc.include.line.numbers" },
-    {	"-Xobj",	"true",		0,	"jc.without.classfiles" },
-    {	"-Xrnd",	"true",		0,	"jc.resolve.native.directly" },
     {	NULL,		NULL,		0,	NULL }
 };
 
@@ -395,20 +383,6 @@
 			    printer, value)) == JNI_EVERSION)
 				goto usage;
 			if (status != JNI_OK)
-				goto done;
-			break;
-		    }
-		case OPT_LOADLIST:
-		    {
-			FILE *loadlist;
-
-			if ((loadlist = fopen(value, "w")) == NULL) {
-				jc_print(printer, stderr, "%s: %s\n",
-				    value, strerror(errno));
-				goto done;
-			}
-			if (jc_add_vm_arg(&vm_args, printer,
-			    "-Xloadlist", loadlist) != JNI_OK)
 				goto done;
 			break;
 		    }

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/libjc.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/libjc.h?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/libjc.h (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/libjc.h Sat Dec 10 19:40:08 2005
@@ -81,19 +81,8 @@
 extern jint		_jc_read_classbytes_zip(_jc_env *env,
 				_jc_cpath_entry *ent, const char *name,
 				_jc_classbytes **bytesp);
-extern _jc_classbytes	*_jc_dup_classbytes(_jc_classbytes *bytes);
 extern void		_jc_free_classbytes(_jc_classbytes **bytesp);
 
-/* class_file.c */
-extern _jc_class_node	*_jc_get_class_node(_jc_env *env,
-				_jc_class_loader *loader, const char *name);
-extern _jc_class_node	*_jc_ref_class_node(_jc_env *env, const char *name,
-				jlong hash, _jc_classbytes *cbytes);
-extern void		_jc_unref_class_node(_jc_jvm *vm,
-				_jc_class_node **nodep);
-extern void		_jc_unref_class_deps(_jc_jvm *vm,
-				_jc_class_depend *deps, int num_deps);
-
 /* class_loader.c */
 extern _jc_class_loader	*_jc_get_loader(_jc_env *env, _jc_object *cl);
 extern _jc_class_loader	*_jc_get_jni_loader(_jc_env *env);
@@ -104,12 +93,6 @@
 extern jint		_jc_merge_implicit_refs(_jc_env *env,
 				_jc_resolve_info *info);
 
-/* class_object.c */
-extern jint		_jc_load_object(_jc_env *env, _jc_class_loader *loader,
-				const char *name);
-extern jint		_jc_generate_object(_jc_env *env,
-				_jc_class_loader *loader, const char *name);
-
 /* cl_alloc.c */
 extern void		_jc_uni_alloc_init(_jc_uni_mem *uni, int min_pages,
 				volatile _jc_word *avail_pages);
@@ -134,14 +117,6 @@
 extern char		*_jc_cl_strdup(_jc_env *env, _jc_class_loader *loader,
 				const char *s);
 
-/* debug_line.c */
-extern jint		_jc_debug_line_stabs(_jc_env *env, _jc_elf *elf,
-				_jc_splay_tree *tree);
-extern jint		_jc_debug_line_dwarf2(_jc_env *env, _jc_elf *elf,
-				_jc_splay_tree *tree);
-extern int		_jc_exec_pc_to_jline(_jc_method *method,
-				const void *pc);
-
 /* deps.c */
 extern int		_jc_gen_deplist(_jc_env *env, _jc_classfile *cfile,
 				_jc_class_ref **arrayp);
@@ -289,8 +264,6 @@
 				const void *func, _jc_object *obj,
 				_jc_word *params);
 
-extern const _jc_method	_jc_invoke_jcni_a$method_info;
-
 /* jni_invoke.c */
 extern const		struct JNIInvokeInterface _jc_invoke_interface;
 
@@ -331,16 +304,11 @@
 extern char		**_jc_parse_searchpath(_jc_env *env, const char *path);
 extern jint		_jc_parse_classpath(_jc_env *env, const char *path,
 				_jc_cpath_entry **listp, int *lenp);
-extern int		_jc_parse_objpath(_jc_env *env, const char *path,
-				_jc_objpath_entry **listp);
 extern void		_jc_jni_encode(char **bufp, const char *s);
 extern size_t		_jc_jni_encode_length(const char *s);
 extern int		_jc_field_compare(const void *v1, const void *v2);
 extern int		_jc_method_compare(const void *v1, const void *v2);
 
-extern _jc_splay_cmp_t	_jc_method_node_compare;
-extern _jc_splay_cmp_t	_jc_classfile_tree_compare;
-extern _jc_splay_cmp_t	_jc_method_tree_compare;
 extern _jc_splay_cmp_t	_jc_class_ref_compare;
 extern _jc_splay_cmp_t	_jc_type_cmp;
 extern _jc_splay_cmp_t	_jc_node_cmp;
@@ -493,8 +461,6 @@
 extern void		_jc_stack_crawl_first(_jc_env *env,
 				_jc_stack_crawl *crawl);
 extern void		_jc_stack_crawl_next(_jc_jvm *vm,
-				_jc_stack_crawl *crawl);
-extern void		_jc_stack_crawl_skip(_jc_jvm *vm,
 				_jc_stack_crawl *crawl);
 extern jboolean		_jc_stack_clip(_jc_env *env);
 extern jboolean		_jc_stack_clip_ctx(_jc_env *env, const mcontext_t *ctx);

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/load.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/load.c?rev=355889&r1=355888&r2=355889&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/load.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/load.c Sat Dec 10 19:40:08 2005
@@ -15,7 +15,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: load.c,v 1.8 2005/11/09 18:14:22 archiecobbs Exp $
+ * $Id$
  */
 
 #include "libjc.h"
@@ -145,11 +145,13 @@
 	_jc_jvm *const vm = env->vm;
 	_jc_class_loader *const loader = vm->boot.loader;
 	jboolean loader_locked = JNI_FALSE;
+	_jc_classbytes *cbytes;
 	_jc_type_node loading_node;
 	_jc_type_node node_key;
 	_jc_type_node *node;
 	_jc_type *type_key;
 	_jc_type *type = NULL;
+	int index;
 
 	/* Sanity check */
 	_JC_ASSERT(strchr(name, '.') == NULL);
@@ -209,51 +211,25 @@
 		goto done;
 	}
 
-	/* Handle two cases: with or without class files */
-	if (vm->without_classfiles) {
-
-		/* Try to load object file for this class */
-		if (_jc_load_object(env, loader, name) != JNI_OK) {
+	/* Find the class file bytes in the filesystem */
+	if ((cbytes = _jc_bootcl_find_classbytes(env,
+	    name, &index)) == NULL) {
+		_jc_post_exception_info(env);
+		goto done;
+	}
 
-			/* Convert LinkageError -> NoClassDefFoundError */
-			if (env->ex.num == _JC_LinkageError)
-				env->ex.num = _JC_NoClassDefFoundError;
-
-			/* Post exception */
-			_jc_post_exception_info(env);
-			goto done;
-		}
-
-		/* Lock loader */
-		_JC_MUTEX_LOCK(env, loader->mutex);
-		loader_locked = JNI_TRUE;
-
-		/* Look for loaded type */
-		type = _jc_splay_find(&loader->defined_types, type_key);
-	} else {
-		_jc_classbytes *cbytes;
-		int index;
-
-		/* Find the class file bytes in the filesystem */
-		if ((cbytes = _jc_bootcl_find_classbytes(env,
-		    name, &index)) == NULL) {
-			_jc_post_exception_info(env);
-			goto done;
-		}
-
-		/* Attempt to derive the type from the class file bytes */
-		type = _jc_derive_type_from_classfile(env,
-		    loader, name, cbytes);
-
-		/* Verbosity */
-		if (type != NULL) {
-			VERBOSE(CLASS, vm, "found `%s' classfile in `%s'",
-			    type->name, vm->boot.class_path[index].pathname);
-		}
+	/* Attempt to derive the type from the class file bytes */
+	type = _jc_derive_type_from_classfile(env,
+	    loader, name, cbytes);
 
-		/* Free class file bytes */
-		_jc_free_classbytes(&cbytes);
+	/* Verbosity */
+	if (type != NULL) {
+		VERBOSE(CLASS, vm, "found `%s' classfile in `%s'",
+		    type->name, vm->boot.class_path[index].pathname);
 	}
+
+	/* Free class file bytes */
+	_jc_free_classbytes(&cbytes);
 
 done:
 	/* Lock loader */



Mime
View raw message