Kaynağa Gözat

+ systems_garbage_collected_managed_types set in systems.pas
* don't call special helpers to assign refcounted types for
systems_garbage_collected_managed_types

git-svn-id: branches/jvmbackend@18412 -

Jonas Maebe 14 yıl önce
ebeveyn
işleme
14e4f3459c
2 değiştirilmiş dosya ile 9 ekleme ve 2 silme
  1. 4 2
      compiler/nld.pas
  2. 5 0
      compiler/systems.pas

+ 4 - 2
compiler/nld.pas

@@ -717,7 +717,8 @@ implementation
         else if is_managed_type(left.resultdef) and
             (left.resultdef.typ in [arraydef,objectdef,recorddef]) and
             not is_interfacecom_or_dispinterface(left.resultdef) and
-            not is_dynamic_array(left.resultdef) then
+            not is_dynamic_array(left.resultdef) and
+            not(target_info.system in systems_garbage_collected_managed_types) then
          begin
            hp:=ccallparanode.create(caddrnode.create_internal(
                   crttinode.create(tstoreddef(left.resultdef),initrtti,rdt_normal)),
@@ -734,7 +735,8 @@ implementation
          end
         { call helpers for variant, they can contain non ref. counted types like
           vararrays which must be really copied }
-        else if left.resultdef.typ=variantdef then
+        else if (left.resultdef.typ=variantdef) and
+            not(target_info.system in systems_garbage_collected_managed_types)  then
          begin
            hp:=ccallparanode.create(ctypeconvnode.create_internal(
                  caddrnode.create_internal(right),voidpointertype),

+ 5 - 0
compiler/systems.pas

@@ -301,6 +301,11 @@ interface
         system_x86_64_freebsd,
         system_x86_64_solaris];
 
+       { all systems that use garbage collection for reference-counted types }
+       systems_garbage_collected_managed_types = [
+         system_jvm_java32
+       ];
+
        cpu2str : array[TSystemCpu] of string[10] =
             ('','i386','m68k','alpha','powerpc','sparc','vm','ia64','x86_64',
              'mips','arm', 'powerpc64', 'avr', 'mipsel','jvm');