annotate graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTargetLog.java @ 15168:78530cbd8940

Truffle: Make OptimizedCallTarget itself an InstalledCode object.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Wed, 16 Apr 2014 18:57:14 +0200
parents cf49b4e72de5
children 59f71608aa9a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15090
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
1 /*
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
4 *
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
8 *
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
13 * accompanied this code).
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
14 *
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
18 *
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
21 * questions.
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
22 */
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
23 package com.oracle.graal.truffle;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
24
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
25 import static com.oracle.graal.truffle.TruffleCompilerOptions.*;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
26
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
27 import java.io.*;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
28 import java.util.*;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
29
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
30 import com.oracle.graal.debug.*;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
31 import com.oracle.truffle.api.nodes.*;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
32 import com.oracle.truffle.api.nodes.NodeUtil.NodeCountFilter;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
33
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
34 public final class OptimizedCallTargetLog {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
35
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
36 protected static final PrintStream OUT = TTY.out().out();
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
37
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
38 private static Map<OptimizedCallTarget, Integer> callTargets;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
39 static {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
40 if (TruffleCallTargetProfiling.getValue()) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
41 callTargets = new WeakHashMap<>();
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
42
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
43 Runtime.getRuntime().addShutdownHook(new Thread() {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
44
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
45 @Override
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
46 public void run() {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
47 printProfiling();
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
48 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
49 });
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
50 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
51 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
52
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
53 private OptimizedCallTargetLog() {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
54 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
55
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
56 public static void logInliningDecision(TruffleInliningResult result) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
57 if (!TraceTruffleInlining.getValue()) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
58 return;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
59 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
60
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
61 logInliningStart(result.getCallTarget());
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
62 logInliningDecisionRecursive(result, 0);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
63 logInliningDone(result.getCallTarget());
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
64 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
65
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
66 private static void logInliningDecisionRecursive(TruffleInliningResult result, int depth) {
15093
5634b199c4da Truffle: API-change: renamed CallNode to DirectCallNode and added IndirectCallNode.
Christian Humer <christian.humer@gmail.com>
parents: 15090
diff changeset
67 List<OptimizedDirectCallNode> callNodes = searchCallNodes(result.getCallTarget());
5634b199c4da Truffle: API-change: renamed CallNode to DirectCallNode and added IndirectCallNode.
Christian Humer <christian.humer@gmail.com>
parents: 15090
diff changeset
68 for (OptimizedDirectCallNode callNode : callNodes) {
15090
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
69 TruffleInliningProfile profile = result.getProfiles().get(callNode);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
70 boolean inlined = result.isInlined(callNode);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
71 String msg = inlined ? "inline success" : "inline failed";
15094
04703cff4ef2 Truffle: fixed some minor formatting/findbugs problems.
Christian Humer <christian.humer@gmail.com>
parents: 15093
diff changeset
72 logInlinedImpl(msg, callNode, profile, depth);
15090
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
73 if (profile.getRecursiveResult() != null && inlined) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
74 logInliningDecisionRecursive(profile.getRecursiveResult(), depth + 1);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
75 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
76 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
77 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
78
15093
5634b199c4da Truffle: API-change: renamed CallNode to DirectCallNode and added IndirectCallNode.
Christian Humer <christian.humer@gmail.com>
parents: 15090
diff changeset
79 private static List<OptimizedDirectCallNode> searchCallNodes(final OptimizedCallTarget target) {
5634b199c4da Truffle: API-change: renamed CallNode to DirectCallNode and added IndirectCallNode.
Christian Humer <christian.humer@gmail.com>
parents: 15090
diff changeset
80 final List<OptimizedDirectCallNode> callNodes = new ArrayList<>();
15090
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
81 target.getRootNode().accept(new NodeVisitor() {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
82 public boolean visit(Node node) {
15093
5634b199c4da Truffle: API-change: renamed CallNode to DirectCallNode and added IndirectCallNode.
Christian Humer <christian.humer@gmail.com>
parents: 15090
diff changeset
83 if (node instanceof OptimizedDirectCallNode) {
5634b199c4da Truffle: API-change: renamed CallNode to DirectCallNode and added IndirectCallNode.
Christian Humer <christian.humer@gmail.com>
parents: 15090
diff changeset
84 callNodes.add((OptimizedDirectCallNode) node);
15090
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
85 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
86 return true;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
87 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
88 });
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
89 return callNodes;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
90 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
91
15094
04703cff4ef2 Truffle: fixed some minor formatting/findbugs problems.
Christian Humer <christian.humer@gmail.com>
parents: 15093
diff changeset
92 private static void logInlinedImpl(String status, OptimizedDirectCallNode callNode, TruffleInliningProfile profile, int depth) {
15090
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
93 Map<String, Object> properties = new LinkedHashMap<>();
15094
04703cff4ef2 Truffle: fixed some minor formatting/findbugs problems.
Christian Humer <christian.humer@gmail.com>
parents: 15093
diff changeset
94 addASTSizeProperty(callNode.getCurrentCallTarget(), properties);
15090
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
95 if (profile != null) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
96 properties.putAll(profile.getDebugProperties());
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
97 }
15094
04703cff4ef2 Truffle: fixed some minor formatting/findbugs problems.
Christian Humer <christian.humer@gmail.com>
parents: 15093
diff changeset
98 log((depth * 2), status, callNode.getCurrentCallTarget().toString(), properties);
15090
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
99 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
100
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
101 private static void logInliningStart(OptimizedCallTarget target) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
102 if (TraceTruffleInlining.getValue()) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
103 log(0, "inline start", target.toString(), target.getDebugProperties());
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
104 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
105 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
106
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
107 private static void logInliningDone(OptimizedCallTarget target) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
108 if (TraceTruffleInlining.getValue()) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
109 log(0, "inline done", target.toString(), target.getDebugProperties());
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
110 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
111 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
112
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
113 public static void logOptimizingQueued(OptimizedCallTarget target) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
114 if (TraceTruffleCompilationDetails.getValue()) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
115 log(0, "opt queued", target.toString(), target.getDebugProperties());
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
116 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
117 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
118
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
119 public static void logOptimizingUnqueued(OptimizedCallTarget target, Node oldNode, Node newNode, CharSequence reason) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
120 if (TraceTruffleCompilationDetails.getValue()) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
121 Map<String, Object> properties = new LinkedHashMap<>();
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
122 addReplaceProperties(properties, oldNode, newNode);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
123 properties.put("Reason", reason);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
124 log(0, "opt unqueued", target.toString(), properties);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
125 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
126 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
127
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
128 private static void addReplaceProperties(Map<String, Object> properties, Node oldNode, Node newNode) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
129 if (oldNode != null && newNode != null) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
130 properties.put("OldClass", oldNode.getClass().getSimpleName());
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
131 properties.put("NewClass", newNode.getClass().getSimpleName());
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
132 properties.put("Node", newNode);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
133 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
134 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
135
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
136 static void logOptimizingStart(OptimizedCallTarget target) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
137 if (TraceTruffleCompilationDetails.getValue()) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
138 log(0, "opt start", target.toString(), target.getDebugProperties());
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
139 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
140 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
141
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
142 public static void logOptimizedInvalidated(OptimizedCallTarget target, Node oldNode, Node newNode, CharSequence reason) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
143 if (TraceTruffleCompilation.getValue()) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
144 Map<String, Object> properties = new LinkedHashMap<>();
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
145 addReplaceProperties(properties, oldNode, newNode);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
146 properties.put("Reason", reason);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
147 log(0, "opt invalidated", target.toString(), properties);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
148 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
149 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
150
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
151 public static void logOptimizingFailed(OptimizedCallTarget callSite, CharSequence reason) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
152 Map<String, Object> properties = new LinkedHashMap<>();
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
153 properties.put("Reason", reason);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
154 log(0, "opt fail", callSite.toString(), properties);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
155 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
156
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
157 static void logOptimizingDone(OptimizedCallTarget target, Map<String, Object> properties) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
158 if (TraceTruffleCompilationDetails.getValue() || TraceTruffleCompilation.getValue()) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
159 log(0, "opt done", target.toString(), properties);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
160 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
161 if (TraceTruffleCompilationPolymorphism.getValue()) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
162
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
163 target.getRootNode().accept(new NodeVisitor() {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
164 public boolean visit(Node node) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
165 NodeCost kind = node.getCost();
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
166 if (kind == NodeCost.POLYMORPHIC || kind == NodeCost.MEGAMORPHIC) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
167 Map<String, Object> props = new LinkedHashMap<>();
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
168 props.put("simpleName", node.getClass().getSimpleName());
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
169 String msg = kind == NodeCost.MEGAMORPHIC ? "megamorphic" : "polymorphic";
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
170 log(0, msg, node.toString(), props);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
171 }
15093
5634b199c4da Truffle: API-change: renamed CallNode to DirectCallNode and added IndirectCallNode.
Christian Humer <christian.humer@gmail.com>
parents: 15090
diff changeset
172 if (node instanceof DirectCallNode) {
5634b199c4da Truffle: API-change: renamed CallNode to DirectCallNode and added IndirectCallNode.
Christian Humer <christian.humer@gmail.com>
parents: 15090
diff changeset
173 DirectCallNode callNode = (DirectCallNode) node;
15090
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
174 if (callNode.isInliningForced()) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
175 callNode.getCurrentRootNode().accept(this);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
176 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
177 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
178 return true;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
179 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
180 });
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
181
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
182 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
183 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
184
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
185 private static int splitCount = 0;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
186
15093
5634b199c4da Truffle: API-change: renamed CallNode to DirectCallNode and added IndirectCallNode.
Christian Humer <christian.humer@gmail.com>
parents: 15090
diff changeset
187 static void logSplit(OptimizedDirectCallNode callNode, OptimizedCallTarget target, OptimizedCallTarget newTarget) {
15090
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
188 if (TraceTruffleSplitting.getValue()) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
189 Map<String, Object> properties = new LinkedHashMap<>();
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
190 addASTSizeProperty(target, properties);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
191 properties.put("Split#", ++splitCount);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
192 properties.put("Source", callNode.getEncapsulatingSourceSection());
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
193 log(0, "split", newTarget.toString(), properties);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
194 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
195 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
196
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
197 static void addASTSizeProperty(OptimizedCallTarget target, Map<String, Object> properties) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
198 int polymorphicCount = NodeUtil.countNodes(target.getRootNode(), new NodeCountFilter() {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
199 public boolean isCounted(Node node) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
200 return node.getCost() == NodeCost.POLYMORPHIC;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
201 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
202 }, true);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
203
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
204 int megamorphicCount = NodeUtil.countNodes(target.getRootNode(), new NodeCountFilter() {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
205 public boolean isCounted(Node node) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
206 return node.getCost() == NodeCost.MEGAMORPHIC;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
207 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
208 }, true);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
209
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
210 String value = String.format("%4d (%d/%d)", OptimizedCallUtils.countNonTrivialNodes(target, true), polymorphicCount, megamorphicCount);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
211 properties.put("ASTSize", value);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
212 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
213
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
214 static void log(int indent, String msg, String details, Map<String, Object> properties) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
215 StringBuilder sb = new StringBuilder();
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
216 sb.append(String.format("[truffle] %-16s ", msg));
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
217 for (int i = 0; i < indent; i++) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
218 sb.append(' ');
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
219 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
220 sb.append(String.format("%-" + (60 - indent) + "s", details));
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
221 if (properties != null) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
222 for (String property : properties.keySet()) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
223 Object value = properties.get(property);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
224 if (value == null) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
225 continue;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
226 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
227 sb.append('|');
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
228 sb.append(property);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
229
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
230 StringBuilder propertyBuilder = new StringBuilder();
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
231 if (value instanceof Integer) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
232 propertyBuilder.append(String.format("%6d", value));
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
233 } else if (value instanceof Double) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
234 propertyBuilder.append(String.format("%8.2f", value));
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
235 } else {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
236 propertyBuilder.append(value);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
237 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
238
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
239 int length = Math.max(1, 20 - property.length());
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
240 sb.append(String.format(" %" + length + "s ", propertyBuilder.toString()));
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
241 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
242 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
243 OUT.println(sb.toString());
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
244 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
245
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
246 private static void printProfiling() {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
247 List<OptimizedCallTarget> sortedCallTargets = new ArrayList<>(callTargets.keySet());
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
248 Collections.sort(sortedCallTargets, new Comparator<OptimizedCallTarget>() {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
249
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
250 @Override
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
251 public int compare(OptimizedCallTarget o1, OptimizedCallTarget o2) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
252 return o2.callCount - o1.callCount;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
253 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
254 });
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
255
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
256 int totalCallCount = 0;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
257 int totalInlinedCallSiteCount = 0;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
258 int totalNodeCount = 0;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
259 int totalInvalidationCount = 0;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
260
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
261 OUT.println();
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
262 OUT.printf("%-50s | %-10s | %s / %s | %s | %s\n", "Call Target", "Call Count", "Calls Sites Inlined", "Not Inlined", "Node Count", "Inv");
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
263 for (OptimizedCallTarget callTarget : sortedCallTargets) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
264 if (callTarget.callCount == 0) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
265 continue;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
266 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
267
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
268 int nodeCount = OptimizedCallUtils.countNonTrivialNodes(callTarget, true);
15168
78530cbd8940 Truffle: Make OptimizedCallTarget itself an InstalledCode object.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15165
diff changeset
269 String comment = callTarget.isValid() ? "" : " int";
15090
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
270 comment += callTarget.compilationEnabled ? "" : " fail";
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
271 OUT.printf("%-50s | %10d | %15d | %10d | %3d%s\n", callTarget.getRootNode(), callTarget.callCount, nodeCount, nodeCount, callTarget.getCompilationProfile().getInvalidationCount(), comment);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
272
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
273 totalCallCount += callTarget.callCount;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
274 totalInlinedCallSiteCount += nodeCount;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
275 totalNodeCount += nodeCount;
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
276 totalInvalidationCount += callTarget.getCompilationProfile().getInvalidationCount();
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
277 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
278 OUT.printf("%-50s | %10d | %15d | %10d | %3d\n", "Total", totalCallCount, totalInlinedCallSiteCount, totalNodeCount, totalInvalidationCount);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
279 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
280
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
281 public static void registerCallTarget(OptimizedCallTarget callTarget) {
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
282 callTargets.put(callTarget, 0);
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
283 }
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
284
07e7aae05983 Truffle: context sensitive inlining cleanup
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
285 }