harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arc...@apache.org
Subject svn commit: r377249 - in /incubator/harmony/enhanced/jchevm/libjc: definitions.h gc_scan.c native/java_lang_VMThrowable.c stack.c
Date Sun, 12 Feb 2006 21:58:25 GMT
Author: archie
Date: Sun Feb 12 13:58:23 2006
New Revision: 377249

URL: http://svn.apache.org/viewcvs?rev=377249&view=rev
Log:
Slight simplification of the handling of _jc_saved_frame structures.

Modified:
    incubator/harmony/enhanced/jchevm/libjc/definitions.h
    incubator/harmony/enhanced/jchevm/libjc/gc_scan.c
    incubator/harmony/enhanced/jchevm/libjc/native/java_lang_VMThrowable.c
    incubator/harmony/enhanced/jchevm/libjc/stack.c

Modified: incubator/harmony/enhanced/jchevm/libjc/definitions.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/jchevm/libjc/definitions.h?rev=377249&r1=377248&r2=377249&view=diff
==============================================================================
--- incubator/harmony/enhanced/jchevm/libjc/definitions.h (original)
+++ incubator/harmony/enhanced/jchevm/libjc/definitions.h Sun Feb 12 13:58:23 2006
@@ -325,6 +325,14 @@
 	_JC_ROUNDUP2(sizeof(_jc_uni_pages), _JC_FULL_ALIGNMENT)
 
 /*
+ * This is the padding required at the beginning of a byte[] array
+ * to ensure universal alignment.
+ */
+#define _JC_BYTE_ARRAY_PAD						\
+	(_JC_ROUNDUP2(_JC_OFFSETOF(_jc_byte_array, elems),		\
+	    _JC_FULL_ALIGNMENT) - _JC_OFFSETOF(_jc_byte_array, elems))
+
+/*
  * Minimum number of uni-allocator pages to grab when additional
  * class loader memory is needed.
  */

Modified: incubator/harmony/enhanced/jchevm/libjc/gc_scan.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/jchevm/libjc/gc_scan.c?rev=377249&r1=377248&r2=377249&view=diff
==============================================================================
--- incubator/harmony/enhanced/jchevm/libjc/gc_scan.c (original)
+++ incubator/harmony/enhanced/jchevm/libjc/gc_scan.c Sun Feb 12 13:58:23 2006
@@ -755,10 +755,9 @@
 			    VMThrowable, vmdata, _jc_byte_array *);
 			if (bytes == NULL)
 				goto do_exception_loader;
-			frames = (_jc_saved_frame *)_JC_ROUNDUP2(
-			    (_jc_word)bytes->elems, _JC_FULL_ALIGNMENT);
-			num_frames = (bytes->length -
-			      ((_jc_word)frames - (_jc_word)bytes->elems))
+			frames = (_jc_saved_frame *)
+			    (bytes->elems + _JC_BYTE_ARRAY_PAD);
+			num_frames = (bytes->length - _JC_BYTE_ARRAY_PAD)
 			    / sizeof(*frames);
 			if (num_frames == 0)
 				goto do_exception_loader;

Modified: incubator/harmony/enhanced/jchevm/libjc/native/java_lang_VMThrowable.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/jchevm/libjc/native/java_lang_VMThrowable.c?rev=377249&r1=377248&r2=377249&view=diff
==============================================================================
--- incubator/harmony/enhanced/jchevm/libjc/native/java_lang_VMThrowable.c (original)
+++ incubator/harmony/enhanced/jchevm/libjc/native/java_lang_VMThrowable.c Sun Feb 12 13:58:23
2006
@@ -21,12 +21,6 @@
 #include "libjc.h"
 #include "java_lang_VMThrowable.h"
 
-/* Used to align byte[] array bytes to _JC_FULL_ALIGNMENT */
-#define _JC_BYTE_ARRAY_PAD	(_JC_ROUNDUP2(_JC_OFFSETOF(		\
-				    _jc_byte_array, elems),		\
-				      _JC_FULL_ALIGNMENT)		\
-				    - _JC_OFFSETOF(_jc_byte_array, elems))
-
 /*
  * static final native VMThrowable fillInStackTrace(Throwable)
  */
@@ -50,8 +44,7 @@
 	      num_frames * sizeof(*frames) + _JC_BYTE_ARRAY_PAD))) == NULL)
 		_jc_throw_exception(env);
 	bytes = (_jc_byte_array *)*bytes_ref;
-	frames = (_jc_saved_frame *)_JC_ROUNDUP2(
-	    (_jc_word)bytes->elems, _JC_FULL_ALIGNMENT);
+	frames = (_jc_saved_frame *)(bytes->elems + _JC_BYTE_ARRAY_PAD);
 
 	/* Fill in trace */
 	_jc_save_stack_frames(env, env, num_frames, frames);

Modified: incubator/harmony/enhanced/jchevm/libjc/stack.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/jchevm/libjc/stack.c?rev=377249&r1=377248&r2=377249&view=diff
==============================================================================
--- incubator/harmony/enhanced/jchevm/libjc/stack.c (original)
+++ incubator/harmony/enhanced/jchevm/libjc/stack.c Sun Feb 12 13:58:23 2006
@@ -97,10 +97,8 @@
 		goto no_trace;
 
 	/* Print stack frames */
-	frames = (_jc_saved_frame *)_JC_ROUNDUP2(
-	    (_jc_word)bytes->elems, _JC_FULL_ALIGNMENT);
-	num_frames = (bytes->length -
-	    ((_jc_word)frames - (_jc_word)bytes->elems)) / sizeof(*frames);
+	frames = (_jc_saved_frame *)(bytes->elems + _JC_BYTE_ARRAY_PAD);
+	num_frames = (bytes->length - _JC_BYTE_ARRAY_PAD) / sizeof(*frames);
 	_jc_print_stack_frames(env, fp, num_frames, frames);
 
 no_trace:



Mime
View raw message