Mercurial > hg > graal-compiler
annotate graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseProfilingInfo.java @ 5174:9afe7747f988
added 'javadoc/' to .hgignore
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 29 Mar 2012 13:22:25 +0200 |
parents | dad1ac9dba7d |
children | 4c3d953f8131 |
rev | line source |
---|---|
5105
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
1 /* |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
4 * |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
8 * |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
14 * |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
18 * |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
21 * questions. |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
22 */ |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
23 package com.oracle.max.criutils; |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
24 |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
25 import com.oracle.max.cri.ri.*; |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
26 |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
27 |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
28 /** |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
29 * Dummy profiling information in case that a method was not executed frequently enough so that |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
30 * no profiling information does exist yet, or in case that the profiling information should not be used. |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
31 */ |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
32 public final class BaseProfilingInfo implements RiProfilingInfo { |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
33 private static final RiProfilingInfo[] NO_PROFILING_INFO = new RiProfilingInfo[] { |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
34 new BaseProfilingInfo(RiExceptionSeen.TRUE), |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
35 new BaseProfilingInfo(RiExceptionSeen.FALSE), |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
36 new BaseProfilingInfo(RiExceptionSeen.NOT_SUPPORTED) |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
37 }; |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
38 |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
39 private final RiExceptionSeen exceptionSeen; |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
40 |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
41 BaseProfilingInfo(RiExceptionSeen exceptionSeen) { |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
42 this.exceptionSeen = exceptionSeen; |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
43 } |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
44 |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
45 @Override |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
46 public RiTypeProfile getTypeProfile(int bci) { |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
47 return null; |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
48 } |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
49 |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
50 @Override |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
51 public double getBranchTakenProbability(int bci) { |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
52 return -1; |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
53 } |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
54 |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
55 @Override |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
56 public double[] getSwitchProbabilities(int bci) { |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
57 return null; |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
58 } |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
59 |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
60 @Override |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
61 public RiExceptionSeen getExceptionSeen(int bci) { |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
62 return exceptionSeen; |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
63 } |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
64 |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
65 @Override |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
66 public int getExecutionCount(int bci) { |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
67 return -1; |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
68 } |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
69 |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
70 public static RiProfilingInfo get(RiExceptionSeen exceptionSeen) { |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
71 return NO_PROFILING_INFO[exceptionSeen.ordinal()]; |
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
72 } |
5114
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5105
diff
changeset
|
73 |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5105
diff
changeset
|
74 @Override |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5105
diff
changeset
|
75 public int getDeoptimizationCount(RiDeoptReason reason) { |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5105
diff
changeset
|
76 return 0; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5105
diff
changeset
|
77 } |
5105
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
78 } |