comparison jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java @ 23394:7743f81f8c4a

clean up and minimize JVMCI (JDK-8156835) - part 2
author Doug Simon <doug.simon@oracle.com>
date Fri, 13 May 2016 10:44:29 +0200
parents 215f448ed1d7
children
comparison
equal deleted inserted replaced
23393:1d4ce2d19e52 23394:7743f81f8c4a
21 * questions. 21 * questions.
22 */ 22 */
23 package jdk.vm.ci.code; 23 package jdk.vm.ci.code;
24 24
25 /** 25 /**
26 * Simple class to provide information about the result of a compile request. 26 * Provides information about the result of a {@link CompilationRequest}.
27 */ 27 */
28 public final class CompilationRequestResult { 28 public interface CompilationRequestResult {
29 29
30 /** 30 /**
31 * A user readable description of the failure. 31 * Determines if the compilation was successful.
32 *
33 * @return a non-null object whose {@link Object#toString()} describes the failure or null if
34 * compilation was successful
32 */ 35 */
33 private final String failureMessage; 36 Object getFailure();
34
35 /**
36 * Whether this is a transient failure where retrying would help.
37 */
38 private final boolean retry;
39
40 /**
41 * Number of bytecodes inlined into the compilation, exclusive of the bytecodes in the root
42 * method.
43 */
44 private final int inlinedBytecodes;
45
46 private CompilationRequestResult(String failureMessage, boolean retry, int inlinedBytecodes) {
47 this.failureMessage = failureMessage;
48 this.retry = retry;
49 this.inlinedBytecodes = inlinedBytecodes;
50 }
51
52 public static CompilationRequestResult success(int inlinedBytecodes) {
53 return new CompilationRequestResult(null, true, inlinedBytecodes);
54 }
55
56 public static CompilationRequestResult failure(String failureMessage, boolean retry) {
57 return new CompilationRequestResult(failureMessage, retry, 0);
58 }
59
60 public String getFailureMessage() {
61 return failureMessage;
62 }
63
64 public boolean getRetry() {
65 return retry;
66 }
67
68 public int getInlinedBytecodes() {
69 return inlinedBytecodes;
70 }
71 } 37 }