diff options
author | stenman <stenman@epfl.ch> | 2003-08-20 11:58:50 +0000 |
---|---|---|
committer | stenman <stenman@epfl.ch> | 2003-08-20 11:58:50 +0000 |
commit | 16f68967338653d3d8f925b854f054526b10ddd8 (patch) | |
tree | 3c9024bc4bded2d7c2005a39ab4f1d29f7133e57 /sources | |
parent | 1fd3a2beb28090619beaf675bdbdf1189a5fa312 (diff) | |
download | scala-16f68967338653d3d8f925b854f054526b10ddd8.tar.gz scala-16f68967338653d3d8f925b854f054526b10ddd8.tar.bz2 scala-16f68967338653d3d8f925b854f054526b10ddd8.zip |
TailCall optimization for jvm.
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scalac/transformer/TailCallPhase.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/sources/scalac/transformer/TailCallPhase.java b/sources/scalac/transformer/TailCallPhase.java new file mode 100644 index 0000000000..487f40743b --- /dev/null +++ b/sources/scalac/transformer/TailCallPhase.java @@ -0,0 +1,36 @@ +/* ____ ____ ____ ____ ______ *\ +** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala ** +** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL ** +** /_____/\____/\___/\____/____/ ** +\* */ + +// $Id$ + +package scalac.transformer; + +import scalac.Global; +import scalac.Phase; +import scalac.PhaseDescriptor; +import scalac.Unit; + +public class TailCallPhase extends Phase { + + //######################################################################## + // Public Constructors + + /** Initializes this instance. */ + public TailCallPhase(Global global, PhaseDescriptor descriptor) { + super(global, descriptor); + } + + //######################################################################## + // Public Methods + + /** Applies this phase to the given compilation units. */ + public void apply(Unit[] units) { + for (int i = 0; i < units.length; i++) + new TailCall(global, descriptor).apply(units[i]); + } + + +} |