Mercurial > hg > truffle
annotate graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/JavaMethodProfile.java @ 21610:f555efead2f2
Fix options in makefile
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Fri, 29 May 2015 20:43:55 -0700 |
parents | 48c1ebd24120 |
children |
rev | line source |
---|---|
9760
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
1 /* |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
4 * |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
8 * |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
13 * accompanied this code). |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
14 * |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
18 * |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
21 * questions. |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
22 */ |
21556
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
23 package com.oracle.jvmci.meta; |
9760
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
24 |
21556
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
25 import com.oracle.jvmci.meta.JavaMethodProfile.ProfiledMethod; |
9760
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
26 |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
27 /** |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
28 * This profile object represents the method profile at a specific BCI. The precision of the |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
29 * supplied values may vary, but a runtime that provides this information should be aware that it |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
30 * will be used to guide performance-critical decisions like speculative inlining, etc. |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
31 */ |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
32 public final class JavaMethodProfile extends AbstractJavaProfile<ProfiledMethod, ResolvedJavaMethod> { |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
33 |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
34 public JavaMethodProfile(double notRecordedProbability, ProfiledMethod[] pitems) { |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
35 super(notRecordedProbability, pitems); |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
36 } |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
37 |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
38 public ProfiledMethod[] getMethods() { |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
39 return super.getItems(); |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
40 } |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
41 |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
42 public static class ProfiledMethod extends AbstractProfiledItem<ResolvedJavaMethod> { |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
43 |
13168
533808334e7b
renamed parameters of ProfiledMethod and ProfiledType
Doug Simon <doug.simon@oracle.com>
parents:
9760
diff
changeset
|
44 public ProfiledMethod(ResolvedJavaMethod method, double probability) { |
533808334e7b
renamed parameters of ProfiledMethod and ProfiledType
Doug Simon <doug.simon@oracle.com>
parents:
9760
diff
changeset
|
45 super(method, probability); |
9760
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
46 } |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
47 |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
48 /** |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
49 * Returns the type for this profile entry. |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
50 */ |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
51 public ResolvedJavaMethod getMethod() { |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
52 return getItem(); |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
53 } |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
54 |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
55 @Override |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
56 public String toString() { |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
57 return "{" + item.getName() + ", " + probability + "}"; |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
58 } |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
59 } |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
diff
changeset
|
60 } |