| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Scala
Revision: 16026
Author: dragos
Date: 04 Sep 2008 13:41:10
Diff at Trac: https://lampsvn.epfl.ch/trac/scala/changeset/16026
Changes:Fixed #1249.
Files:| ... | ...@@ -36,6 +36,7 @@ | |
| 36 | 36 | protected var staticDefs: Scope = _ // the scope of all static definitions |
| 37 | 37 | protected var pool: ConstantPool = _ // the classfile's constant pool |
| 38 | 38 | protected var isScala: Boolean = _ // does class file describe a scala class? |
| 39 | protected var isScalaRaw: Boolean = _ // this class file is a scala class with no pickled info | |
| 39 | 40 | protected var hasMeta: Boolean = _ // does class file contain jaco meta attribute?s |
| 40 | 41 | protected var busy: Boolean = false // lock to detect recursive reads |
| 41 | 42 | private var externalName: Name = _ // JVM name of the current class |
| ... | ...@@ -354,7 +355,7 @@ | |
| 354 | 355 | var nameIdx = in.nextChar |
| 355 | 356 | externalName = pool.getClassName(nameIdx) |
| 356 | 357 | val c = pool.getClassSymbol(nameIdx) |
| 357 | if (c != clazz && c.nameString.indexOf("$") < 0) { | |
| 358 | if (c != clazz && externalName.toString.indexOf("$") < 0) { | |
| 358 | 359 | if ((clazz eq NoSymbol) && (c ne NoSymbol)) { // XXX: needed for build compiler, so can't protect with inIDE |
| 359 | 360 | clazz = c |
| 360 | 361 | } else if (inIDE) { |
| ... | ...@@ -479,7 +480,7 @@ | |
| 479 | 480 | assert(restpe.typeSymbol == definitions.UnitClass) |
| 480 | 481 | // if this is a non-static inner class, remove the explicit outer parameter |
| 481 | 482 | val newFormals = innerClasses.get(externalName) match { |
| 482 | case Some(entry) if (entry.jflags & JAVA_ACC_STATIC) == 0 => | |
| 483 | case Some(entry) if !isScalaRaw && (entry.jflags & JAVA_ACC_STATIC) == 0 => | |
| 483 | 484 | assert(formals.head.typeSymbol == clazz.owner, formals.head.typeSymbol + ": " + clazz.owner) |
| 484 | 485 | formals.tail |
| 485 | 486 | case _ => |
| ... | ...@@ -686,7 +687,7 @@ | |
| 686 | 687 | val attrLen = in.nextInt |
| 687 | 688 | attrName match { |
| 688 | 689 | case nme.SignatureATTR => |
| 689 | if (!isScala && global.settings.target.value == "jvm-1.5") { | |
| 690 | if (!isScala && !isScalaRaw && global.settings.target.value == "jvm-1.5") { | |
| 690 | 691 | val sig = pool.getExternalName(in.nextChar) |
| 691 | 692 | val newType = sigToType(sym, sig) |
| 692 | 693 | sym.setInfo(newType) |
| ... | ...@@ -713,6 +714,8 @@ | |
| 713 | 714 | unpickler.unpickle(in.buf, in.bp, clazz, staticModule, in.file.toString()) |
| 714 | 715 | in.skip(attrLen) |
| 715 | 716 | this.isScala = true |
| 717 | case nme.ScalaATTR => | |
| 718 | isScalaRaw = true | |
| 716 | 719 | case nme.JacoMetaATTR => |
| 717 | 720 | val meta = pool.getName(in.nextChar).toString().trim() |
| 718 | 721 | metaParser.parse(meta, sym, symtype) |
| ... | ...@@ -874,6 +877,8 @@ | |
| 874 | 877 | case nme.ScalaSignatureATTR => |
| 875 | 878 | isScala = true |
| 876 | 879 | in.skip(attrLen) |
| 880 | case nme.ScalaATTR => | |
| 881 | isScalaRaw = true | |
| 877 | 882 | case nme.InnerClassesATTR if !isScala => |
| 878 | 883 | for (i <- 0 until in.nextChar) { |
| 879 | 884 | val innerIndex = in.nextChar |
| ... | ...@@ -126,6 +126,8 @@ | |
| 126 | 126 | currentRun.symData -= sym.linkedSym |
| 127 | 127 | //System.out.println("Generated ScalaSig Attr for " + sym)//debug |
| 128 | 128 | case _ => |
| 129 | val markerAttr = fjbgContext.JOtherAttribute(jclass, jclass, nme.ScalaATTR.toString, new Array[Byte](0), 0) | |
| 130 | jclass.addAttribute(markerAttr) | |
| 129 | 131 | log("Could not find pickle information for " + sym) |
| 130 | 132 | } |
| 131 | 133 | if (!(jclass.getName().endsWith("$") && sym.isModuleClass)) |
| ... | ...@@ -167,7 +167,7 @@ | |
| 167 | 167 | assert(visited.contains(b), |
| 168 | 168 | "Block " + b + " in " + this.method + " has input equal to bottom -- not visited? .." + visited)); |
| 169 | 169 | } |
| 170 | println("iterations: " + iterations + " for " + method.code.blocks.size) | |
| 170 | //println("iterations: " + iterations + " for " + method.code.blocks.size) | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | def blockTransfer(b: BasicBlock, in: lattice.Elem): lattice.Elem = { |
| ... | ...@@ -43,6 +43,7 @@ | |
| 43 | 43 | def readClass(cls: Symbol): (IClass, IClass) = { |
| 44 | 44 | var classFile: AbstractFile = null; |
| 45 | 45 | var sym = cls |
| 46 | sym.info // ensure accurate type information | |
| 46 | 47 | isScalaModule = cls.isModule && !cls.hasFlag(JAVA) |
| 47 | 48 | log("Reading class: " + cls + " isScalaModule?: " + isScalaModule) |
| 48 | 49 | val name = cls.fullNameString(java.io.File.separatorChar) + (if (sym.hasFlag(MODULE)) "$" else "") |
| ... | ...@@ -81,6 +82,7 @@ | |
| 81 | 82 | val c = pool.getClassSymbol(in.nextChar) |
| 82 | 83 | // if (c != clazz) |
| 83 | 84 | // throw new IOException("class file '" + in.file + "' contains " + c + "instead of " + clazz) |
| 85 | parseInnerClasses() | |
| 84 | 86 | |
| 85 | 87 | in.skip(2) // super class |
| 86 | 88 | in.skip(2 * in.nextChar) // interfaces |
| ... | ...@@ -432,6 +432,7 @@ | |
| 432 | 432 | val RuntimeAnnotationATTR = newTermName("RuntimeVisibleAnnotations") |
| 433 | 433 | val ClassfileAnnotationATTR = newTermName("RuntimeInvisibleAnnotations") |
| 434 | 434 | val RuntimeParamAnnotationATTR = newTermName("RuntimeVisibleParameterAnnotations") |
| 435 | val ScalaATTR = newTermName("Scala") | |
| 435 | 436 | } |
| 436 | 437 | |
| 437 | 438 | def encode(str: String): Name = newTermName(NameTransformer.encode(str)) |