harpoon.Analysis.Transactions
Class ArrayCopyImplementer

java.lang.Object
  extended by harpoon.ClassFile.CachingCodeFactory
      extended by harpoon.Analysis.Transactions.ArrayCopyImplementer
All Implemented Interfaces:
HCodeFactory, SerializableCodeFactory, Serializable

public class ArrayCopyImplementer
extends CachingCodeFactory

ArrayCopyImplementer adds a pure-java implementation of the System.arraycopy() method. Our implementation is defined in harpoon.Runtime.ArrayCopy.

Arguably, this class should belong in the harpoon.Analysis.Quads package, but we'll leave it here until someone other than the Transactions transformation needs it.

When we implement better array bounds check elimination in loops, the version implemented here should have performance equivalent (or better than) the native version. Better, we should be able to inline this version and eliminate lots of checks in most cases.

Version:
$Id: ArrayCopyImplementer.java,v 1.5 2003/10/03 19:46:33 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Serialized Form

Field Summary
 
Fields inherited from class harpoon.ClassFile.CachingCodeFactory
parent
 
Constructor Summary
ArrayCopyImplementer(HCodeFactory parent, Linker l)
          Creates a ArrayCopyImplementer.
 
Method Summary
 HCode convert(HMethod m)
          Convert a method to an HCode, caching the result.
 
Methods inherited from class harpoon.ClassFile.CachingCodeFactory
clear, getCodeName, put
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayCopyImplementer

public ArrayCopyImplementer(HCodeFactory parent,
                            Linker l)
Creates a ArrayCopyImplementer.

Method Detail

convert

public HCode convert(HMethod m)
Description copied from class: CachingCodeFactory
Convert a method to an HCode, caching the result. Cached representations of m in parent are cleared when this CachingCodeFactory adds the converted representation of m to its cache.

Specified by:
convert in interface HCodeFactory
Overrides:
convert in class CachingCodeFactory