Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequestResult.java @ 23703:9ac04c6047c8
sync with jdk9 changes for JDK-8159613
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 21 Jun 2016 09:48:02 +0200 |
parents | 7743f81f8c4a |
children |
rev | line source |
---|---|
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
1 /* |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
4 * |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
8 * |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
14 * |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
18 * |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
21 * questions. |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
22 */ |
23394
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
23 package jdk.vm.ci.hotspot; |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
24 |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
25 import jdk.vm.ci.code.CompilationRequest; |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
26 import jdk.vm.ci.code.CompilationRequestResult; |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
27 |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
28 /** |
23394
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
29 * HotSpot specific information about the result of a {@link CompilationRequest}. |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
30 */ |
23394
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
31 public final class HotSpotCompilationRequestResult implements CompilationRequestResult { |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
32 |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
33 /** |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
34 * A user readable description of the failure. |
23394
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
35 * |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
36 * This field is read by the VM. |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
37 */ |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
38 private final String failureMessage; |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
39 |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
40 /** |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
41 * Whether this is a transient failure where retrying would help. |
23394
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
42 * |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
43 * This field is read by the VM. |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
44 */ |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
45 private final boolean retry; |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
46 |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
47 /** |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
48 * Number of bytecodes inlined into the compilation, exclusive of the bytecodes in the root |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
49 * method. |
23394
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
50 * |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
51 * This field is read by the VM. |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
52 */ |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
53 private final int inlinedBytecodes; |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
54 |
23394
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
55 private HotSpotCompilationRequestResult(String failureMessage, boolean retry, int inlinedBytecodes) { |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
56 this.failureMessage = failureMessage; |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
57 this.retry = retry; |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
58 this.inlinedBytecodes = inlinedBytecodes; |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
59 } |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
60 |
23394
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
61 public Object getFailure() { |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
62 return failureMessage; |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
63 } |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
64 |
23394
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
65 /** |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
66 * Creates a result representing a successful compilation. |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
67 * |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
68 * @param inlinedBytecodes number of bytecodes inlined into the compilation, exclusive of the |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
69 * bytecodes in the root method |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
70 */ |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
71 public static HotSpotCompilationRequestResult success(int inlinedBytecodes) { |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
72 return new HotSpotCompilationRequestResult(null, true, inlinedBytecodes); |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
73 } |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
74 |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
75 /** |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
76 * Creates a result representing a failed compilation. |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
77 * |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
78 * @param failureMessage a description of the failure |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
79 * @param retry whether this is a transient failure where retrying may succeed |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
80 */ |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
81 public static HotSpotCompilationRequestResult failure(String failureMessage, boolean retry) { |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
22778
diff
changeset
|
82 return new HotSpotCompilationRequestResult(failureMessage, retry, 0); |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
83 } |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
84 |
22778
215f448ed1d7
Fixed spelling of getFailureMessage
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22774
diff
changeset
|
85 public String getFailureMessage() { |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
86 return failureMessage; |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
87 } |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
88 |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
89 public boolean getRetry() { |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
90 return retry; |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
91 } |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
92 |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
93 public int getInlinedBytecodes() { |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
94 return inlinedBytecodes; |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
95 } |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
96 } |