[m-rev.] java back-end library fixes

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Nov 28 20:09:04 AEDT 2003


Estimated hours taken: 2
Branches: main

Library fixes for the Java back-end.

library/builtin.m:
	Provide stub definition of tuple_0 class.

	Delete hand-code type_ctor_info definitions for int, string,
	and character, since these are now generated by the compiler
	automatically (thanks to Pete's changes for the IL backend).

library/private_builtin.m:
	Delete definitions of builtin_compare_int and builtin_compare_string,
	for same reason as above.

	Provide stub definition of type_ctor_info for type_info/1.

	Fix some bugs with the MR_TYPECTOR_REP definitions.

library/io.m:
	Provide Java `pragma foreign_type' declarations for the types
	array.array(T) and io.system_error.  This is needed to avoid
	compilation errors when building in grade `java'.

Workspace: /home/jupiter/fjh/ws-jupiter/mercury
Index: library/builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/builtin.m,v
retrieving revision 1.98
diff -u -d -r1.98 builtin.m
--- library/builtin.m	20 Nov 2003 22:58:58 -0000	1.98
+++ library/builtin.m	28 Nov 2003 07:47:04 -0000
@@ -685,17 +685,16 @@
 		{
 		}
 	}
+
+	public static class tuple_0
+	{
+		// stub only
+	}
 ").
 
 %-----------------------------------------------------------------------------%
 
 :- pragma foreign_code("Java", "
-
-    public static mercury.private_builtin.type_info_1 builtin__type_ctor_info_int_0 = new mercury.private_builtin.type_info_1();
-    
-    public static mercury.private_builtin.type_info_1 builtin__type_ctor_info_string_0 = new mercury.private_builtin.type_info_1();
-
-    public static mercury.private_builtin.type_info_1 builtin__type_ctor_info_character_0 = new mercury.private_builtin.type_info_1();
 
     public static boolean unify_2_p_0(mercury.private_builtin.type_info_1 ti,
 		    java.lang.Object x, java.lang.Object y)
Index: library/private_builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/private_builtin.m,v
retrieving revision 1.130
diff -u -d -r1.130 private_builtin.m
--- library/private_builtin.m	20 Nov 2003 11:35:42 -0000	1.130
+++ library/private_builtin.m	27 Nov 2003 22:18:49 -0000
@@ -1132,52 +1132,10 @@
 %-----------------------------------------------------------------------------%
 
 :- pragma foreign_code("Java", "
-//    public static class type_info_1
-//     {
-//	public int                              arity;
-//	public int                              type_ctor_version;
-//	public mercury.runtime.TypeCtorRep      type_ctor_rep;
-//	public int                              type_ctor_num_ptags; // if DU
-//	public mercury.runtime.MethodPtr        unify_pred;
-//	public mercury.runtime.MethodPtr        compare_pred;
-//	public java.lang.String                 type_ctor_module_name;
-//	public java.lang.String                 type_ctor_name;
-//	public mercury.runtime.TypeFunctors     type_functors;
-//	public mercury.runtime.TypeLayout       type_layout;
-//	public int 			        type_ctor_num_functors;
-//   }
-   
-    public static mercury.builtin.comparison_result_0
-    builtin_compare_int_3_p_0(int val1, int val2)
-     {
-        if(val1 == val2)
-	     return new mercury.builtin.comparison_result_0(
-	     	mercury.builtin.comparison_result_0.f_equal);
-	else if(val1 < val2)
-	     return new mercury.builtin.comparison_result_0(
-	     	mercury.builtin.comparison_result_0.f_less_than);
-	else
-	     return new mercury.builtin.comparison_result_0(
-	     	mercury.builtin.comparison_result_0.f_greater_than);
-	
-     }
+    public static mercury.private_builtin.type_info_1
+	    private_builtin__type_ctor_info_type_info_1 =
+		    new mercury.private_builtin.type_info_1();
 
-    public static mercury.builtin.comparison_result_0
-    builtin_compare_string_3_p_0(String string1, String string2)
-     {
-	int value = string1.compareTo(string2);
-	
-        if(value == 0)
-	     return new mercury.builtin.comparison_result_0(
-	     	mercury.builtin.comparison_result_0.f_equal);
-	else if(value < 0)
-	     return new mercury.builtin.comparison_result_0(
-	     	mercury.builtin.comparison_result_0.f_less_than);
-	else
-	     return new mercury.builtin.comparison_result_0(
-	     	mercury.builtin.comparison_result_0.f_greater_than);
-     }
-    
     public static class ref_1
      {
      	// XXX stub only
@@ -1202,8 +1160,8 @@
     public static final int MR_TYPECTOR_REP_FLOAT = 10;
     public static final int MR_TYPECTOR_REP_STRING = 11;
     public static final int MR_TYPECTOR_REP_PRED = 12;
-    public static final int MR_TYPECTOR_REP_UNIV = 13;
-    public static final int MR_TYPECTOR_REP_SUBGOAL = 14;
+    public static final int MR_TYPECTOR_REP_SUBGOAL = 13;
+    public static final int MR_TYPECTOR_REP_VOID = 14;
     public static final int MR_TYPECTOR_REP_C_POINTER = 15;
     public static final int MR_TYPECTOR_REP_TYPEINFO = 16;
     public static final int MR_TYPECTOR_REP_TYPECLASSINFO = 17;
@@ -1231,6 +1189,10 @@
     public static final int MR_TYPECTOR_REP_STABLE_C_POINTER = 39;
     public static final int MR_TYPECTOR_REP_UNKNOWN = 40;
 	
+    public static final int MR_SECTAG_NONE	= 0;
+    public static final int MR_SECTAG_LOCAL	= 1;
+    public static final int MR_SECTAG_REMOTE	= 2;
+    public static final int MR_SECTAG_VARIABLE	= 3;
 ").
 
 %-----------------------------------------------------------------------------%

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list