1 pnkfelix 1.1.2.9 // IgnoreSpillUseDefer.java, created Fri Jun 30 19:14:06 2000 by pnkfelix
 2 cananian 1.1.2.8 // Copyright (C) 2000 Felix S. Klock II <pnkfelix@mit.edu>
 3 pnkfelix 1.1.2.1 // Licensed under the terms of the GNU GPL; see COPYING for details.
 4 pnkfelix 1.1.2.1 package harpoon.Analysis.Instr;
 5 pnkfelix 1.1.2.1 
 6 cananian 1.1.2.7 import harpoon.IR.Properties.UseDefable;
 7 pnkfelix 1.1.2.2 import harpoon.IR.Properties.UseDefer;
 8 pnkfelix 1.1.2.2 import harpoon.ClassFile.HCodeElement;
 9 pnkfelix 1.1.2.2 import java.util.Collection;
10 pnkfelix 1.1.2.3 import java.util.Collections;
11 pnkfelix 1.1.2.2 
12 pnkfelix 1.1.2.1 /**
13 pnkfelix 1.1.2.9  * <code>IgnoreSpillUseDefer</code> defines a view of the code that
14 pnkfelix 1.1.2.9  * will skip over newly inserted spill instructions when deciding what
15 pnkfelix 1.1.2.9  * <code>Temp</code>s instructions read and write.  This is useful for
16 pnkfelix 1.1.2.9  * the garbage collection analyses which need to know what Temps are
17 pnkfelix 1.1.2.9  * live in terms of the program itself, ignoring memory
18 pnkfelix 1.1.2.9  * communication due to spill code. 
19 pnkfelix 1.1.2.9  * <p>
20 pnkfelix 1.1.2.9  * For example, a SpillLoad from the stack location for <tt>t0</tt> to
21 pnkfelix 1.1.2.9  * <tt>r3</tt> is no longer considered a definition of <tt>t0</tt> by
22 pnkfelix 1.1.2.9  * this <code>UseDefer</code>.
23 pnkfelix 1.1.2.9  *
24 pnkfelix 1.1.2.9  * <p> This class may need to be updated to take a
25 pnkfelix 1.1.2.9  * <code>UseDefer</code> parameter, rather than relying on the
26 pnkfelix 1.1.2.9  * underlying IR implementing the <code>UseDefable</code> interface. 
27 pnkfelix 1.1.2.9  *
28 cananian 1.1.2.8  * @author  Felix S. Klock II <pnkfelix@mit.edu>
29 cananian 1.2      * @version $Id: IgnoreSpillUseDefer.java,v 1.2 2002/02/25 20:57:30 cananian Exp $
30 pnkfelix 1.1.2.1  */
31 pnkfelix 1.1.2.1 public class IgnoreSpillUseDefer extends UseDefer {
32 pnkfelix 1.1.2.4 
33 pnkfelix 1.1.2.4     public static IgnoreSpillUseDefer USEDEFER = 
34 pnkfelix 1.1.2.4         new IgnoreSpillUseDefer();
35 pnkfelix 1.1.2.1     
36 pnkfelix 1.1.2.1     /** Creates a <code>IgnoreSpillUDr</code>. */
37 pnkfelix 1.1.2.1     public IgnoreSpillUseDefer() {
38 pnkfelix 1.1.2.1         
39 pnkfelix 1.1.2.1     }
40 pnkfelix 1.1.2.1     
41 pnkfelix 1.1.2.1     public Collection useC(HCodeElement hce) {
42 pnkfelix 1.1.2.6         if (hce instanceof RegAlloc.SpillStore)
43 pnkfelix 1.1.2.3             return Collections.EMPTY_SET;
44 pnkfelix 1.1.2.1         else 
45 cananian 1.1.2.7             return ((UseDefable)hce).useC();
46 pnkfelix 1.1.2.1     }
47 pnkfelix 1.1.2.1 
48 pnkfelix 1.1.2.1     public Collection defC(HCodeElement hce) {
49 pnkfelix 1.1.2.6         if (hce instanceof RegAlloc.SpillLoad)
50 pnkfelix 1.1.2.3             return Collections.EMPTY_SET;
51 pnkfelix 1.1.2.3         else
52 cananian 1.1.2.7             return ((UseDefable)hce).defC();
53 pnkfelix 1.1.2.1     }
54 cananian 1.2     }