[Vm-dev] [commit] r2470 - Add direct marhsalling of Floats in Alien calls. Pass Floats as doubles.

commits at squeakvm.org commits at squeakvm.org
Mon Jul 25 20:42:55 UTC 2011


Author: eliot
Date: 2011-07-25 13:42:55 -0700 (Mon, 25 Jul 2011)
New Revision: 2470

Modified:
   trunk/platforms/Cross/plugins/IA32ABI/dabusiness.h
Log:
Add direct marhsalling of Floats in Alien calls. Pass Floats as doubles.


Modified: trunk/platforms/Cross/plugins/IA32ABI/dabusiness.h
===================================================================
--- trunk/platforms/Cross/plugins/IA32ABI/dabusiness.h	2011-07-21 23:04:48 UTC (rev 2469)
+++ trunk/platforms/Cross/plugins/IA32ABI/dabusiness.h	2011-07-25 20:42:55 UTC (rev 2470)
@@ -22,6 +22,8 @@
 		sqInt arg = argVector[i+1];
 		if (objIsAlien(arg) && sizeField(arg))
 			size += moduloPOT(sizeof(long),abs(sizeField(arg)));
+		else if (interpreterProxy->isFloatObject(arg))
+			size += sizeof(double);
 		else /* assume an integer or pointer.  check below. */
 			size += sizeof(long);
 	}
@@ -31,6 +33,8 @@
 		sqInt arg = argVector[i];
 		if (objIsAlien(arg) && sizeField(arg))
 			size += moduloPOT(sizeof(long),abs(sizeField(arg)));
+		else if (interpreterProxy->isFloatObject(arg))
+			size += sizeof(double);
 		else /* assume an integer or pointer.  check below. */
 			size += sizeof(long);
 	}
@@ -79,6 +83,11 @@
 			*(void **)argvec = v;
 			argvec += sizeof(long);
 		}
+		else if (interpreterProxy->isFloatObject(arg)) {
+			double d = interpreterProxy->floatValueOf(arg);
+			*(double *)argvec = d;
+			argvec += sizeof(double);
+		}
 		else {
 			long v = interpreterProxy->signed32BitValueOf(arg);
 			if (interpreterProxy->failed()) {
@@ -115,6 +124,11 @@
 			*(void **)argvec = v;
 			argvec += sizeof(long);
 		}
+		else if (interpreterProxy->isFloatObject(arg)) {
+			double d = interpreterProxy->floatValueOf(arg);
+			*(double *)argvec = d;
+			argvec += sizeof(double);
+		}
 		else {
 			long v = interpreterProxy->signed32BitValueOf(arg);
 			if (interpreterProxy->failed()) {



More information about the Vm-dev mailing list