BCEscapeAnalyzer::clear_escape_info does not clear all the slots

XMLWordPrintable

      This clears only up to sig->count() slots

      https://github.com/openjdk/jdk/blob/902aa4dcd297fef34cb302e468b030c48665ec84/src/hotspot/share/ci/bcEscapeAnalyzer.cpp#L1266-L1279

      void BCEscapeAnalyzer::clear_escape_info() {
        ciSignature* sig = method()->signature();
        int arg_count = sig->count();
        ArgumentMap var;
        if (!method()->is_static()) {
          arg_count++; // allow for "this"
        }
        for (int i = 0; i < arg_count; i++) {
          set_arg_modified(i, OFFSET_ANY, 4);
          var.clear();
          var.set(i);
          set_modified(var, OFFSET_ANY, 4);
          set_global_escape(var);
        }

      However, the number of slots in _arg_modified is method->arg_size(), which includes a slot for "this", and has one extra slot for each long/double arguments:

      https://github.com/openjdk/jdk/blob/902aa4dcd297fef34cb302e468b030c48665ec84/src/hotspot/share/ci/bcEscapeAnalyzer.cpp#L1444-L1460

      BCEscapeAnalyzer::BCEscapeAnalyzer(ciMethod* method, BCEscapeAnalyzer* parent)
      [...]
          , _arg_size(method ? method->arg_size() : 0)
      [...]
          _arg_modified = (uint *) arena->Amalloc(_arg_size * sizeof(uint));

            Assignee:
            Unassigned
            Reporter:
            Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: