diff options
author | stenman <stenman@epfl.ch> | 2003-08-20 11:58:49 +0000 |
---|---|---|
committer | stenman <stenman@epfl.ch> | 2003-08-20 11:58:49 +0000 |
commit | 1fd3a2beb28090619beaf675bdbdf1189a5fa312 (patch) | |
tree | ac99c74450072742b3d8656dcd48cce58618f0a5 /sources/scalac/backend | |
parent | 596976749d9304d9aa8abd230ad52e627f7c6bb3 (diff) | |
download | scala-1fd3a2beb28090619beaf675bdbdf1189a5fa312.tar.gz scala-1fd3a2beb28090619beaf675bdbdf1189a5fa312.tar.bz2 scala-1fd3a2beb28090619beaf675bdbdf1189a5fa312.zip |
TailCall optimization for jvm.
Diffstat (limited to 'sources/scalac/backend')
-rw-r--r-- | sources/scalac/backend/jvm/GenJVM.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sources/scalac/backend/jvm/GenJVM.java b/sources/scalac/backend/jvm/GenJVM.java index 153a30ca0b..0b5709a638 100644 --- a/sources/scalac/backend/jvm/GenJVM.java +++ b/sources/scalac/backend/jvm/GenJVM.java @@ -277,6 +277,7 @@ class GenJVM { Pair/*<JLabel, Tree[]>*/ labelAndIdents = (Pair)ctx.labels.get(funSym); assert labelAndIdents != null : Debug.show(funSym); + JMethodType funType = (JMethodType)typeStoJ(funSym.info()); JLabel label = (JLabel)labelAndIdents.fst; Tree[] idents = (Tree[])labelAndIdents.snd; @@ -287,7 +288,7 @@ class GenJVM { for (int i = idents.length; i > 0; --i) genStoreEpilogue(ctx, idents[i-1]); ctx.code.emitGOTO(label); - generatedType = JType.VOID; + generatedType = funType.getReturnType(); } else if (isKnownPrimitive(funSym)) { Primitive prim = prims.getPrimitive(funSym); |