Преглед изворни кода

* store the "synthetic kind" information about procdefs in ppu files,
required by future patch

git-svn-id: trunk@22956 -

Jonas Maebe пре 12 година
родитељ
комит
c4a55f5481
4 измењених фајлова са 49 додато и 28 уклоњено
  1. 1 1
      compiler/ppu.pas
  2. 27 0
      compiler/symconst.pas
  3. 2 27
      compiler/symdef.pas
  4. 19 0
      compiler/utils/ppudump.pp

+ 1 - 1
compiler/ppu.pas

@@ -43,7 +43,7 @@ type
 {$endif Test_Double_checksum}
 
 const
-  CurrentPPUVersion = 153;
+  CurrentPPUVersion = 154;
 
 { buffer sizes }
   maxentrysize = 1024;

+ 27 - 0
compiler/symconst.pas

@@ -338,6 +338,33 @@ type
   );
   tprocoptions=set of tprocoption;
 
+  { kinds of synthetic procdefs that can be generated }
+  tsynthetickind = (
+    tsk_none,
+    tsk_anon_inherited,        // anonymous inherited call
+    tsk_jvm_clone,             // Java-style clone method
+    tsk_record_deepcopy,       // deepcopy for records field by field
+    tsk_record_initialize,     // initialize for records field by field (explicit rather than via rtti)
+    tsk_empty,                 // an empty routine
+    tsk_tcinit,                // initialisation of typed constants
+    tsk_callthrough,           // call through to another routine with the same parameters/return type (its def is stored in the skpara field)
+    tsk_callthrough_nonabstract,// call through to another routine if the current class not abstract (otherwise do the same as tsk_empty)
+    tsk_jvm_enum_values,       // Java "values" class method of JLEnum descendants
+    tsk_jvm_enum_valueof,      // Java "valueOf" class method of JLEnum descendants
+    tsk_jvm_enum_classconstr,  // Java class constructor for JLEnum descendants
+    tsk_jvm_enum_jumps_constr, // Java constructor for JLEnum descendants for enums with jumps
+    tsk_jvm_enum_fpcordinal,   // Java FPCOrdinal function that returns the enum's ordinal value from an FPC POV
+    tsk_jvm_enum_fpcvalueof,   // Java FPCValueOf function that returns the enum instance corresponding to an ordinal from an FPC POV
+    tsk_jvm_enum_long2set,     // Java fpcLongToEnumSet function that returns an enumset corresponding to a bit pattern in a jlong
+    tsk_jvm_enum_bitset2set,   // Java fpcBitSetToEnumSet function that returns an enumset corresponding to a BitSet
+    tsk_jvm_enum_set2Set,      // Java fpcEnumSetToEnumSet function that returns an enumset corresponding to another enumset (different enum kind)
+    tsk_jvm_procvar_invoke,    // Java invoke method that calls a wrapped procvar
+    tsk_jvm_procvar_intconstr, // Java procvar class constructor that accepts an interface instance for easy Java interoperation
+    tsk_jvm_virtual_clmethod,  // Java wrapper for virtual class method
+    tsk_field_getter,          // getter for a field (callthrough property is passed in skpara)
+    tsk_field_setter           // Setter for a field (callthrough property is passed in skpara)
+  );
+
   { options for objects and classes }
   tobjecttyp = (odt_none,
     odt_class,

+ 2 - 27
compiler/symdef.pas

@@ -531,33 +531,6 @@ interface
        end;
        pinlininginfo = ^tinlininginfo;
 
-       { kinds of synthetic procdefs that can be generated }
-       tsynthetickind = (
-         tsk_none,
-         tsk_anon_inherited,        // anonymous inherited call
-         tsk_jvm_clone,             // Java-style clone method
-         tsk_record_deepcopy,       // deepcopy for records field by field
-         tsk_record_initialize,     // initialize for records field by field (explicit rather than via rtti)
-         tsk_empty,                 // an empty routine
-         tsk_tcinit,                // initialisation of typed constants
-         tsk_callthrough,           // call through to another routine with the same parameters/return type (its def is stored in the skpara field)
-         tsk_callthrough_nonabstract,// call through to another routine if the current class not abstract (otherwise do the same as tsk_empty)
-         tsk_jvm_enum_values,       // Java "values" class method of JLEnum descendants
-         tsk_jvm_enum_valueof,      // Java "valueOf" class method of JLEnum descendants
-         tsk_jvm_enum_classconstr,  // Java class constructor for JLEnum descendants
-         tsk_jvm_enum_jumps_constr, // Java constructor for JLEnum descendants for enums with jumps
-         tsk_jvm_enum_fpcordinal,   // Java FPCOrdinal function that returns the enum's ordinal value from an FPC POV
-         tsk_jvm_enum_fpcvalueof,   // Java FPCValueOf function that returns the enum instance corresponding to an ordinal from an FPC POV
-         tsk_jvm_enum_long2set,     // Java fpcLongToEnumSet function that returns an enumset corresponding to a bit pattern in a jlong
-         tsk_jvm_enum_bitset2set,   // Java fpcBitSetToEnumSet function that returns an enumset corresponding to a BitSet
-         tsk_jvm_enum_set2Set,      // Java fpcEnumSetToEnumSet function that returns an enumset corresponding to another enumset (different enum kind)
-         tsk_jvm_procvar_invoke,    // Java invoke method that calls a wrapped procvar
-         tsk_jvm_procvar_intconstr, // Java procvar class constructor that accepts an interface instance for easy Java interoperation
-         tsk_jvm_virtual_clmethod,  // Java wrapper for virtual class method
-         tsk_field_getter,          // getter for a field (callthrough property is passed in skpara)
-         tsk_field_setter           // Setter for a field (callthrough property is passed in skpara)
-       );
-
 {$ifdef oldregvars}
        { register variables }
        pregvarinfo = ^tregvarinfo;
@@ -4110,6 +4083,7 @@ implementation
            deprecatedmsg:=stringdup(ppufile.getstring)
          else
            deprecatedmsg:=nil;
+         synthetickind:=tsynthetickind(ppufile.getbyte);
 {$ifdef powerpc}
          { library symbol for AmigaOS/MorphOS }
          ppufile.getderef(libsymderef);
@@ -4260,6 +4234,7 @@ implementation
          ppufile.putsmallset(symoptions);
          if sp_has_deprecated_msg in symoptions then
            ppufile.putstring(deprecatedmsg^);
+         ppufile.putbyte(byte(synthetickind));
 {$ifdef powerpc}
          { library symbol for AmigaOS/MorphOS }
          ppufile.putderef(libsymderef);

+ 19 - 0
compiler/utils/ppudump.pp

@@ -356,6 +356,24 @@ begin
     result:=Unknown('visibility',w);
 end;
 
+Function Synthetic2Str(w: byte): string;
+const
+   syntheticName : array[tsynthetickind] of string[length('jvm procvar intf constructor')] = (
+      '<none>','anon inherited','jvm clone','record deep copy',
+      'record initilializer', 'empty routine', 'typed const initializer',
+      'callthough', 'callthrough if not abstract', 'jvm enum values',
+      'jvm enum valueof', 'jvm enum class constructor',
+      'jvm enum jumps constructor', 'jvm enum fpcordinal',
+      'jvm enum fpcvalueof', 'jvm enum long2set',
+      'jvm enum bitset2set', 'jvm enum set2set',
+      'jvm procvar invoke', 'jvm procvar intf constructor',
+      'jvm virtual class method', 'jvm field getter', 'jvm field setter');
+begin
+  if w<=ord(high(syntheticName)) then
+    result:=syntheticName[tsynthetickind(w)]
+  else
+    result:=Unknown('synthetickind',w);
+end;
 
 function PPUFlags2Str(flags:longint):string;
 type
@@ -2333,6 +2351,7 @@ begin
              writeln(space,'       Visibility : ',Visibility2Str(ppufile.getbyte));
              write  (space,'       SymOptions : ');
              readsymoptions(space+'       ');
+             write  (space,'   Synthetic kind : ',Synthetic2Str(ppufile.getbyte));
              if tsystemcpu(ppufile.header.cpu)=cpu_powerpc then
                begin
                  { library symbol for AmigaOS/MorphOS }