Skip to content

Commit

Permalink
Blu
Browse files Browse the repository at this point in the history
  • Loading branch information
colder committed Jul 13, 2012
1 parent e291286 commit 8545416
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 37 deletions.
70 changes: 34 additions & 36 deletions src/insane/alias/PointToAnalysis.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2168,52 +2168,50 @@ trait PointToAnalysis extends PointToGraphsDefs with PointToEnvs with PointToLat

val cfgBefore = getPTCFGFromFun(fun)
globalTStart = System.currentTimeMillis
//analyze(fun)
specializedAnalyze(fun, BluntAnalysis, TypeSignature.fromDeclaration(fun.symbol))
analyze(fun)
//specializedAnalyze(fun, BluntAnalysis, TypeSignature.fromDeclaration(fun.symbol))

val cfgAfter = getPTCFGFromFun(fun)

if (cfgAfter != cfgBefore && !cfgAfter.isFlat) {
// we only reanalyze if the new cfg changed and is non trivial
workList = fun :: workList
} else {
// Finished analyzing fun
resultsStats.total += 1

val methodFlags = fun.symbol.flagBitsToString(fun.symbol.flags)

val category = if (cfgAfter.isFlat) {
if (cfgAfter.isTop) {
"top"
} else if (cfgAfter.isBottom) {
"bottom"
} else if (cfgAfter.isPure) {
"pure"
} else {
"impure"
}
// Finished analyzing fun
resultsStats.total += 1

val methodFlags = fun.symbol.flagBitsToString(fun.symbol.flags)
var nCalls = 0;

val category = if (cfgAfter.isFlat) {
if (cfgAfter.isTop) {
"top"
} else if (cfgAfter.isBottom) {
"bottom"
} else if (cfgAfter.isPure) {
"pure"
} else {
"impure"
}
} else {
val condCFG = analyzePTCFG(fun, ConditionalAnalysis, TypeSignature.fromDeclaration(fun.symbol))

val condCFG = analyzePTCFG(fun, ConditionalAnalysis, TypeSignature.fromDeclaration(fun.symbol))
nCalls = cfgAfter.graph.E.collect{ case CFGEdge(_, aam: CFG.AssignApplyMeth, _) => aam }.size

condCFG match {
case Some(cfg) if cfg.isPure =>
"condPure"
condCFG match {
case Some(cfg) if cfg.isPure =>
"condPure"

case Some(cfg) =>
"condImpure"
case Some(cfg) =>
"condImpure"

case None =>
reporter.error("Failed to produce an effect, BLEH")
"ERROR"
}
case None =>
reporter.error("Failed to produce an effect, BLEH")
"ERROR"
}
}

lastResults.append((fun.symbol, category))
resultsLog.println(category+"\t"+fun.symbol.fullName+"\t"+methodFlags+"\t"+(System.currentTimeMillis() / 1000L))
lastResults.append((fun.symbol, category))
resultsLog.println(category+"\t"+fun.symbol.fullName+"\t"+methodFlags+"\t"+(System.currentTimeMillis() / 1000L)+"\t"+nCalls)

ptProgressBar.tick
ptProgressBar.draw()
}
ptProgressBar.tick
ptProgressBar.draw()
}

ptProgressBar.end();
Expand Down
2 changes: 1 addition & 1 deletion src/insane/utils/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class Settings {
* precise type signatures up to `contSenDepth` depth.
*/
var contSenDepthWhenPrecise = 1;

// Same, but when doing blunt analysis
var contSenDepthMax = 1;

Expand Down

0 comments on commit 8545416

Please sign in to comment.