Mercurial > hg > graal-jvmci-8
comparison graal/GraalCompiler/src/com/sun/c1x/target/Backend.java @ 2677:0ea5f12e873a
use com.oracle.max.asm project for assembler
author | Christian.Wimmer@Oracle.com |
---|---|
date | Fri, 13 May 2011 17:09:20 -0700 |
parents | 16b9a8b5ad39 |
children |
comparison
equal
deleted
inserted
replaced
2676:e0e89714e2f1 | 2677:0ea5f12e873a |
---|---|
22 */ | 22 */ |
23 package com.sun.c1x.target; | 23 package com.sun.c1x.target; |
24 | 24 |
25 import java.lang.reflect.*; | 25 import java.lang.reflect.*; |
26 | 26 |
27 import com.oracle.max.asm.*; | |
27 import com.sun.c1x.*; | 28 import com.sun.c1x.*; |
28 import com.sun.c1x.asm.*; | |
29 import com.sun.c1x.gen.*; | 29 import com.sun.c1x.gen.*; |
30 import com.sun.c1x.globalstub.*; | 30 import com.sun.c1x.globalstub.*; |
31 import com.sun.c1x.lir.*; | 31 import com.sun.c1x.lir.*; |
32 import com.sun.cri.ci.*; | 32 import com.sun.cri.ci.*; |
33 import com.sun.cri.ri.*; | 33 import com.sun.cri.ri.*; |
44 protected Backend(C1XCompiler compiler) { | 44 protected Backend(C1XCompiler compiler) { |
45 this.compiler = compiler; | 45 this.compiler = compiler; |
46 } | 46 } |
47 | 47 |
48 public static Backend create(CiArchitecture arch, C1XCompiler compiler) { | 48 public static Backend create(CiArchitecture arch, C1XCompiler compiler) { |
49 String className = arch.getClass().getName() + "Backend"; | 49 String className = arch.getClass().getName().replace("com.oracle.max.asm", "com.sun.c1x") + "Backend"; |
50 try { | 50 try { |
51 Class<?> c = Class.forName(className); | 51 Class<?> c = Class.forName(className); |
52 Constructor<?> cons = c.getDeclaredConstructor(C1XCompiler.class); | 52 Constructor<?> cons = c.getDeclaredConstructor(C1XCompiler.class); |
53 return (Backend) cons.newInstance(compiler); | 53 return (Backend) cons.newInstance(compiler); |
54 } catch (Exception e) { | 54 } catch (Exception e) { |
55 throw new Error("Could instantiate " + className, e); | 55 throw new Error("Could not instantiate " + className, e); |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 public abstract FrameMap newFrameMap(RiMethod method, int numberOfLocks); | 59 public abstract FrameMap newFrameMap(RiMethod method, int numberOfLocks); |
60 public abstract LIRGenerator newLIRGenerator(C1XCompilation compilation); | 60 public abstract LIRGenerator newLIRGenerator(C1XCompilation compilation); |