XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 12
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b18

      Description

      Tranform the assignments from ifs.

      Here is the script used:

      {
              macros[1] = "NSK_VERIFY"
              macros[2] = "NSK_JNI_VERIFY"
              macros[3] = "NSK_JVMTI_VERIFY"

              indentation = gensub(/([ ]*).*/, "\\1" , "g", $0)

              pattern = ".*NULL)(.*)"
              suffix = gensub(pattern, "\\1" , "g", $0)

              comparator = gensub(/.* (..) NULL.*/, "\\1", "g", $0)

              for (m in macros) {
                      macro = macros[m]

                      pattern = macro "((.* = .* .. NULL))"
                      if ($0 ~ pattern) {
                              pattern = "(.*" macro "\\().*"
                              prefix = gensub(pattern, "\\1", "g", $0)

                              pattern = ".*" macro "\\(\\((.*)\\) .. NULL)).*"
                              assignment = gensub(pattern, "\\1" , "g", $0)

                              dest = gensub(/(.*) =.*/, "\\1" , "g", assignment)

                              print indentation assignment ";"
                              print prefix dest " " comparator " NULL)" suffix
                              next
                      }
              }

              if ($0 ~ "((.* = .* .. NULL))") {
                      assignment = gensub(/.*\(\((.*)) .. NULL).*/, "\\1" , "g", $0)
                      prefix = gensub(/(.*if \().*/, "\\1", "g", $0)

                      dest = gensub(/(.*) =.*/, "\\1" , "g", assignment)

                      print indentation assignment ";"
                      print prefix dest " " comparator " NULL)" suffix
                      next
              }

              # No macro...
              print $0
      }

        Attachments

          Activity

            People

            Assignee:
            jcbeyler Jean Christophe Beyler
            Reporter:
            jcbeyler Jean Christophe Beyler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: