diff options
author | paltherr <paltherr@epfl.ch> | 2004-08-12 10:43:03 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2004-08-12 10:43:03 +0000 |
commit | dea91c4e75061cc29d654913a9dc45b7a5c153d1 (patch) | |
tree | 7f6fb6ea911821290db1573f8a88b6016f3eb9c2 /sources | |
parent | 0c2274120cc7c295e2e907cbd67ffc57fa78217d (diff) | |
download | scala-dea91c4e75061cc29d654913a9dc45b7a5c153d1.tar.gz scala-dea91c4e75061cc29d654913a9dc45b7a5c153d1.tar.bz2 scala-dea91c4e75061cc29d654913a9dc45b7a5c153d1.zip |
- Fixed Pickle and UnPickle to handle correctly...
- Fixed Pickle and UnPickle to handle correctly compound types
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scala/tools/scalap/ScalaAttribute.scala | 1 | ||||
-rw-r--r-- | sources/scalac/symtab/EntryTags.java | 3 | ||||
-rw-r--r-- | sources/scalac/symtab/classfile/Pickle.java | 9 | ||||
-rw-r--r-- | sources/scalac/symtab/classfile/UnPickle.java | 16 |
4 files changed, 24 insertions, 5 deletions
diff --git a/sources/scala/tools/scalap/ScalaAttribute.scala b/sources/scala/tools/scalap/ScalaAttribute.scala index bd7b39c40e..1f165cc53e 100644 --- a/sources/scala/tools/scalap/ScalaAttribute.scala +++ b/sources/scala/tools/scalap/ScalaAttribute.scala @@ -100,6 +100,7 @@ class ScalaAttribute(in: ByteArrayReader) { case REF_TYPE => TypeReference(in.nextNat, in.nextNat, readRefs(end)) case COMPOUND_TYPE => + if (in.nextByte != 0) in.nextNat; CompoundTypeRef(in.nextNat, readRefs(end)) case METHOD_TYPE => MethodTypeRef(in.nextNat, readRefs(end)) diff --git a/sources/scalac/symtab/EntryTags.java b/sources/scalac/symtab/EntryTags.java index 4c6fe9d737..ca6f0bd294 100644 --- a/sources/scalac/symtab/EntryTags.java +++ b/sources/scalac/symtab/EntryTags.java @@ -29,7 +29,8 @@ public interface EntryTags { * | 13 SINGLEtpe len_Nat type_Ref sym_Ref * | 14 CONSTANTtpe len_Nat type_Ref constant_Ref * | 15 TYPEREFtpe len_Nat type_Ref sym_Ref {targ_Ref} - * | 16 COMPOUNDtpe len_Nat classsym_Ref {tpe_Ref} + * | 16 COMPOUNDtpe len_Nat + * iscompoundsym_Byte [owner_Ref] classsym_Ref {tpe_Ref} * | 17 METHODtpe len_Nat tpe_Ref {tpe_Ref} * | 18 POLYTtpe len_Nat tpe_Ref {sym_Ref} * | 19 OVERLOADEDtpe len_Nat {sym_Ref} {tpe_Ref} diff --git a/sources/scalac/symtab/classfile/Pickle.java b/sources/scalac/symtab/classfile/Pickle.java index 17245a7eec..8b64b2e61a 100644 --- a/sources/scalac/symtab/classfile/Pickle.java +++ b/sources/scalac/symtab/classfile/Pickle.java @@ -191,7 +191,9 @@ public class Pickle implements Kinds, Modifiers, EntryTags { putTypes(args); break; case CompoundType(Type[] parents, Scope members): - putSymbol(tp.symbol()); + Symbol clazz = tp.symbol(); + if (clazz.isCompoundSym()) putSymbol(clazz.owner()); + putSymbol(clazz); putTypes(parents); break; case MethodType(Symbol[] vparams, Type result): @@ -437,7 +439,10 @@ public class Pickle implements Kinds, Modifiers, EntryTags { case CompoundType(Type[] parents, Scope members): writeByte(COMPOUNDtpe); writeByte(0); // space for length - writeRef(tp.symbol()); + Symbol clazz = tp.symbol(); + writeByte(clazz.isCompoundSym() ? 1 : 0); + if (clazz.isCompoundSym()) writeRef(clazz.owner()); + writeRef(clazz); writeRefs(parents); break; diff --git a/sources/scalac/symtab/classfile/UnPickle.java b/sources/scalac/symtab/classfile/UnPickle.java index aa88139ad2..f3a715b480 100644 --- a/sources/scalac/symtab/classfile/UnPickle.java +++ b/sources/scalac/symtab/classfile/UnPickle.java @@ -399,9 +399,21 @@ public class UnPickle implements Kinds, Modifiers, EntryTags, TypeTags { readTypeRef(owner), readSymbolRef(), readTypeRefs(end, owner)); break; case COMPOUNDtpe: - Symbol clazz = readSymbolRef(); + boolean isCompoundSym = readByte() != 0; + Symbol ctOwner = isCompoundSym + ? readSymbolRef() + : null; + int ctClassRef = readNat(); + Symbol ctClass = isCompoundSym + ? (Symbol)entries[ctClassRef] + : getSymbol(ctClassRef); Type[] parents = readTypeRefs(end, owner); - tpe = Type.compoundType(parents, new Scope(), clazz); + if (ctClass == null) { + tpe = Type.compoundTypeWithOwner(ctOwner, parents, new Scope()); + entries[ctClassRef] = tpe.symbol(); + } else { + tpe = Type.compoundType(parents, new Scope(), ctClass); + } break; case METHODtpe: Type restype = readTypeRef(owner); |