Mercurial > hg > graal-compiler
comparison graal/com.oracle.max.cri/src/com/sun/cri/ci/CiResult.java @ 3733:e233f5660da4
Added Java files from Maxine project.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sat, 17 Dec 2011 19:59:18 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3732:3e2e8b8abdaf | 3733:e233f5660da4 |
---|---|
1 /* | |
2 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. | |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
20 * or visit www.oracle.com if you need additional information or have any | |
21 * questions. | |
22 */ | |
23 package com.sun.cri.ci; | |
24 | |
25 /** | |
26 * Represents the result of compiling a method. The result can include a target method with machine code and metadata, | |
27 * and/or statistics. If the compiler bailed out due to malformed bytecode, an internal error, or other cause, it will | |
28 * supply the bailout object. | |
29 */ | |
30 public class CiResult { | |
31 private final CiTargetMethod targetMethod; | |
32 private final CiBailout bailout; | |
33 private final CiStatistics stats; | |
34 | |
35 /** | |
36 * Creates a new compilation result. | |
37 * @param targetMethod the method that was produced, if any | |
38 * @param bailout the bailout condition that occurred | |
39 * @param stats statistics about the compilation | |
40 */ | |
41 public CiResult(CiTargetMethod targetMethod, CiBailout bailout, CiStatistics stats) { | |
42 this.targetMethod = targetMethod; | |
43 this.bailout = bailout; | |
44 this.stats = stats; | |
45 } | |
46 | |
47 /** | |
48 * Gets the target method that was produced by this compilation. If no target method was | |
49 * produced, but a bailout occured, then the bailout exception will be thrown at this point. | |
50 * @return the target method produced | |
51 * @throws {@link CiBailout} if a bailout occurred | |
52 */ | |
53 public CiTargetMethod targetMethod() { | |
54 if (bailout != null) { | |
55 throw bailout; | |
56 } | |
57 return targetMethod; | |
58 } | |
59 | |
60 /** | |
61 * Returns the statistics about the compilation that were produced, if any. | |
62 * @return the statistics | |
63 */ | |
64 public CiStatistics statistics() { | |
65 return stats; | |
66 } | |
67 | |
68 /** | |
69 * Returns the bailout condition that occurred for this compilation, if any. | |
70 * @return the bailout | |
71 */ | |
72 public CiBailout bailout() { | |
73 return bailout; | |
74 } | |
75 } |