harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arc...@apache.org
Subject svn commit: r356400 - in /incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm: include/ libjc/
Date Mon, 12 Dec 2005 22:26:55 GMT
Author: archie
Date: Mon Dec 12 14:26:45 2005
New Revision: 356400

URL: http://svn.apache.org/viewcvs?rev=356400&view=rev
Log:
Remove the _jc_env_head structure: not necessary without the executable case.

Modified:
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/include/jc_defs.h
    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/interp.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/invoke.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/jni_native.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/native_lib.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/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=356400&r1=356399&r2=356400&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 Mon
Dec 12 14:26:45 2005
@@ -108,7 +108,6 @@
 typedef struct _jc_object_array		_jc_object_array;
 typedef union _jc_value			_jc_value;
 typedef struct _jc_catch_frame		_jc_catch_frame;
-typedef struct _jc_env_head		_jc_env_head;
 
 typedef struct _jc_field		_jc_field;
 typedef struct _jc_trap_info		_jc_trap_info;
@@ -395,13 +394,6 @@
 struct _jc_catch_frame {
 	_jc_catch_frame		*next;		/* next deeper catch frame */
 	sigjmp_buf		context;	/* how to catch the exception */
-};
-
-/* Thread information made visible to generated code */
-struct _jc_env_head {
-	_jc_catch_frame		*catch_list;	/* exception traps */
-	_jc_object		*pending;	/* posted exception */
-	_jc_object		*caught;	/* caught exception */
 };
 
 /************************************************************************

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=356400&r1=356399&r2=356400&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 Mon
Dec 12 14:26:45 2005
@@ -124,7 +124,7 @@
 
 	/* Sanity check */
 	_JC_ASSERT(env != NULL);
-	_JC_ASSERT(env->head.pending == NULL);
+	_JC_ASSERT(env->pending == NULL);
 	_JC_ASSERT(num >= 0 && num < _JC_VMEXCEPTION_MAX);
 	_JC_ASSERT(vm->initialization == NULL
 	    || vm->initialization->may_execute);
@@ -188,7 +188,7 @@
 
 post_it:
 	/* Post the exception to this thread */
-	env->head.pending = e;
+	env->pending = e;
 
 done:
 	/* Clean up */
@@ -217,8 +217,8 @@
 	}
 
 	/* Post the exception to this thread */
-	_JC_ASSERT(env->head.pending == NULL);
-	env->head.pending = exception;
+	_JC_ASSERT(env->pending == NULL);
+	env->pending = exception;
 }
 
 /*
@@ -283,21 +283,21 @@
 	    || env->status == _JC_THRDSTAT_HALTING_NORMAL);
 	_JC_ASSERT(vm->initialization == NULL
 	    || vm->initialization->may_execute);
-	_JC_ASSERT(env->head.pending != NULL);
+	_JC_ASSERT(env->pending != NULL);
 
 	/* Retrieve and un-post the exception */
-	env->head.caught = _jc_retrieve_exception(env, NULL);
+	env->caught = _jc_retrieve_exception(env, NULL);
 
 	/* Verbosity */
 	if ((env->vm->verbose_flags & (1 << _JC_VERBOSE_EXCEPTIONS)) != 0) {
 		_jc_printf(vm, "[verbose %s: throwing in thread %p: ",
 		    _jc_verbose_names[_JC_VERBOSE_EXCEPTIONS], env);
-		_jc_fprint_exception_headline(env, stdout, env->head.caught);
+		_jc_fprint_exception_headline(env, stdout, env->caught);
 		_jc_printf(vm, "]\n");
 	}
 
 	/* Jump back to most recent invocation of _jc_invoke_jcni_a() */
-	siglongjmp(env->head.catch_list->context, 1);
+	siglongjmp(env->catch_list->context, 1);
 }
 
 /*
@@ -310,7 +310,7 @@
 _jc_retrieve_exception(_jc_env *env, _jc_type *type)
 {
 	_jc_jvm *const vm = env->vm;
-	_jc_object *const e = env->head.pending;
+	_jc_object *const e = env->pending;
 
 	/* Sanity check */
 	_JC_ASSERT(env == _jc_get_current_env());
@@ -329,7 +329,7 @@
 	}
 
 	/* Un-post the exception and return it */
-	env->head.pending = NULL;
+	env->pending = NULL;
 	return e;
 }
 

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=356400&r1=356399&r2=356400&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 Mon Dec
12 14:26:45 2005
@@ -276,9 +276,9 @@
 	}
 
 	/* Walk thread's pending exception (if any) */
-	if (thread->head.pending != NULL) {
+	if (thread->pending != NULL) {
 		if (refs != NULL)
-			*refs++ = thread->head.pending;
+			*refs++ = thread->pending;
 		count++;
 	}
 

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=356400&r1=356399&r2=356400&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 Mon
Dec 12 14:26:45 2005
@@ -165,8 +165,8 @@
 
 step10:
 	/* Step 10 */
-	_JC_ASSERT(env->head.pending != NULL);
-	if (!_jc_subclass_of(env->head.pending, vm->boot.types.Error)) {
+	_JC_ASSERT(env->pending != NULL);
+	if (!_jc_subclass_of(env->pending, vm->boot.types.Error)) {
 		_jc_word param;
 		jobject eref;
 

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=356400&r1=356399&r2=356400&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 Mon Dec
12 14:26:45 2005
@@ -1513,7 +1513,7 @@
 	int i;
 
 	/* Sanity check */
-	_JC_ASSERT(env->head.pending != NULL);
+	_JC_ASSERT(env->pending != NULL);
 
 	/* Check this method for a matching trap */
 	for (i = 0; i < code->num_traps; i++) {
@@ -1555,7 +1555,7 @@
 
 exit:
 	/* Sanity check */
-	_JC_ASSERT(status == JNI_OK || env->head.pending != NULL);
+	_JC_ASSERT(status == JNI_OK || env->pending != NULL);
 
 	/* De-synchronize if necessary */
 	if (lock != NULL) {

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=356400&r1=356399&r2=356400&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 Mon Dec
12 14:26:45 2005
@@ -698,7 +698,7 @@
 	env->jni_method = previous_jni_method;
 
 	/* Return an error if an exception was posted */
-	status = (env->head.pending != NULL) ? JNI_ERR : JNI_OK;
+	status = (env->pending != NULL) ? JNI_ERR : JNI_OK;
 
 done:
 	/* Pop local native reference frame */
@@ -830,7 +830,7 @@
  * are posted, not thrown) to the Java world (where exceptions are explicitly
  * thrown by unwinding the stack). Any exceptions thrown by the invoked method
  * cause this function to return JNI_ERR instead of JNI_OK (and the field
- * env->head.pending contains the exception).
+ * env->pending contains the exception).
  *
  * In order to catch exceptions thrown by Java code, we rely on the function
  * _jc_throw_exception() specially recognizing this function on the stack.
@@ -861,8 +861,8 @@
 	int i;
 
 	/* Catch exceptions here */
-	catch.next = env->head.catch_list;
-	env->head.catch_list = &catch;
+	catch.next = env->catch_list;
+	env->catch_list = &catch;
 	if (sigsetjmp(catch.context, 0) != 0)
 		goto exception;
 
@@ -964,8 +964,8 @@
 
 exception:
 	/* Handle any caught exceptions by re-posting them */
-	_jc_post_exception_object(env, env->head.caught);
-	env->head.caught = NULL;
+	_jc_post_exception_object(env, env->caught);
+	env->caught = NULL;
 	status = JNI_ERR;
 
 done:
@@ -997,7 +997,7 @@
 		memset(&env->retval, 0, sizeof(env->retval));
 
 	/* Unlink exception catcher */
-	env->head.catch_list = catch.next;
+	env->catch_list = catch.next;
 
 	/* Done */
 	return status;

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/jni_native.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/jni_native.c?rev=356400&r1=356399&r2=356400&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/jni_native.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/jni_native.c Mon
Dec 12 14:26:45 2005
@@ -15,7 +15,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: jni_native.c,v 1.16 2005/11/09 18:14:22 archiecobbs Exp $
+ * $Id$
  */
 
 #include "libjc.h"
@@ -1240,7 +1240,7 @@
 	_jc_resuming_java(env);
 
 	/* Get result */
-	result = env->head.pending != NULL;
+	result = env->pending != NULL;
 
 	/* Returning to native code */
 	_jc_stopping_java(env, NULL);
@@ -1662,7 +1662,7 @@
 	_jc_resuming_java(env);
 
 	/* Get pending exception, if any */
-	ref = _jc_new_local_native_ref(env, env->head.pending);
+	ref = _jc_new_local_native_ref(env, env->pending);
 
 	/* Returning to native code */
 	_jc_stopping_java(env, NULL);
@@ -1712,7 +1712,7 @@
 	_jc_resuming_java(env);
 
 	/* Retrieve and clear pending exception, if any */
-	env->head.pending = NULL;
+	env->pending = NULL;
 
 	/* Returning to native code */
 	_jc_stopping_java(env, NULL);

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/native_lib.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/native_lib.c?rev=356400&r1=356399&r2=356400&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/native_lib.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/native_lib.c Mon
Dec 12 14:26:45 2005
@@ -15,7 +15,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: native_lib.c,v 1.7 2005/03/16 21:07:48 archiecobbs Exp $
+ * $Id$
  */
 
 #include "libjc.h"
@@ -105,7 +105,7 @@
 
 	/* Verbosity */
 	VERBOSE(JNI_INVOKE, vm, "%s from native method %s.%s%s",
-	    status == JNI_OK ? "returned" : env->head.pending->type->name,
+	    status == JNI_OK ? "returned" : env->pending->type->name,
 	    method->class->name, method->name, method->signature);
 
 	/* Done */

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/stack.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/stack.c?rev=356400&r1=356399&r2=356400&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/stack.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/stack.c Mon Dec
12 14:26:45 2005
@@ -176,7 +176,7 @@
 	_jc_object *e;
 
 	/* Get exception */
-	e = env->head.pending;
+	e = env->pending;
 
 again:
 	/* Sanity check */

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/structures.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/structures.h?rev=356400&r1=356399&r2=356400&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/structures.h (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/structures.h Mon
Dec 12 14:26:45 2005
@@ -238,8 +238,12 @@
  * The JC internal structure that corresponds to a Java thread.
  */
 struct _jc_env {
-	_jc_env_head			head;		/* must be first */
 	_jc_jvm				*vm;		/* vm that owns me */
+
+	/* Exception info */
+	_jc_catch_frame			*catch_list;	/* exception traps */
+	_jc_object			*pending;	/* posted exception */
+	_jc_object			*caught;	/* caught exception */
 
 	/* Interpreter trampoline info */
 	_jc_method			*interp;	/* interpret method */

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/thread.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/thread.c?rev=356400&r1=356399&r2=356400&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/thread.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/thread.c Mon Dec
12 14:26:45 2005
@@ -86,7 +86,7 @@
 	/* Sanity check */
 	_JC_ASSERT(env->status == _JC_THRDSTAT_RUNNING_NORMAL
 	    || env->status == _JC_THRDSTAT_HALTING_NORMAL);
-	_JC_ASSERT(env->head.pending == NULL);
+	_JC_ASSERT(env->pending == NULL);
 
 	/* Check for halt requested */
 	if (env->status == _JC_THRDSTAT_HALTING_NORMAL) {
@@ -105,7 +105,7 @@
 	if ((ex = _jc_retrieve_cross_exception(env)) != NULL) {
 		VERBOSE(EXCEPTIONS, vm, "cross-posting `%s' in thread %p",
 		    ex->type->name, env);
-		env->head.pending = ex;
+		env->pending = ex;
 		status = JNI_ERR;
 	}
 

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/vm.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/vm.c?rev=356400&r1=356399&r2=356400&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/vm.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/vm.c Mon Dec 12
14:26:45 2005
@@ -227,7 +227,7 @@
 	 * with no actual object created. If so, print out the info
 	 * saved in the initialization structure.
 	 */
-	if (env->head.pending == NULL && vm->initialization->ex.num != -1) {
+	if (env->pending == NULL && vm->initialization->ex.num != -1) {
 		_jc_initialization *const init = vm->initialization;
 
 		/* Print out the exception */
@@ -244,7 +244,7 @@
 	}
 
 	/* Otherwise, exception must have been posted normally */
-	_JC_ASSERT(env->head.pending != NULL);
+	_JC_ASSERT(env->pending != NULL);
 	_jc_print_stack_trace(env, stderr);
 
 done:



Mime
View raw message