1 cananian 1.1.2.5 // Frame.java, created Tue Nov 2 2:07:04 1999 by andyb 2 andyb 1.1.2.1 // Copyright (C) 1999 Andrew Berkheimer <andyb@mit.edu> 3 andyb 1.1.2.1 // Licensed under the terms of the GNU GPL; see COPYING for details. 4 andyb 1.1.2.1 package harpoon.Backend.Sparc; 5 andyb 1.1.2.1 6 andyb 1.1.2.1 import harpoon.Analysis.ClassHierarchy; 7 cananian 1.1.2.10 import harpoon.Analysis.CallGraph; 8 kkz 1.1.2.6 import harpoon.Backend.Generic.GCInfo; 9 cananian 1.1.2.9 import harpoon.ClassFile.HCodeFactory; 10 andyb 1.1.2.1 import harpoon.ClassFile.HMethod; 11 cananian 1.1.2.4 import harpoon.ClassFile.Linker; 12 andyb 1.1.2.1 13 andyb 1.1.2.1 /** 14 andyb 1.1.2.2 * <code>Sparc.Frame</code> contains architecture specific info 15 andyb 1.1.2.2 * for the Sparc Backend. 16 andyb 1.1.2.1 * 17 andyb 1.1.2.1 * @author Andrew Berkheimer <andyb@mit.edu> 18 cananian 1.2 * @version $Id: Frame.java,v 1.2 2002/02/25 21:02:37 cananian Exp $ 19 andyb 1.1.2.1 */ 20 andyb 1.1.2.1 public class Frame extends harpoon.Backend.Generic.Frame 21 andyb 1.1.2.1 { 22 andyb 1.1.2.1 private final RegFileInfo regFileInfo; 23 andyb 1.1.2.1 private final InstrBuilder instrBuilder; 24 andyb 1.1.2.1 private final CodeGen codegen; 25 andyb 1.1.2.1 private final harpoon.Backend.Generic.Runtime runtime; 26 andyb 1.1.2.1 private final TempBuilder tempBuilder; 27 cananian 1.1.2.4 private final Linker linker; 28 kkz 1.1.2.6 private GCInfo gcInfo; // should really be final 29 andyb 1.1.2.1 30 cananian 1.1.2.11 public Frame(HMethod main) { 31 andyb 1.1.2.3 super(); 32 cananian 1.1.2.4 linker = main.getDeclaringClass().getLinker(); 33 andyb 1.1.2.3 tempBuilder = new TempBuilder(); 34 andyb 1.1.2.3 regFileInfo = new RegFileInfo(tempBuilder); 35 andyb 1.1.2.3 instrBuilder = new InstrBuilder(regFileInfo, tempBuilder); 36 andyb 1.1.2.3 37 andyb 1.1.2.3 harpoon.Backend.Runtime1.AllocationStrategy as = 38 cananian 1.1.2.8 new harpoon.Backend.Runtime1.MallocAllocationStrategy(this, 39 cananian 1.1.2.8 "malloc"); 40 cananian 1.1.2.11 runtime = new harpoon.Backend.Runtime1.Runtime(this, as, main, false); 41 cananian 1.1.2.8 codegen = new CodeGen(this); 42 kkz 1.1.2.6 } 43 kkz 1.1.2.6 44 cananian 1.1.2.4 public Linker getLinker() { return linker; } 45 andyb 1.1.2.1 46 andyb 1.1.2.1 public boolean pointersAreLong() { return false; } 47 andyb 1.1.2.1 48 andyb 1.1.2.1 public harpoon.Backend.Generic.CodeGen getCodeGen() { 49 andyb 1.1.2.3 return codegen; 50 andyb 1.1.2.1 } 51 andyb 1.1.2.1 52 andyb 1.1.2.1 public harpoon.Backend.Generic.Runtime getRuntime() { 53 andyb 1.1.2.3 return runtime; 54 andyb 1.1.2.1 } 55 andyb 1.1.2.1 56 andyb 1.1.2.1 public harpoon.Backend.Generic.RegFileInfo getRegFileInfo() { 57 andyb 1.1.2.3 return regFileInfo; 58 andyb 1.1.2.1 } 59 andyb 1.1.2.1 60 andyb 1.1.2.1 public harpoon.Backend.Generic.LocationFactory getLocationFactory() { 61 andyb 1.1.2.3 return regFileInfo; 62 andyb 1.1.2.1 } 63 andyb 1.1.2.1 64 andyb 1.1.2.1 public harpoon.Backend.Generic.InstrBuilder getInstrBuilder() { 65 andyb 1.1.2.3 return instrBuilder; 66 andyb 1.1.2.1 } 67 andyb 1.1.2.1 68 andyb 1.1.2.1 public harpoon.Backend.Generic.TempBuilder getTempBuilder() { 69 andyb 1.1.2.3 return tempBuilder; 70 kkz 1.1.2.6 } 71 kkz 1.1.2.6 72 kkz 1.1.2.6 public harpoon.Backend.Generic.GCInfo getGCInfo() { 73 kkz 1.1.2.6 return gcInfo; 74 cananian 1.1.2.9 } 75 cananian 1.1.2.9 public HCodeFactory getCodeFactory(HCodeFactory hcf) { 76 cananian 1.1.2.9 return Code.codeFactory(hcf, this); 77 andyb 1.1.2.1 } 78 cananian 1.2 }