harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arc...@apache.org
Subject svn commit: r356931 - /incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/interp.c
Date Wed, 14 Dec 2005 23:34:48 GMT
Author: archie
Date: Wed Dec 14 15:34:41 2005
New Revision: 356931

URL: http://svn.apache.org/viewcvs?rev=356931&view=rev
Log:
- In the interpreter don't call functions when yet-to-be-used values are
  sitting above the top of the Java stack. No harm in it currently; this
  is in anticipation of a future more efficient unified Java stack layout.
- Minor tweak to sizeof() types.

Modified:
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/interp.c

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=356931&r1=356930&r2=356931&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 Wed Dec
14 15:34:41 2005
@@ -1184,7 +1184,7 @@
 	PUSHI(_JC_LCMP(STACKJ(0), STACKJ(2)));
 	NEXT();
 do_ldc:
-	memcpy(sp, &INFO(constant), sizeof(jint));
+	memcpy(sp, &INFO(constant), sizeof(_jc_word));
 	POP(-1);
 	NEXT();
 do_ldc_string:
@@ -1217,7 +1217,7 @@
 	JUMP(pc);
     }
 do_ldc2_w:
-	memcpy(sp, &INFO(constant), 2 * sizeof(jint));
+	memcpy(sp, &INFO(constant), 2 * sizeof(_jc_word));
 	POP(-2);
 	NEXT();
 do_ldiv:
@@ -1404,20 +1404,17 @@
 	const u_char ptype = _jc_sig_types[(u_char)*field->signature];
 	const void *data;
 
-	/*
-	 * Pop the stack. We can't look directly at the field's type
-	 * here because the field's class may not be resolved yet.
-	 */
-	if (_jc_dword_type[ptype])
-		POP2(1);
-	else
-		POP(1);
-
 	/* Initialize field's class */
 	if (!_JC_FLG_TEST(field->class, INITIALIZED)) {
 		if (_jc_initialize_type(env, field->class) != JNI_OK)
 			goto exception;
 	}
+
+	/* Pop the stack */
+	if (_jc_dword_type[ptype])
+		POP2(1);
+	else
+		POP(1);
 
 	/* Set the field */
 	data = (char *)field->class->u.nonarray.class_fields + field->offset;



Mime
View raw message