Mercurial > hg > truffle
comparison graal/com.oracle.graal.asm.test/src/com/oracle/graal/asm/test/AssemblerTest.java @ 11959:23ccaa863eda
made CodeCacheProvider independent of MetaAccessProvider (GRAAL-511)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 10 Oct 2013 16:14:55 +0200 |
parents | 36e12fbbefdf |
children | 9c2111d10e40 |
comparison
equal
deleted
inserted
replaced
11958:a0f5be106e67 | 11959:23ccaa863eda |
---|---|
32 import com.oracle.graal.asm.*; | 32 import com.oracle.graal.asm.*; |
33 import com.oracle.graal.test.*; | 33 import com.oracle.graal.test.*; |
34 | 34 |
35 public abstract class AssemblerTest extends GraalTest { | 35 public abstract class AssemblerTest extends GraalTest { |
36 | 36 |
37 private final MetaAccessProvider metaAccess; | |
37 protected final CodeCacheProvider codeCache; | 38 protected final CodeCacheProvider codeCache; |
38 | 39 |
39 public interface CodeGenTest { | 40 public interface CodeGenTest { |
40 | 41 |
41 Buffer generateCode(CompilationResult compResult, TargetDescription target, RegisterConfig registerConfig, CallingConvention cc); | 42 Buffer generateCode(CompilationResult compResult, TargetDescription target, RegisterConfig registerConfig, CallingConvention cc); |
42 } | 43 } |
43 | 44 |
44 public AssemblerTest() { | 45 public AssemblerTest() { |
46 this.metaAccess = Graal.getRequiredCapability(MetaAccessProvider.class); | |
45 this.codeCache = Graal.getRequiredCapability(CodeCacheProvider.class); | 47 this.codeCache = Graal.getRequiredCapability(CodeCacheProvider.class); |
46 } | 48 } |
47 | 49 |
50 public MetaAccessProvider getMetaAccess() { | |
51 return metaAccess; | |
52 } | |
53 | |
48 protected InstalledCode assembleMethod(Method m, CodeGenTest test) { | 54 protected InstalledCode assembleMethod(Method m, CodeGenTest test) { |
49 ResolvedJavaMethod method = codeCache.lookupJavaMethod(m); | 55 ResolvedJavaMethod method = getMetaAccess().lookupJavaMethod(m); |
50 RegisterConfig registerConfig = codeCache.lookupRegisterConfig(); | 56 RegisterConfig registerConfig = codeCache.lookupRegisterConfig(); |
51 CallingConvention cc = CodeUtil.getCallingConvention(codeCache, CallingConvention.Type.JavaCallee, method, false); | 57 CallingConvention cc = CodeUtil.getCallingConvention(codeCache, CallingConvention.Type.JavaCallee, method, false); |
52 | 58 |
53 CompilationResult compResult = new CompilationResult(); | 59 CompilationResult compResult = new CompilationResult(); |
54 Buffer codeBuffer = test.generateCode(compResult, codeCache.getTarget(), registerConfig, cc); | 60 Buffer codeBuffer = test.generateCode(compResult, codeCache.getTarget(), registerConfig, cc); |