summaryrefslogtreecommitdiff
path: root/sources/scalac/symtab/classfile/ConstantPool.java
diff options
context:
space:
mode:
authorMatthias Zenger <mzenger@gmail.com>2003-11-11 13:21:09 +0000
committerMatthias Zenger <mzenger@gmail.com>2003-11-11 13:21:09 +0000
commit2521f5270d8599a6407588cd3ab92143c77bc827 (patch)
tree1c84600ef4c627d56c24f090c6ab3fba3a8f4c76 /sources/scalac/symtab/classfile/ConstantPool.java
parent6a5131fc32787d2d4865918a4fb1e480bfc14f8f (diff)
downloadscala-2521f5270d8599a6407588cd3ab92143c77bc827.tar.gz
scala-2521f5270d8599a6407588cd3ab92143c77bc827.tar.bz2
scala-2521f5270d8599a6407588cd3ab92143c77bc827.zip
Added support for | in algebraic patterns;
Added support for reading ConstantValue attributes;
Diffstat (limited to 'sources/scalac/symtab/classfile/ConstantPool.java')
-rw-r--r--sources/scalac/symtab/classfile/ConstantPool.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/sources/scalac/symtab/classfile/ConstantPool.java b/sources/scalac/symtab/classfile/ConstantPool.java
index 4260b9e6ad..a4113ed9e7 100644
--- a/sources/scalac/symtab/classfile/ConstantPool.java
+++ b/sources/scalac/symtab/classfile/ConstantPool.java
@@ -97,14 +97,11 @@ public class ConstantPool implements ClassfileConstants {
case CONSTANT_UTF8:
poolObj[i] = Name.fromAscii(in.buf, index + 3, in.getChar(index + 1));
break;
-
case CONSTANT_UNICODE:
throw new RuntimeException("can't read unicode strings in classfiles");
-
case CONSTANT_CLASS:
poolObj[i] = classOrType(readExternal(in.getChar(index + 1)));
break;
-
case CONSTANT_FIELDREF: {
//Symbol owner = (Symbol)readPool(in.getChar(index + 1));
//NameAndType nt = (NameAndType)readPool(in.getChar(index + 3));
@@ -112,7 +109,6 @@ public class ConstantPool implements ClassfileConstants {
// .type(sigparser.sigToType(Name.names, nt.sig.index, nt.sig.length()));
throw new RuntimeException("can't read constant_fieldrefs in classfiles");
}
-
case CONSTANT_METHODREF:
case CONSTANT_INTFMETHODREF: {
//Symbol owner = (Symbol)readPool(in.getChar(index + 1));
@@ -121,19 +117,25 @@ public class ConstantPool implements ClassfileConstants {
// .type(sigparser.sigToType(Name.names, nt.sig.index, nt.sig.length()));
throw new RuntimeException("can't read constant_methodrefs in classfiles");
}
-
case CONSTANT_NAMEANDTYPE:
poolObj[i] = new NameAndType((Name)readPool(in.getChar(index + 1)),
readExternal(in.getChar(index + 3)));
break;
-
case CONSTANT_STRING:
+ poolObj[i] = ((Name)readPool(in.getChar(index + 1))).toString();
+ break;
case CONSTANT_INTEGER:
+ poolObj[i] = new Integer(in.getInt(index + 1));
+ break;
case CONSTANT_FLOAT:
+ poolObj[i] = new Float(in.getFloat(index + 1));
+ break;
case CONSTANT_LONG:
+ poolObj[i] = new Long(in.getLong(index + 1));
+ break;
case CONSTANT_DOUBLE:
- throw new RuntimeException("can't read constants in classfiles");
-
+ poolObj[i] = new Double(in.getDouble(index + 1));
+ break;
default:
throw new RuntimeException("bad constant pool tag: " + in.byteAt(index));
}