diff options
author | paltherr <paltherr@epfl.ch> | 2004-06-02 15:07:30 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2004-06-02 15:07:30 +0000 |
commit | 06c5b6bf941eed5df16ebf574989375214be2e6f (patch) | |
tree | 16c21ad57dad73b4a0c33c673c8a0bcf4f463a48 | |
parent | e62db728e857ced8d60fdac6c655b89f77ca4f50 (diff) | |
download | scala-06c5b6bf941eed5df16ebf574989375214be2e6f.tar.gz scala-06c5b6bf941eed5df16ebf574989375214be2e6f.tar.bz2 scala-06c5b6bf941eed5df16ebf574989375214be2e6f.zip |
- Removed method GenJVM.maybeGenLoadUnit
-rw-r--r-- | sources/scalac/backend/jvm/GenJVM.java | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/sources/scalac/backend/jvm/GenJVM.java b/sources/scalac/backend/jvm/GenJVM.java index 6ed92f6a1a..63d08f7aa9 100644 --- a/sources/scalac/backend/jvm/GenJVM.java +++ b/sources/scalac/backend/jvm/GenJVM.java @@ -64,8 +64,6 @@ class GenJVM { protected final static String JAVA_RMI_REMOTEEXCEPTION = "java.rmi.RemoteException"; protected final static String SCALA_RUNTIME_RUNTIME = "scala.runtime.RunTime"; - protected final static String SCALA_UNIT = "scala.Unit"; - protected final static String SCALA_UNIT_VALUE = "UNIT_VAL"; protected final static String SCALA_ATTR = ClassfileConstants.SCALA_N.toString(); @@ -82,8 +80,6 @@ class GenJVM { new JObjectType (JAVA_LANG_STRINGBUFFER); protected final JObjectType JAVA_LANG_THROWABLE_T = new JObjectType("java.lang.Throwable"); - protected final JObjectType SCALA_UNIT_T = - new JObjectType(SCALA_UNIT); protected final Symbol JAVA_RMI_REMOTE_CLASS; @@ -506,10 +502,7 @@ class GenJVM { JCode.Label afterLabel = ctx.code.newLabel(); ctx.code.emitGOTO_maybe_W(afterLabel, ctx.useWideJumps); elseLabel.anchorToNext(); - if (elsep == Tree.Empty) - maybeGenLoadUnit(ctx, finalType); - else - genLoad(ctx, elsep, finalType); + genLoad(ctx, elsep, finalType); afterLabel.anchorToNext(); generatedType = finalType; } break; @@ -601,8 +594,7 @@ class GenJVM { protected JType genLoadLiteral(Context ctx, AConstant lit, JType type) { switch (lit) { case UNIT: - maybeGenLoadUnit(ctx, type); - return type; + return JType.VOID; case BOOLEAN(boolean value): ctx.code.emitPUSH(value); return JType.BOOLEAN; @@ -639,17 +631,6 @@ class GenJVM { } /** - * Generate code to load the Unit value, iff the given type is an - * object type (i.e. something really has to be loaded on stack). - */ - protected void maybeGenLoadUnit(Context ctx, JType type) { - if (type != JType.VOID) - ctx.code.emitGETSTATIC(SCALA_RUNTIME_RUNTIME, - SCALA_UNIT_VALUE, - SCALA_UNIT_T); - } - - /** * Generate code to prepare the storage of a value in the location * represented by the tree. */ |