analysis: add 'dump_global_optimizations_information' to generate logs about optimiza...
[nit.git] / src / analysis / icode_dump.nit
index d634376..26f5c0c 100644 (file)
@@ -35,6 +35,12 @@ redef class IRoutine
                if r != null then
                        icd.write "Result: {icd.register(r)}"
                end
+               if std_slots_nb > 0 then
+                       icd.write "StdSlots: {std_slots_nb}"
+               end
+               if tag_slots_nb > 0 then
+                       icd.write "TagSlots: {tag_slots_nb}"
+               end
                var closdecls = closure_decls
                if closdecls != null then
                        for c in closdecls do
@@ -77,7 +83,14 @@ class ICodeDumper
                                return s
                        else
                                _last_value += 1
-                               var s = "REG{i}(r{_last_value})"
+                               var s: String
+                               if e.in_tag_slots then
+                                       s = "BREG{i}(r{_last_value})"
+                               else if e.is_local then
+                                       s = "LREG{i}(r{_last_value})"
+                               else
+                                       s = "REG{i}(r{_last_value})"
+                               end
                                _ids[e] = s
                                return s
                        end
@@ -114,7 +127,7 @@ class ICodeDumper
        var _last_label: Int = 0
        # Return the name of e
        # If e is unknown, a new name is gived
-       fun lab(e: ISeq): String
+       fun lab(e: IEscapeMark): String
        do
                if _ids.has_key(e) then
                        return _ids[e]
@@ -141,7 +154,7 @@ class ICodeDumper
        end
 
        # Is the label e known? (because we goto to it)
-       fun has_lab(e: ISeq): Bool
+       fun has_lab(e: IEscapeMark): Bool
        do
                return _ids.has_key(e)
        end
@@ -211,7 +224,8 @@ redef class ISeq
                for ic in icodes do
                        ic.dump(icd)
                end
-               if icd.has_lab(self) then icd.write("{icd.lab(self)}:")
+               var mark = iescape_mark
+               if mark != null and icd.has_lab(mark) then icd.write("{icd.lab(mark)}:")
        end
 end
 
@@ -240,14 +254,15 @@ redef class ILoop
                end
                icd.unindent
                icd.write "}"
-               if icd.has_lab(self) then icd.write("{icd.lab(self)}:")
+               var mark = iescape_mark
+               if mark != null and icd.has_lab(mark) then icd.write("{icd.lab(mark)}:")
        end
 end
 
 redef class IEscape
        redef fun dump_intern(icd)
        do
-               return "ESCAPE {icd.lab(seq)}"
+               return "ESCAPE {icd.lab(iescape_mark)}"
        end
 end