diff graal/GraalCompiler/src/com/sun/c1x/C1XCompilation.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 bcd20d26d52d
children 785e9ecdcc69 7ed72769d51a
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/C1XCompilation.java	Fri May 13 14:03:03 2011 -0700
+++ b/graal/GraalCompiler/src/com/sun/c1x/C1XCompilation.java	Fri May 13 17:09:20 2011 -0700
@@ -25,6 +25,7 @@
 
 import java.util.*;
 
+import com.oracle.max.asm.*;
 import com.oracle.graal.graph.*;
 import com.sun.c1x.alloc.*;
 import com.sun.c1x.asm.*;
@@ -41,8 +42,6 @@
 /**
  * This class encapsulates global information about the compilation of a particular method,
  * including a reference to the runtime, statistics about the compiled code, etc.
- *
- * @author Ben L. Titzer
  */
 public final class C1XCompilation {
 
@@ -71,7 +70,7 @@
     private int nextID = 1;
 
     private FrameMap frameMap;
-    private AbstractAssembler assembler;
+    private TargetMethodAssembler assembler;
 
     private IR hir;
 
@@ -187,9 +186,10 @@
         return frameMap;
     }
 
-    public AbstractAssembler masm() {
+    public TargetMethodAssembler assembler() {
         if (assembler == null) {
-            assembler = compiler.backend.newAssembler(registerConfig);
+            AbstractAssembler asm = compiler.backend.newAssembler(registerConfig);
+            assembler = new TargetMethodAssembler(asm);
             assembler.setFrameSize(frameMap.frameSize());
             assembler.targetMethod.setCustomStackAreaOffset(frameMap.offsetToCustomArea());
         }
@@ -280,7 +280,7 @@
             // generate traps at the end of the method
             lirAssembler.emitTraps();
 
-            CiTargetMethod targetMethod = masm().finishTargetMethod(method, runtime, lirAssembler.registerRestoreEpilogueOffset, false);
+            CiTargetMethod targetMethod = assembler().finishTargetMethod(method, runtime, lirAssembler.registerRestoreEpilogueOffset, false);
             if (assumptions.count() > 0) {
                 targetMethod.setAssumptions(assumptions);
             }