summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2005-09-28 09:33:06 +0000
committerIulian Dragos <jaguarul@gmail.com>2005-09-28 09:33:06 +0000
commit1b8f5a109ece982b236a5e714f6d21e16ded3a27 (patch)
treeff367bbab973f3a9994cde1b08e1616c4c229cf3 /sources
parent4e800def5b8c85e7ca3c94189d699acaee844e5c (diff)
downloadscala-1b8f5a109ece982b236a5e714f6d21e16ded3a27.tar.gz
scala-1b8f5a109ece982b236a5e714f6d21e16ded3a27.tar.bz2
scala-1b8f5a109ece982b236a5e714f6d21e16ded3a27.zip
Minor bug fixes to properly compile newsources/...
Minor bug fixes to properly compile newsources/scala/Array.scala.
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/tools/nsc/backend/icode/Checkers.scala12
-rw-r--r--sources/scala/tools/nsc/backend/icode/GenICode.scala5
-rw-r--r--sources/scala/tools/nsc/backend/icode/Opcodes.scala4
3 files changed, 13 insertions, 8 deletions
diff --git a/sources/scala/tools/nsc/backend/icode/Checkers.scala b/sources/scala/tools/nsc/backend/icode/Checkers.scala
index 1a1ad103d0..f99b062847 100644
--- a/sources/scala/tools/nsc/backend/icode/Checkers.scala
+++ b/sources/scala/tools/nsc/backend/icode/Checkers.scala
@@ -209,7 +209,7 @@ abstract class Checkers {
log("================");
instr match {
case THIS(clasz) =>
- stack push REFERENCE(clasz);
+ stack push toTypeKind(clasz.tpe);
case CONSTANT(const) =>
stack push toTypeKind(const.tpe);
@@ -389,12 +389,16 @@ abstract class Checkers {
stack.push(ARRAY(elem));
case IS_INSTANCE(tpe) =>
- stack.pop;
+ val ref = stack.pop;
+ checkBool(ref.isReferenceType || ref.isArrayType,
+ "IS_INSTANCE on primitive type: " + ref);
stack.push(BOOL);
case CHECK_CAST(tpe) =>
- stack.pop;
- stack.push(toTypeKind(tpe));
+ val ref = stack.pop;
+ checkBool(ref.isReferenceType || ref.isArrayType,
+ "IS_INSTANCE on primitive type: " + ref);
+ stack.push(tpe);
case SWITCH(tags, labels) =>
checkType(stack.pop, INT);
diff --git a/sources/scala/tools/nsc/backend/icode/GenICode.scala b/sources/scala/tools/nsc/backend/icode/GenICode.scala
index bcf7316c97..a7eb312fd7 100644
--- a/sources/scala/tools/nsc/backend/icode/GenICode.scala
+++ b/sources/scala/tools/nsc/backend/icode/GenICode.scala
@@ -410,10 +410,10 @@ abstract class GenICode extends SubComponent {
val ctx1 = genLoadQualifier(fun, ctx);
if (sym == definitions.Object_isInstanceOf) {
- ctx1.bb.emit(IS_INSTANCE(targs.head.tpe));
+ ctx1.bb.emit(IS_INSTANCE(toTypeKind(targs.head.tpe)));
generatedType = BOOL;
} else if (sym == definitions.Object_asInstanceOf) {
- ctx1.bb.emit(CHECK_CAST(targs.head.tpe));
+ ctx1.bb.emit(CHECK_CAST(toTypeKind(targs.head.tpe)));
generatedType = toTypeKind(targs.head.tpe);
} else
abort("Unexpected type application " + fun + "[sym: " + sym + "]");
@@ -952,6 +952,7 @@ abstract class GenICode extends SubComponent {
case vparams :: Nil =>
for (val p <- vparams)
ctx.method.addParam(p.symbol);
+ ctx.method.params = ctx.method.params.reverse;
case _ =>
abort("Malformed parameter list: " + vparamss);
diff --git a/sources/scala/tools/nsc/backend/icode/Opcodes.scala b/sources/scala/tools/nsc/backend/icode/Opcodes.scala
index c57074799f..1efa4422cf 100644
--- a/sources/scala/tools/nsc/backend/icode/Opcodes.scala
+++ b/sources/scala/tools/nsc/backend/icode/Opcodes.scala
@@ -257,7 +257,7 @@ abstract class Opcodes: ICodes {
* Stack: ...:ref
* ->: ...:result(boolean)
*/
- case class IS_INSTANCE(typ: Type) extends Instruction {
+ case class IS_INSTANCE(typ: TypeKind) extends Instruction {
/** Returns a string representation of this instruction */
override def toString(): String ="IS_INSTANCE "+typ.toString();
@@ -269,7 +269,7 @@ abstract class Opcodes: ICodes {
* Stack: ...:ref(oldtype)
* ->: ...:ref(typ <=: oldtype)
*/
- case class CHECK_CAST(typ: Type) extends Instruction {
+ case class CHECK_CAST(typ: TypeKind) extends Instruction {
/** Returns a string representation of this instruction */
override def toString(): String ="CHECK_CAST "+typ.toString();