hotspot/src/share/vm/opto/phase.cpp
author kvn
Tue, 28 Jan 2014 12:25:34 -0800
changeset 22872 b6902ee5bc8d
parent 22234 da823d78ad65
parent 22844 90f76a40ed8a
child 26913 9ad70cd32368
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
22234
da823d78ad65 8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
mikael
parents: 17383
diff changeset
     2
 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3676
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3676
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3676
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#include "precompiled.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#include "code/nmethod.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
#include "compiler/compileBroker.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "opto/compile.hpp"
22844
90f76a40ed8a 8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents: 17383
diff changeset
    29
#include "opto/matcher.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    30
#include "opto/node.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
#include "opto/phase.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
int Phase::_total_bytes_compiled = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
elapsedTimer Phase::_t_totalCompilation;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
elapsedTimer Phase::_t_methodCompilation;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
elapsedTimer Phase::_t_stubCompilation;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
// The next timers used for LogCompilation
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
elapsedTimer Phase::_t_parser;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
elapsedTimer Phase::_t_optimizer;
12158
f24f2560da32 7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents: 8319
diff changeset
    44
elapsedTimer   Phase::_t_escapeAnalysis;
f24f2560da32 7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents: 8319
diff changeset
    45
elapsedTimer     Phase::_t_connectionGraph;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
elapsedTimer   Phase::_t_idealLoop;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
elapsedTimer   Phase::_t_ccp;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
elapsedTimer Phase::_t_matcher;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
elapsedTimer Phase::_t_registerAllocation;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
elapsedTimer Phase::_t_output;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
elapsedTimer Phase::_t_graphReshaping;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
elapsedTimer Phase::_t_scheduler;
1498
346bf226078e 6743900: frequency based block layout
rasbold
parents: 1
diff changeset
    55
elapsedTimer Phase::_t_blockOrdering;
12158
f24f2560da32 7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents: 8319
diff changeset
    56
elapsedTimer Phase::_t_macroEliminate;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
elapsedTimer Phase::_t_macroExpand;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
elapsedTimer Phase::_t_peephole;
22844
90f76a40ed8a 8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents: 17383
diff changeset
    59
elapsedTimer Phase::_t_postalloc_expand;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
elapsedTimer Phase::_t_codeGeneration;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
elapsedTimer Phase::_t_registerMethod;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
elapsedTimer Phase::_t_temporaryTimer1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
elapsedTimer Phase::_t_temporaryTimer2;
3676
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
    64
elapsedTimer Phase::_t_idealLoopVerify;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
// Subtimers for _t_optimizer
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
elapsedTimer   Phase::_t_iterGVN;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
elapsedTimer   Phase::_t_iterGVN2;
17383
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 12158
diff changeset
    69
elapsedTimer   Phase::_t_incrInline;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
// Subtimers for _t_registerAllocation
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
elapsedTimer   Phase::_t_ctorChaitin;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
elapsedTimer   Phase::_t_buildIFGphysical;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
elapsedTimer   Phase::_t_computeLive;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
elapsedTimer   Phase::_t_regAllocSplit;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
elapsedTimer   Phase::_t_postAllocCopyRemoval;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
elapsedTimer   Phase::_t_fixupSpills;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
// Subtimers for _t_output
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
elapsedTimer   Phase::_t_instrSched;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
elapsedTimer   Phase::_t_buildOopMaps;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
//------------------------------Phase------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
Phase::Phase( PhaseNumber pnum ) : _pnum(pnum), C( pnum == Compiler ? NULL : Compile::current()) {
2131
98f9cef66a34 6810672: Comment typos
twisti
parents: 1623
diff changeset
    86
  // Poll for requests from shutdown mechanism to quiesce compiler (4448539, 4448544).
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  // This is an effective place to poll, since the compiler is full of phases.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  // In particular, every inlining site uses a recursively created Parse phase.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  CompileBroker::maybe_block();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
static const double minimum_reported_time             = 0.0001; // seconds
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
static const double expected_method_compile_coverage  = 0.97;   // %
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
static const double minimum_meaningful_method_compile = 2.00;   // seconds
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
void Phase::print_timers() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  tty->print_cr ("Accumulated compiler times:");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  tty->print_cr ("---------------------------");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  tty->print_cr ("  Total compilation: %3.3f sec.", Phase::_t_totalCompilation.seconds());
3676
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   101
  tty->print    ("    method compilation   : %3.3f sec", Phase::_t_methodCompilation.seconds());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  tty->print    ("/%d bytes",_total_bytes_compiled);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  tty->print_cr (" (%3.0f bytes per sec) ", Phase::_total_bytes_compiled / Phase::_t_methodCompilation.seconds());
3676
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   104
  tty->print_cr ("    stub compilation     : %3.3f sec.", Phase::_t_stubCompilation.seconds());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  tty->print_cr ("  Phases:");
3676
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   106
  tty->print_cr ("    parse          : %3.3f sec", Phase::_t_parser.seconds());
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   107
  tty->print_cr ("    optimizer      : %3.3f sec", Phase::_t_optimizer.seconds());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  if( Verbose || WizardMode ) {
8319
aedb3bd871bc 7013538: Java memory leak with escape analysis
kvn
parents: 7397
diff changeset
   109
    if (DoEscapeAnalysis) {
aedb3bd871bc 7013538: Java memory leak with escape analysis
kvn
parents: 7397
diff changeset
   110
      // EA is part of Optimizer.
aedb3bd871bc 7013538: Java memory leak with escape analysis
kvn
parents: 7397
diff changeset
   111
      tty->print_cr ("      escape analysis: %3.3f sec", Phase::_t_escapeAnalysis.seconds());
12158
f24f2560da32 7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents: 8319
diff changeset
   112
      tty->print_cr ("        connection graph: %3.3f sec", Phase::_t_connectionGraph.seconds());
f24f2560da32 7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents: 8319
diff changeset
   113
      tty->print_cr ("      macroEliminate : %3.3f sec", Phase::_t_macroEliminate.seconds());
8319
aedb3bd871bc 7013538: Java memory leak with escape analysis
kvn
parents: 7397
diff changeset
   114
    }
3676
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   115
    tty->print_cr ("      iterGVN        : %3.3f sec", Phase::_t_iterGVN.seconds());
17383
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 12158
diff changeset
   116
    tty->print_cr ("      incrInline     : %3.3f sec", Phase::_t_incrInline.seconds());
3676
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   117
    tty->print_cr ("      idealLoop      : %3.3f sec", Phase::_t_idealLoop.seconds());
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   118
    tty->print_cr ("      idealLoopVerify: %3.3f sec", Phase::_t_idealLoopVerify.seconds());
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   119
    tty->print_cr ("      ccp            : %3.3f sec", Phase::_t_ccp.seconds());
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   120
    tty->print_cr ("      iterGVN2       : %3.3f sec", Phase::_t_iterGVN2.seconds());
8319
aedb3bd871bc 7013538: Java memory leak with escape analysis
kvn
parents: 7397
diff changeset
   121
    tty->print_cr ("      macroExpand    : %3.3f sec", Phase::_t_macroExpand.seconds());
3676
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   122
    tty->print_cr ("      graphReshape   : %3.3f sec", Phase::_t_graphReshaping.seconds());
12158
f24f2560da32 7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents: 8319
diff changeset
   123
    double optimizer_subtotal = Phase::_t_iterGVN.seconds() + Phase::_t_iterGVN2.seconds() +
f24f2560da32 7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents: 8319
diff changeset
   124
      Phase::_t_escapeAnalysis.seconds() + Phase::_t_macroEliminate.seconds() +
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
      Phase::_t_idealLoop.seconds() + Phase::_t_ccp.seconds() +
12158
f24f2560da32 7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents: 8319
diff changeset
   126
      Phase::_t_macroExpand.seconds() + Phase::_t_graphReshaping.seconds();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
    double percent_of_optimizer = ((optimizer_subtotal == 0.0) ? 0.0 : (optimizer_subtotal / Phase::_t_optimizer.seconds() * 100.0));
3676
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   128
    tty->print_cr ("      subtotal       : %3.3f sec,  %3.2f %%", optimizer_subtotal, percent_of_optimizer);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  }
3676
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   130
  tty->print_cr ("    matcher        : %3.3f sec", Phase::_t_matcher.seconds());
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   131
  tty->print_cr ("    scheduler      : %3.3f sec", Phase::_t_scheduler.seconds());
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   132
  tty->print_cr ("    regalloc       : %3.3f sec", Phase::_t_registerAllocation.seconds());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  if( Verbose || WizardMode ) {
3676
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   134
    tty->print_cr ("      ctorChaitin    : %3.3f sec", Phase::_t_ctorChaitin.seconds());
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   135
    tty->print_cr ("      buildIFG       : %3.3f sec", Phase::_t_buildIFGphysical.seconds());
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   136
    tty->print_cr ("      computeLive    : %3.3f sec", Phase::_t_computeLive.seconds());
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   137
    tty->print_cr ("      regAllocSplit  : %3.3f sec", Phase::_t_regAllocSplit.seconds());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
    tty->print_cr ("      postAllocCopyRemoval: %3.3f sec", Phase::_t_postAllocCopyRemoval.seconds());
3676
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   139
    tty->print_cr ("      fixupSpills    : %3.3f sec", Phase::_t_fixupSpills.seconds());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
    double regalloc_subtotal = Phase::_t_ctorChaitin.seconds() +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
      Phase::_t_buildIFGphysical.seconds() + Phase::_t_computeLive.seconds() +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
      Phase::_t_regAllocSplit.seconds()    + Phase::_t_fixupSpills.seconds() +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
      Phase::_t_postAllocCopyRemoval.seconds();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
    double percent_of_regalloc = ((regalloc_subtotal == 0.0) ? 0.0 : (regalloc_subtotal / Phase::_t_registerAllocation.seconds() * 100.0));
3676
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   145
    tty->print_cr ("      subtotal       : %3.3f sec,  %3.2f %%", regalloc_subtotal, percent_of_regalloc);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  }
3676
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   147
  tty->print_cr ("    blockOrdering  : %3.3f sec", Phase::_t_blockOrdering.seconds());
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   148
  tty->print_cr ("    peephole       : %3.3f sec", Phase::_t_peephole.seconds());
22844
90f76a40ed8a 8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents: 17383
diff changeset
   149
  if (Matcher::require_postalloc_expand) {
90f76a40ed8a 8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents: 17383
diff changeset
   150
    tty->print_cr ("    postalloc_expand: %3.3f sec", Phase::_t_postalloc_expand.seconds());
90f76a40ed8a 8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents: 17383
diff changeset
   151
  }
3676
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   152
  tty->print_cr ("    codeGen        : %3.3f sec", Phase::_t_codeGeneration.seconds());
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   153
  tty->print_cr ("    install_code   : %3.3f sec", Phase::_t_registerMethod.seconds());
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   154
  tty->print_cr ("    -------------- : ----------");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  double phase_subtotal = Phase::_t_parser.seconds() +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
    Phase::_t_optimizer.seconds() + Phase::_t_graphReshaping.seconds() +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
    Phase::_t_matcher.seconds() + Phase::_t_scheduler.seconds() +
1498
346bf226078e 6743900: frequency based block layout
rasbold
parents: 1
diff changeset
   158
    Phase::_t_registerAllocation.seconds() + Phase::_t_blockOrdering.seconds() +
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
    Phase::_t_codeGeneration.seconds() + Phase::_t_registerMethod.seconds();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  double percent_of_method_compile = ((phase_subtotal == 0.0) ? 0.0 : phase_subtotal / Phase::_t_methodCompilation.seconds()) * 100.0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  // counters inside Compile::CodeGen include time for adapters and stubs
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
  // so phase-total can be greater than 100%
3676
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   163
  tty->print_cr ("    total          : %3.3f sec,  %3.2f %%", phase_subtotal, percent_of_method_compile);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
  assert( percent_of_method_compile > expected_method_compile_coverage ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
          phase_subtotal < minimum_meaningful_method_compile,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
          "Must account for method compilation");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
  if( Phase::_t_temporaryTimer1.seconds() > minimum_reported_time ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
    tty->cr();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
    tty->print_cr ("    temporaryTimer1: %3.3f sec", Phase::_t_temporaryTimer1.seconds());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  if( Phase::_t_temporaryTimer2.seconds() > minimum_reported_time ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
    tty->cr();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
    tty->print_cr ("    temporaryTimer2: %3.3f sec", Phase::_t_temporaryTimer2.seconds());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
  }
3676
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   177
  tty->print_cr ("    output         : %3.3f sec", Phase::_t_output.seconds());
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   178
  tty->print_cr ("      isched         : %3.3f sec", Phase::_t_instrSched.seconds());
3bac3e882cd3 6862956: PhaseIdealLoop should have a CFG verification mode
never
parents: 2131
diff changeset
   179
  tty->print_cr ("      bldOopMaps     : %3.3f sec", Phase::_t_buildOopMaps.seconds());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
#endif