src/hotspot/share/opto/phasetype.hpp
author redestad
Thu, 14 Nov 2019 15:24:35 +0100
changeset 59081 95a99e617f28
parent 55307 ed12027517c0
permissions -rw-r--r--
8234003: Improve IndexSet iteration Reviewed-by: neliasso, thartmann
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52711
diff changeset
     2
 * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     4
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     7
 * published by the Free Software Foundation.
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     8
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    13
 * accompanied this code).
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    14
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    18
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    21
 * questions.
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    22
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    23
 */
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    24
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52711
diff changeset
    25
#ifndef SHARE_OPTO_PHASETYPE_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52711
diff changeset
    26
#define SHARE_OPTO_PHASETYPE_HPP
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    27
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    28
enum CompilerPhaseType {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    29
  PHASE_BEFORE_STRINGOPTS,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    30
  PHASE_AFTER_STRINGOPTS,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    31
  PHASE_BEFORE_REMOVEUSELESS,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    32
  PHASE_AFTER_PARSING,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    33
  PHASE_ITER_GVN1,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    34
  PHASE_PHASEIDEAL_BEFORE_EA,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    35
  PHASE_ITER_GVN_AFTER_EA,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    36
  PHASE_ITER_GVN_AFTER_ELIMINATION,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    37
  PHASE_PHASEIDEALLOOP1,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    38
  PHASE_PHASEIDEALLOOP2,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    39
  PHASE_PHASEIDEALLOOP3,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    40
  PHASE_CPP1,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    41
  PHASE_ITER_GVN2,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    42
  PHASE_PHASEIDEALLOOP_ITERATIONS,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    43
  PHASE_OPTIMIZE_FINISHED,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    44
  PHASE_GLOBAL_CODE_MOTION,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    45
  PHASE_FINAL_CODE,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    46
  PHASE_AFTER_EA,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    47
  PHASE_BEFORE_CLOOPS,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    48
  PHASE_AFTER_CLOOPS,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    49
  PHASE_BEFORE_BEAUTIFY_LOOPS,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    50
  PHASE_AFTER_BEAUTIFY_LOOPS,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    51
  PHASE_BEFORE_MATCHING,
50235
ff5d0ea58d9b 8192992: Test8007294.java failed: attempted to spill a non-spillable item
neliasso
parents: 47216
diff changeset
    52
  PHASE_MATCHING,
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    53
  PHASE_INCREMENTAL_INLINE,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    54
  PHASE_INCREMENTAL_BOXING_INLINE,
55307
ed12027517c0 8224675: Late GC barrier insertion for ZGC
neliasso
parents: 53244
diff changeset
    55
  PHASE_CALL_CATCH_CLEANUP,
ed12027517c0 8224675: Late GC barrier insertion for ZGC
neliasso
parents: 53244
diff changeset
    56
  PHASE_INSERT_BARRIER,
ed12027517c0 8224675: Late GC barrier insertion for ZGC
neliasso
parents: 53244
diff changeset
    57
  PHASE_MACRO_EXPANSION,
ed12027517c0 8224675: Late GC barrier insertion for ZGC
neliasso
parents: 53244
diff changeset
    58
  PHASE_BARRIER_EXPANSION,
ed12027517c0 8224675: Late GC barrier insertion for ZGC
neliasso
parents: 53244
diff changeset
    59
  PHASE_ADD_UNSAFE_BARRIER,
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    60
  PHASE_END,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    61
  PHASE_FAILURE,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    62
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    63
  PHASE_NUM_TYPES
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    64
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    65
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    66
class CompilerPhaseTypeHelper {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    67
  public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    68
  static const char* to_string(CompilerPhaseType cpt) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    69
    switch (cpt) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    70
      case PHASE_BEFORE_STRINGOPTS:          return "Before StringOpts";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    71
      case PHASE_AFTER_STRINGOPTS:           return "After StringOpts";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    72
      case PHASE_BEFORE_REMOVEUSELESS:       return "Before RemoveUseless";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    73
      case PHASE_AFTER_PARSING:              return "After Parsing";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    74
      case PHASE_ITER_GVN1:                  return "Iter GVN 1";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    75
      case PHASE_PHASEIDEAL_BEFORE_EA:       return "PhaseIdealLoop before EA";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    76
      case PHASE_ITER_GVN_AFTER_EA:          return "Iter GVN after EA";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    77
      case PHASE_ITER_GVN_AFTER_ELIMINATION: return "Iter GVN after eliminating allocations and locks";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    78
      case PHASE_PHASEIDEALLOOP1:            return "PhaseIdealLoop 1";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    79
      case PHASE_PHASEIDEALLOOP2:            return "PhaseIdealLoop 2";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    80
      case PHASE_PHASEIDEALLOOP3:            return "PhaseIdealLoop 3";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    81
      case PHASE_CPP1:                       return "PhaseCPP 1";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    82
      case PHASE_ITER_GVN2:                  return "Iter GVN 2";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    83
      case PHASE_PHASEIDEALLOOP_ITERATIONS:  return "PhaseIdealLoop iterations";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    84
      case PHASE_OPTIMIZE_FINISHED:          return "Optimize finished";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    85
      case PHASE_GLOBAL_CODE_MOTION:         return "Global code motion";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    86
      case PHASE_FINAL_CODE:                 return "Final Code";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    87
      case PHASE_AFTER_EA:                   return "After Escape Analysis";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    88
      case PHASE_BEFORE_CLOOPS:              return "Before CountedLoop";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    89
      case PHASE_AFTER_CLOOPS:               return "After CountedLoop";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    90
      case PHASE_BEFORE_BEAUTIFY_LOOPS:      return "Before beautify loops";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    91
      case PHASE_AFTER_BEAUTIFY_LOOPS:       return "After beautify loops";
50235
ff5d0ea58d9b 8192992: Test8007294.java failed: attempted to spill a non-spillable item
neliasso
parents: 47216
diff changeset
    92
      case PHASE_BEFORE_MATCHING:            return "Before matching";
ff5d0ea58d9b 8192992: Test8007294.java failed: attempted to spill a non-spillable item
neliasso
parents: 47216
diff changeset
    93
      case PHASE_MATCHING:                   return "After matching";
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    94
      case PHASE_INCREMENTAL_INLINE:         return "Incremental Inline";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    95
      case PHASE_INCREMENTAL_BOXING_INLINE:  return "Incremental Boxing Inline";
55307
ed12027517c0 8224675: Late GC barrier insertion for ZGC
neliasso
parents: 53244
diff changeset
    96
      case PHASE_CALL_CATCH_CLEANUP:         return "Call catch cleanup";
ed12027517c0 8224675: Late GC barrier insertion for ZGC
neliasso
parents: 53244
diff changeset
    97
      case PHASE_INSERT_BARRIER:             return "Insert barrier";
ed12027517c0 8224675: Late GC barrier insertion for ZGC
neliasso
parents: 53244
diff changeset
    98
      case PHASE_MACRO_EXPANSION:            return "Macro expand";
ed12027517c0 8224675: Late GC barrier insertion for ZGC
neliasso
parents: 53244
diff changeset
    99
      case PHASE_BARRIER_EXPANSION:          return "Barrier expand";
ed12027517c0 8224675: Late GC barrier insertion for ZGC
neliasso
parents: 53244
diff changeset
   100
      case PHASE_ADD_UNSAFE_BARRIER:         return "Add barrier to unsafe op";
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   101
      case PHASE_END:                        return "End";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   102
      case PHASE_FAILURE:                    return "Failure";
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   103
      default:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   104
        ShouldNotReachHere();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   105
        return NULL;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   106
    }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   107
  }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   108
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   109
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52711
diff changeset
   110
#endif // SHARE_OPTO_PHASETYPE_HPP