Mercurial > hg > graal-compiler
annotate graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/DeoptimizationAction.java @ 21623:d2113f5ae550
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sun, 31 May 2015 23:58:09 +0200 |
parents | 48c1ebd24120 |
children |
rev | line source |
---|---|
5109
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
1 /* |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
4 * |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
8 * |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
14 * |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
18 * |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
21 * questions. |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
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:
11839
diff
changeset
|
23 package com.oracle.jvmci.meta; |
5109
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
24 |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
25 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7261
diff
changeset
|
26 * Specifies the action that should be taken by the runtime in case a certain deoptimization is |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7261
diff
changeset
|
27 * triggered. |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
28 */ |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
29 public enum DeoptimizationAction { |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
30 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7261
diff
changeset
|
31 * Do not invalidate the machine code. This is typically used when deoptimizing at a point where |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7261
diff
changeset
|
32 * it's highly likely nothing will change the likelihood of the deoptimization happening again. |
7261
a990b07c399d
added more documentation to DeoptimizationAction
Doug Simon <doug.simon@oracle.com>
parents:
6329
diff
changeset
|
33 * For example, a compiled array allocation where the size is negative. |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
34 */ |
9930
5a4fbe932ab3
Assume that those path which end in a DeoptimizeNode are taken less frequently.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
35 None(false), |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
36 |
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
37 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7261
diff
changeset
|
38 * Do not invalidate the machine code, but schedule a recompilation if this deoptimization is |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7261
diff
changeset
|
39 * triggered too often. |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
40 */ |
9930
5a4fbe932ab3
Assume that those path which end in a DeoptimizeNode are taken less frequently.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
41 RecompileIfTooManyDeopts(true), |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
42 |
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
43 /** |
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
44 * Invalidate the machine code and reset the profiling information. |
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
45 */ |
9930
5a4fbe932ab3
Assume that those path which end in a DeoptimizeNode are taken less frequently.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
46 InvalidateReprofile(true), |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
47 |
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
48 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7261
diff
changeset
|
49 * Invalidate the machine code and immediately schedule a recompilation. This is typically used |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7261
diff
changeset
|
50 * when deoptimizing to resolve an unresolved symbol in which case extra profiling is not |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7261
diff
changeset
|
51 * required to determine that the deoptimization will not re-occur. |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
52 */ |
9930
5a4fbe932ab3
Assume that those path which end in a DeoptimizeNode are taken less frequently.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
53 InvalidateRecompile(true), |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
54 |
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
55 /** |
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
56 * Invalidate the machine code and stop compiling the outermost method of this compilation. |
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
57 */ |
9930
5a4fbe932ab3
Assume that those path which end in a DeoptimizeNode are taken less frequently.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
58 InvalidateStopCompiling(true); |
5a4fbe932ab3
Assume that those path which end in a DeoptimizeNode are taken less frequently.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
59 |
5a4fbe932ab3
Assume that those path which end in a DeoptimizeNode are taken less frequently.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
60 private final boolean invalidatesCompilation; |
5a4fbe932ab3
Assume that those path which end in a DeoptimizeNode are taken less frequently.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
61 |
5a4fbe932ab3
Assume that those path which end in a DeoptimizeNode are taken less frequently.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
62 private DeoptimizationAction(boolean invalidatesCompilation) { |
5a4fbe932ab3
Assume that those path which end in a DeoptimizeNode are taken less frequently.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
63 this.invalidatesCompilation = invalidatesCompilation; |
5a4fbe932ab3
Assume that those path which end in a DeoptimizeNode are taken less frequently.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
64 } |
5a4fbe932ab3
Assume that those path which end in a DeoptimizeNode are taken less frequently.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
65 |
5a4fbe932ab3
Assume that those path which end in a DeoptimizeNode are taken less frequently.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
66 public boolean doesInvalidateCompilation() { |
5a4fbe932ab3
Assume that those path which end in a DeoptimizeNode are taken less frequently.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
67 return invalidatesCompilation; |
5a4fbe932ab3
Assume that those path which end in a DeoptimizeNode are taken less frequently.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
68 } |
5a4fbe932ab3
Assume that those path which end in a DeoptimizeNode are taken less frequently.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
69 |
5109
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
70 } |