[m-rev.] diff: map rtti ints to java type

Peter Wang novalazy at gmail.com
Wed Apr 22 17:13:37 AEST 2009


Branches: main

compiler/rtti.m:
        In RTTI data, map integers to Java `int' instead of the nonsensical
        `mercury.runtime.Integer'.

java/runtime/TypeCtorInfo_Struct.java:
        Conform to the change.

diff --git a/compiler/rtti.m b/compiler/rtti.m
index f41a59a..1bab65b 100644
--- a/compiler/rtti.m
+++ b/compiler/rtti.m
@@ -1867,6 +1867,10 @@ ctor_rtti_name_java_type(RttiName,
JavaTypeName, IsArray) :-
     ->
         JavaTypeName = "java.lang.String"
     ;
+        GenTypeName0 = "Integer"
+    ->
+        JavaTypeName = "int"
+    ;
         % In Java, every non-builtin type is a pointer,
         % so there's no need for the "Ptr" suffixes.
         string.remove_suffix(GenTypeName0, "Ptr", GenTypeName1)
diff --git a/java/runtime/TypeCtorInfo_Struct.java
b/java/runtime/TypeCtorInfo_Struct.java
index 085ae6e..5ff8df8 100644
--- a/java/runtime/TypeCtorInfo_Struct.java
+++ b/java/runtime/TypeCtorInfo_Struct.java
@@ -23,7 +23,7 @@ public class TypeCtorInfo_Struct extends PseudoTypeInfo {
 	public mercury.runtime.TypeLayout       type_layout;
 	public int 			        type_ctor_num_functors;
 	public /* short */ int 			type_ctor_flags;
-	public java.lang.Integer[]		type_functor_number_map;
+	public int[]              		type_functor_number_map;

 	public TypeCtorInfo_Struct(
 			int type_arity, int version, int num_ptags, int rep,
@@ -34,7 +34,7 @@ public class TypeCtorInfo_Struct extends PseudoTypeInfo {
 			// mercury.runtime.TypeLayout
 			java.lang.Object value_ordered_functor_descs,
 			int num_functors, int flags,
-			java.lang.Integer[] functor_number_map)
+			int[] functor_number_map)
 	{
 		arity = type_arity;
 		type_ctor_version = version;
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list