Mercurial > hg > graal-compiler
comparison graal/com.oracle.max.cri/src/com/sun/cri/xir/RiXirGenerator.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.xir; | |
24 | |
25 import java.util.*; | |
26 | |
27 import com.sun.cri.ci.*; | |
28 import com.sun.cri.ri.*; | |
29 import com.sun.cri.ri.RiType.*; | |
30 | |
31 /** | |
32 * Represents the interface through which the compiler requests the XIR for a given bytecode from the runtime system. | |
33 */ | |
34 public interface RiXirGenerator { | |
35 | |
36 /** | |
37 * Note: may return {@code null}. | |
38 */ | |
39 XirSnippet genPrologue(XirSite site, RiResolvedMethod method); | |
40 | |
41 /** | |
42 * Note: may return {@code null} in which case the compiler will not emit a return instruction. | |
43 */ | |
44 XirSnippet genEpilogue(XirSite site, RiResolvedMethod method); | |
45 | |
46 XirSnippet genSafepointPoll(XirSite site); | |
47 | |
48 XirSnippet genExceptionObject(XirSite site); | |
49 | |
50 XirSnippet genResolveClass(XirSite site, RiType type, Representation representation); | |
51 | |
52 XirSnippet genIntrinsic(XirSite site, XirArgument[] arguments, RiMethod method); | |
53 | |
54 XirSnippet genInvokeInterface(XirSite site, XirArgument receiver, RiMethod method); | |
55 | |
56 XirSnippet genInvokeVirtual(XirSite site, XirArgument receiver, RiMethod method); | |
57 | |
58 XirSnippet genInvokeSpecial(XirSite site, XirArgument receiver, RiMethod method); | |
59 | |
60 XirSnippet genInvokeStatic(XirSite site, RiMethod method); | |
61 | |
62 XirSnippet genMonitorEnter(XirSite site, XirArgument receiver, XirArgument lockAddress); | |
63 | |
64 XirSnippet genMonitorExit(XirSite site, XirArgument receiver, XirArgument lockAddress); | |
65 | |
66 XirSnippet genGetField(XirSite site, XirArgument receiver, RiField field); | |
67 | |
68 XirSnippet genPutField(XirSite site, XirArgument receiver, RiField field, XirArgument value); | |
69 | |
70 XirSnippet genGetStatic(XirSite site, XirArgument staticTuple, RiField field); | |
71 | |
72 XirSnippet genPutStatic(XirSite site, XirArgument staticTuple, RiField field, XirArgument value); | |
73 | |
74 XirSnippet genNewInstance(XirSite site, RiType type); | |
75 | |
76 XirSnippet genNewArray(XirSite site, XirArgument length, CiKind elementKind, RiType componentType, RiType arrayType); | |
77 | |
78 XirSnippet genNewObjectArrayClone(XirSite site, XirArgument newLength, XirArgument referenceArray); | |
79 | |
80 XirSnippet genNewMultiArray(XirSite site, XirArgument[] lengths, RiType type); | |
81 | |
82 XirSnippet genCheckCast(XirSite site, XirArgument receiver, XirArgument hub, RiType type); | |
83 | |
84 XirSnippet genInstanceOf(XirSite site, XirArgument receiver, XirArgument hub, RiType type); | |
85 | |
86 XirSnippet genMaterializeInstanceOf(XirSite site, XirArgument receiver, XirArgument hub, XirArgument trueValue, XirArgument falseValue, RiType type); | |
87 | |
88 XirSnippet genArrayLoad(XirSite site, XirArgument array, XirArgument index, CiKind elementKind, RiType elementType); | |
89 | |
90 XirSnippet genArrayStore(XirSite site, XirArgument array, XirArgument index, XirArgument value, CiKind elementKind, RiType elementType); | |
91 | |
92 XirSnippet genArrayLength(XirSite site, XirArgument array); | |
93 | |
94 XirSnippet genWriteBarrier(XirArgument object); | |
95 | |
96 XirSnippet genArrayCopy(XirSite site, XirArgument src, XirArgument srcPos, XirArgument dest, XirArgument destPos, XirArgument length, RiType elementType, boolean inputsSame, boolean inputsDifferent); | |
97 | |
98 XirSnippet genCurrentThread(XirSite site); | |
99 | |
100 XirSnippet genGetClass(XirSite site, XirArgument xirArgument); | |
101 | |
102 /** | |
103 * Generates code that checks that the {@linkplain Representation#ObjectHub hub} of | |
104 * an object is identical to a given hub constant. In pseudo code: | |
105 * <pre> | |
106 * if (object.getHub() != hub) { | |
107 * uncommonTrap(); | |
108 * } | |
109 * </pre> | |
110 * This snippet should only be used when the object is guaranteed not to be null. | |
111 */ | |
112 XirSnippet genTypeCheck(XirSite site, XirArgument object, XirArgument hub, RiType type); | |
113 | |
114 /** | |
115 * Gets the list of XIR templates, using the given XIR assembler to create them if | |
116 * they haven't yet been created. | |
117 * | |
118 * @param asm the XIR assembler | |
119 * @return the list of templates | |
120 */ | |
121 List<XirTemplate> makeTemplates(CiXirAssembler asm); | |
122 | |
123 } |