hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java
author roland
Thu, 10 Apr 2014 11:38:12 +0200
changeset 24002 4e6a72032a99
parent 22234 da823d78ad65
child 24673 2ec56802b829
permissions -rw-r--r--
8005079: fix LogCompilation for incremental inlining Summary: report late inlining as part of the rest of the inlining output Reviewed-by: twisti, kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2126
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
     1
/*
22234
da823d78ad65 8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
mikael
parents: 19712
diff changeset
     2
 * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
2126
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
     4
 *
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
     7
 * published by the Free Software Foundation.
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
     8
 *
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    13
 * accompanied this code).
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    14
 *
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2126
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2126
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: 2126
diff changeset
    21
 * questions.
2126
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    22
 *
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    23
 */
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    24
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    25
package com.sun.hotspot.tools.compiler;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    26
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    27
import java.io.PrintStream;
24002
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
    28
import java.util.ArrayDeque;
2126
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    29
import java.util.ArrayList;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    30
import java.util.List;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    31
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    32
public class CallSite {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    33
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    34
    private int bci;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    35
    private Method method;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    36
    private int count;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    37
    private String receiver;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    38
    private int receiver_count;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    39
    private String reason;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    40
    private List<CallSite> calls;
10563
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
    41
    private int endNodes;
14623
70c4c1be0a14 7092905: C2: Keep track of the number of dead nodes
bharadwaj
parents: 10563
diff changeset
    42
    private int endLiveNodes;
10563
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
    43
    private double timeStamp;
24002
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
    44
    private long inlineId;
2126
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    45
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    46
    CallSite() {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    47
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    48
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    49
    CallSite(int bci, Method m) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    50
        this.bci = bci;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    51
        this.method = m;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    52
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    53
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    54
    void add(CallSite site) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    55
        if (getCalls() == null) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    56
            setCalls(new ArrayList<CallSite>());
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    57
        }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    58
        getCalls().add(site);
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    59
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    60
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    61
    CallSite last() {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    62
        return last(-1);
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    63
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    64
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    65
    CallSite last(int fromEnd) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    66
        return getCalls().get(getCalls().size() + fromEnd);
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    67
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    68
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    69
    public String toString() {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    70
        StringBuilder sb = new StringBuilder();
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    71
        if (getReason() == null) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    72
            sb.append("  @ " + getBci() + " " + getMethod());
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    73
        } else {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    74
            sb.append("- @ " + getBci() + " " + getMethod() + " " + getReason());
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    75
        }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    76
        sb.append("\n");
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    77
        if (getCalls() != null) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    78
            for (CallSite site : getCalls()) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    79
                sb.append(site);
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    80
                sb.append("\n");
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    81
            }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    82
        }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    83
        return sb.toString();
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    84
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    85
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    86
    public void print(PrintStream stream) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    87
        print(stream, 0);
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    88
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    89
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    90
    void emit(PrintStream stream, int indent) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    91
        for (int i = 0; i < indent; i++) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    92
            stream.print(' ');
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    93
        }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    94
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    95
    private static boolean compat = true;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    96
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    97
    public void print(PrintStream stream, int indent) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
    98
        emit(stream, indent);
24002
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
    99
        String m = getMethod().getHolder() + "::" + getMethod().getName();
2126
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   100
        if (getReason() == null) {
10563
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   101
            stream.print("  @ " + getBci() + " " + m + " (" + getMethod().getBytes() + " bytes)");
2126
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   102
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   103
        } else {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   104
            if (isCompat()) {
10563
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   105
                stream.print("  @ " + getBci() + " " + m + " " + getReason());
2126
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   106
            } else {
10563
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   107
                stream.print("- @ " + getBci() + " " + m +
2126
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   108
                        " (" + getMethod().getBytes() + " bytes) " + getReason());
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   109
            }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   110
        }
19712
b0bdff06b6fb 8022456: LogCompilation tool does not work with C1 output again
vlivanov
parents: 14623
diff changeset
   111
        stream.printf(" (end time: %6.4f", getTimeStamp());
10563
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   112
        if (getEndNodes() > 0) {
19712
b0bdff06b6fb 8022456: LogCompilation tool does not work with C1 output again
vlivanov
parents: 14623
diff changeset
   113
            stream.printf(" nodes: %d live: %d", getEndNodes(), getEndLiveNodes());
10563
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   114
        }
19712
b0bdff06b6fb 8022456: LogCompilation tool does not work with C1 output again
vlivanov
parents: 14623
diff changeset
   115
        stream.println(")");
b0bdff06b6fb 8022456: LogCompilation tool does not work with C1 output again
vlivanov
parents: 14623
diff changeset
   116
2126
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   117
        if (getReceiver() != null) {
10563
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   118
            emit(stream, indent + 4);
2126
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   119
            //                 stream.println("type profile " + method.holder + " -> " + receiver + " (" +
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   120
            //                                receiver_count + "/" + count + "," + (receiver_count * 100 / count) + "%)");
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   121
            stream.println("type profile " + getMethod().getHolder() + " -> " + getReceiver() + " (" +
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   122
                    (getReceiverCount() * 100 / getCount()) + "%)");
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   123
        }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   124
        if (getCalls() != null) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   125
            for (CallSite site : getCalls()) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   126
                site.print(stream, indent + 2);
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   127
            }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   128
        }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   129
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   130
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   131
    public int getBci() {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   132
        return bci;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   133
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   134
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   135
    public void setBci(int bci) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   136
        this.bci = bci;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   137
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   138
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   139
    public Method getMethod() {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   140
        return method;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   141
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   142
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   143
    public void setMethod(Method method) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   144
        this.method = method;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   145
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   146
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   147
    public int getCount() {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   148
        return count;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   149
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   150
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   151
    public void setCount(int count) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   152
        this.count = count;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   153
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   154
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   155
    public String getReceiver() {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   156
        return receiver;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   157
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   158
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   159
    public void setReceiver(String receiver) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   160
        this.receiver = receiver;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   161
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   162
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   163
    public int getReceiverCount() {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   164
        return receiver_count;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   165
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   166
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   167
    public void setReceiver_count(int receiver_count) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   168
        this.receiver_count = receiver_count;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   169
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   170
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   171
    public String getReason() {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   172
        return reason;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   173
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   174
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   175
    public void setReason(String reason) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   176
        this.reason = reason;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   177
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   178
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   179
    public List<CallSite> getCalls() {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   180
        return calls;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   181
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   182
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   183
    public void setCalls(List<CallSite> calls) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   184
        this.calls = calls;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   185
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   186
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   187
    public static boolean isCompat() {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   188
        return compat;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   189
    }
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   190
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   191
    public static void setCompat(boolean aCompat) {
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   192
        compat = aCompat;
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   193
    }
10563
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   194
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   195
    void setEndNodes(int n) {
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   196
        endNodes = n;
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   197
    }
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   198
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   199
    public int getEndNodes() {
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   200
        return endNodes;
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   201
    }
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   202
14623
70c4c1be0a14 7092905: C2: Keep track of the number of dead nodes
bharadwaj
parents: 10563
diff changeset
   203
    void setEndLiveNodes(int n) {
70c4c1be0a14 7092905: C2: Keep track of the number of dead nodes
bharadwaj
parents: 10563
diff changeset
   204
        endLiveNodes = n;
70c4c1be0a14 7092905: C2: Keep track of the number of dead nodes
bharadwaj
parents: 10563
diff changeset
   205
    }
70c4c1be0a14 7092905: C2: Keep track of the number of dead nodes
bharadwaj
parents: 10563
diff changeset
   206
70c4c1be0a14 7092905: C2: Keep track of the number of dead nodes
bharadwaj
parents: 10563
diff changeset
   207
    public int getEndLiveNodes() {
70c4c1be0a14 7092905: C2: Keep track of the number of dead nodes
bharadwaj
parents: 10563
diff changeset
   208
        return endLiveNodes;
70c4c1be0a14 7092905: C2: Keep track of the number of dead nodes
bharadwaj
parents: 10563
diff changeset
   209
    }
70c4c1be0a14 7092905: C2: Keep track of the number of dead nodes
bharadwaj
parents: 10563
diff changeset
   210
10563
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   211
    void setTimeStamp(double time) {
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   212
        timeStamp = time;
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   213
    }
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   214
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   215
    public double getTimeStamp() {
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   216
        return timeStamp;
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   217
    }
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
   218
24002
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   219
    private boolean matches(CallSite other) {
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   220
        // Every late inline call site has a unique inline id. If the
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   221
        // call site we're looking for has one then use it other rely
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   222
        // on method name and bci.
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   223
        if (other.inlineId != 0) {
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   224
            return inlineId == other.inlineId;
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   225
        }
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   226
        return method.equals(other.method) && bci == other.bci;
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   227
    }
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   228
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   229
    public CallSite findCallSite(ArrayDeque<CallSite> sites) {
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   230
        // Locate a late inline call site. Multiple chains of
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   231
        // identical call sites with the same method name/bci are
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   232
        // possible so we have to try them all until we find the late
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   233
        // inline call site that has a matching inline id.
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   234
        CallSite site = sites.pop();
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   235
        for (CallSite c : calls) {
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   236
            if (c.matches(site)) {
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   237
                if (!sites.isEmpty()) {
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   238
                    CallSite res = c.findCallSite(sites);
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   239
                    if (res != null) {
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   240
                        sites.push(site);
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   241
                        return res;
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   242
                    }
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   243
                } else {
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   244
                    sites.push(site);
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   245
                    return c;
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   246
                }
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   247
            }
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   248
        }
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   249
        sites.push(site);
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   250
        return null;
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   251
    }
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   252
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   253
    public long getInlineId() {
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   254
        return inlineId;
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   255
    }
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   256
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   257
    public void setInlineId(long inlineId) {
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   258
        this.inlineId = inlineId;
4e6a72032a99 8005079: fix LogCompilation for incremental inlining
roland
parents: 22234
diff changeset
   259
    }
2126
f6f30d1677a8 6807963: need tool to make sense of LogCompilaton output
never
parents:
diff changeset
   260
}