Skip to content

Commit

Permalink
WIP on invalid specialize flag pickling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandar Prokopec committed Jul 5, 2012
1 parent 171a1d8 commit 514925c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ abstract class Pickler extends SubComponent {

putChildren(sym, children.toList sortBy (_.sealedSortName))
}
if (sym.isTypeParameter && sym.hasAnnotation(definitions.SpecializedClass)) sym.setFlag(SPECIALIZED)
for (annot <- (sym.annotations filter (ann => ann.isStatic && !ann.isErroneous)).reverse)
putAnnotation(sym, annot)
}
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
overloads(specMember) ::= Overload(om, typeEnv(om))
enterMember(om)
}

for (m <- normMembers ; if needsSpecialization(outerEnv ++ env, m) && satisfiable(fullEnv)) {
if (!m.isDeferred)
addConcreteSpecMethod(m)
Expand Down Expand Up @@ -1573,7 +1573,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
}

case fwd @ Forward(_) =>
debuglog("forward: " + fwd + ", " + ddef)
debuglog("forward: " + fwd + ", " + ddef + ", " + tree.symbol.owner)
val rhs1 = forwardCall(tree.pos, gen.mkAttributedRef(symbol.owner.thisType, fwd.target), vparamss)
debuglog("-->d completed forwarder to specialized overload: " + fwd.target + ": " + rhs1)
reportError {
Expand Down
8 changes: 4 additions & 4 deletions src/compiler/scala/tools/nsc/transform/UnCurry.scala
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,10 @@ abstract class UnCurry extends InfoTransform
val sym = tree.symbol
// Take a pass looking for @specialize annotations and set all
// their SPECIALIZE flags for cheaper recognition.
if ((sym ne null) && (sym.isClass || sym.isMethod)) {
for (tp <- sym.typeParams ; if tp hasAnnotation SpecializedClass)
tp setFlag SPECIALIZED
}
// if ((sym ne null) && (sym.isClass || sym.isMethod)) {
// for (tp <- sym.typeParams ; if tp hasAnnotation SpecializedClass)
// tp setFlag SPECIALIZED
// }
val result = (
// TODO - settings.noassertions.value temporarily retained to avoid
// breakage until a reasonable interface is settled upon.
Expand Down
4 changes: 3 additions & 1 deletion src/reflect/scala/reflect/internal/pickling/UnPickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,9 @@ abstract class UnPickler /*extends reflect.generic.UnPickler*/ {
errorBadSignature("symbol annotation expected ("+ tag +")")
val end = readNat() + readIndex
val target = readSymbolRef()
target.addAnnotation(readAnnotationInfo(end))
val annot = readAnnotationInfo(end)
target.addAnnotation(annot)
if (target.hasAnnotation(definitions.SpecializedClass)) target.setFlag(SPECIALIZED)
}

/** Read an annotation and return it. Used when unpickling
Expand Down

0 comments on commit 514925c

Please sign in to comment.