Skip to content

Commit

Permalink
WIP Stricter ExtractAPI
Browse files Browse the repository at this point in the history
Something similar was tried before and reverted due to a regression:

#290

This is just in this PR to benchmark the potential performance gain.
  • Loading branch information
retronym committed Feb 22, 2018
1 parent 4d32fe0 commit 7b3f846
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ object ClassToAPI {
classfile.Parser.apply(IO.classfileLocation(c))

@inline private[this] def lzyS[T <: AnyRef](t: T): xsbti.api.Lazy[T] = SafeLazyProxy.strict(t)
@inline final def lzy[T <: AnyRef](t: => T): xsbti.api.Lazy[T] = SafeLazyProxy(t)
@inline final def lzy[T <: AnyRef](t: => T): xsbti.api.Lazy[T] = SafeLazyProxy.strict(t)
private[this] def lzy[T <: AnyRef](t: => T, cmap: ClassMap): xsbti.api.Lazy[T] = {
val s = lzy(t)
cmap.lz += s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ object APIs {
val emptyCompanions = xsbti.api.Companions.of(emptyAPI, emptyAPI)
val emptyAnalyzedClass = xsbti.api.AnalyzedClass.of(noCompilationStamp,
emptyName,
SafeLazyProxy(emptyCompanions),
SafeLazyProxy.strict(emptyCompanions),
emptyAPIHash,
Array.empty[NameHash],
false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ private final class AnalysisCallback(
val hasMacro: Boolean = macroClasses.contains(name)
val (companions, apiHash) = companionsWithHash(name)
val nameHashes = nameHashesForCompanions(name)
val safeCompanions = SafeLazyProxy(companions)
val safeCompanions = SafeLazyProxy.strict(companions)
val ac = AnalyzedClass.of(compilation.getStartTime(),
name,
safeCompanions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object AnalyzedClassFormats {
hasMacro: Boolean) =>
AnalyzedClass.of(compilationTimestamp,
name,
SafeLazyProxy(emptyCompanions),
SafeLazyProxy.strict(emptyCompanions),
apiHash,
nameHashes,
hasMacro)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ trait AnalysisGenerators {
} yield
AnalyzedClass.of(startTime,
name,
SafeLazyProxy(makeCompanions(name)),
SafeLazyProxy.strict(makeCompanions(name)),
apiHash,
nameHashes,
hasMacro)
Expand Down

0 comments on commit 7b3f846

Please sign in to comment.