Skip to content

Commit e58d140

Browse files
committed
WIP
1 parent 8f2d17b commit e58d140

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

src/compiler/scala/tools/nsc/profile/Profiler.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,10 @@ private [profile] class RealProfiler(reporter : ProfileReporter, val settings: S
307307
}
308308

309309
private def completionName(root: Global#Symbol, associatedFile: AbstractFile): String = {
310-
if (root.hasPackageFlag) root.javaBinaryNameString
310+
if (root.hasPackageFlag || root.isTopLevel) root.javaBinaryNameString
311311
else {
312312
val enclosing = root.enclosingTopLevelClass
313-
if (enclosing == root) enclosing.javaBinaryNameString
314-
else enclosing.javaBinaryNameString + "::" + root.rawname.toString
313+
enclosing.javaBinaryNameString + "::" + root.rawname.toString
315314
}
316315
}
317316
}

src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -215,27 +215,29 @@ abstract class SymbolLoaders {
215215
}
216216

217217
override def complete(root: Symbol) {
218-
val assocFile = associatedFile
218+
val assocFile = associatedFile(root)
219219
currentRunProfilerBeforeCompletion(root, assocFile)
220220
try {
221-
val start = java.util.concurrent.TimeUnit.NANOSECONDS.toMillis(System.nanoTime())
222-
val currentphase = phase
223-
doComplete(root)
224-
phase = currentphase
225-
informTime("loaded " + description, start)
226-
ok = true
227-
setSource(root)
228-
setSource(root.companionSymbol) // module -> class, class -> module
229-
}
230-
catch {
231-
case ex @ (_: IOException | _: MissingRequirementError) =>
232-
ok = false
233-
signalError(root, ex)
221+
try {
222+
val start = java.util.concurrent.TimeUnit.NANOSECONDS.toMillis(System.nanoTime())
223+
val currentphase = phase
224+
doComplete(root)
225+
phase = currentphase
226+
informTime("loaded " + description, start)
227+
ok = true
228+
setSource(root)
229+
setSource(root.companionSymbol) // module -> class, class -> module
230+
}
231+
catch {
232+
case ex@(_: IOException | _: MissingRequirementError) =>
233+
ok = false
234+
signalError(root, ex)
235+
}
236+
initRoot(root)
237+
if (!root.isPackageClass) initRoot(root.companionSymbol)
234238
} finally {
235239
currentRunProfilerAfterCompletion(root, assocFile)
236240
}
237-
initRoot(root)
238-
if (!root.isPackageClass) initRoot(root.companionSymbol)
239241
}
240242

241243
override def load(root: Symbol) { complete(root) }

0 commit comments

Comments
 (0)