Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java @ 22770:1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Thu, 14 Jan 2016 11:36:05 -0800 |
parents | jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestFailure.java@d88299d598d6 |
children | 6f6220ad4454 |
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 */ |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
23 package jdk.vm.ci.code; |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
24 |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
25 /** |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
26 * Simple class to provide information about the result of a compile request. |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
27 */ |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
28 public final class CompilationRequestResult { |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
29 |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
30 /** |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
31 * A user readable description of the failure. |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
32 */ |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
33 private final String failureMessage; |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
34 |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
35 /** |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
36 * Whether this is a transient failure where retrying would help. |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
37 */ |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
38 private final boolean retry; |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
39 |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
40 /** |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
41 * 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
|
42 * method. |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
43 */ |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
44 private final int inlinedBytecodes; |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
45 |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
46 private CompilationRequestResult(String failureMessage, boolean retry, int inlinedBytecodes) { |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
47 assert retry == (failureMessage != null) : "must be a message if retryable"; |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
48 this.failureMessage = failureMessage; |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
49 this.retry = retry; |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
50 this.inlinedBytecodes = inlinedBytecodes; |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
51 } |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
52 |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
53 public static CompilationRequestResult success(int inlinedBytecodes) { |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
54 return new CompilationRequestResult(null, true, inlinedBytecodes); |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
55 } |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
56 |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
57 public static CompilationRequestResult failure(String failureMessage, boolean retry) { |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
58 return new CompilationRequestResult(failureMessage, retry, 0); |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
59 } |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
60 |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
61 public String getFailureMessgae() { |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
62 return failureMessage; |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
63 } |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
64 |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
65 public boolean getRetry() { |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
66 return retry; |
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
67 } |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
68 |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
69 public int getInlinedBytecodes() { |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
70 return inlinedBytecodes; |
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
71 } |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
72 } |