Mercurial > hg > graal-compiler
comparison graal/GraalCompiler/src/com/sun/c1x/target/Backend.java @ 2509:16b9a8b5ad39
Renamings Runtime=>GraalRuntime and Compiler=>GraalCompiler
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 27 Apr 2011 11:50:44 +0200 |
parents | graal/Compiler/src/com/sun/c1x/target/Backend.java@9ec15d6914ca |
children | 0ea5f12e873a |
comparison
equal
deleted
inserted
replaced
2508:fea94949e0a2 | 2509:16b9a8b5ad39 |
---|---|
1 /* | |
2 * Copyright (c) 2009, 2010, 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.c1x.target; | |
24 | |
25 import java.lang.reflect.*; | |
26 | |
27 import com.sun.c1x.*; | |
28 import com.sun.c1x.asm.*; | |
29 import com.sun.c1x.gen.*; | |
30 import com.sun.c1x.globalstub.*; | |
31 import com.sun.c1x.lir.*; | |
32 import com.sun.cri.ci.*; | |
33 import com.sun.cri.ri.*; | |
34 import com.sun.cri.xir.*; | |
35 | |
36 /** | |
37 * The {@code Backend} class represents a compiler backend for C1X. | |
38 * | |
39 * @author Ben L. Titzer | |
40 */ | |
41 public abstract class Backend { | |
42 public final C1XCompiler compiler; | |
43 | |
44 protected Backend(C1XCompiler compiler) { | |
45 this.compiler = compiler; | |
46 } | |
47 | |
48 public static Backend create(CiArchitecture arch, C1XCompiler compiler) { | |
49 String className = arch.getClass().getName() + "Backend"; | |
50 try { | |
51 Class<?> c = Class.forName(className); | |
52 Constructor<?> cons = c.getDeclaredConstructor(C1XCompiler.class); | |
53 return (Backend) cons.newInstance(compiler); | |
54 } catch (Exception e) { | |
55 throw new Error("Could instantiate " + className, e); | |
56 } | |
57 } | |
58 | |
59 public abstract FrameMap newFrameMap(RiMethod method, int numberOfLocks); | |
60 public abstract LIRGenerator newLIRGenerator(C1XCompilation compilation); | |
61 public abstract LIRAssembler newLIRAssembler(C1XCompilation compilation); | |
62 public abstract AbstractAssembler newAssembler(RiRegisterConfig registerConfig); | |
63 public abstract GlobalStubEmitter newGlobalStubEmitter(); | |
64 public abstract CiXirAssembler newXirAssembler(); | |
65 } |