Skip to content

Commit

Permalink
Remove old closure-conversion code & diff-check between old/new.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickchapman-da committed Nov 22, 2021
1 parent e6d1cd1 commit 2ecdfa4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 191 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import com.daml.lf.speedy.SBuiltin._
import com.daml.lf.speedy.SValue._
import com.daml.lf.speedy.{SExpr0 => s}
import com.daml.lf.speedy.{SExpr => t}
import com.daml.lf.speedy.{ClosureConversion => oldCC}
import com.daml.lf.speedy.{ClosureConversionStackSafe => newCC}
import com.daml.lf.speedy.ClosureConversionStackSafe.closureConvert
import com.daml.lf.speedy.ValidateCompilation.validateCompilation
import com.daml.lf.validation.{EUnknownDefinition, Validation, ValidationError}
import com.daml.scalautil.Statement.discard
Expand Down Expand Up @@ -349,15 +348,6 @@ private[lf] final class Compiler(
private[this] def compilationPipeline(sexpr: s.SExpr): t.SExpr =
flattenToAnf(closureConvert(sexpr))

private[this] def closureConvert(exp: s.SExpr): SExpr1.SExpr = { //NICK: remove this diff check
val res1 = oldCC.closureConvert(exp)
val res2 = newCC.closureConvert(exp)
if (res1 != res2) {
sys.error(s"closureConvert(DIFF check FAIL):\nv1=$res1\nv2=$res2")
}
res2
}

@throws[PackageNotFound]
@throws[CompilationError]
def unsafeCompileModule(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class StackSafetyTest extends AnyFreeSpec with Matchers with TableDrivenProperty

// This is the code under test...
def transform(e: SExpr): target.SExpr = {
//import com.daml.lf.speedy.ClosureConversion.closureConvert //old stack-unsafe code would fail
import com.daml.lf.speedy.ClosureConversionStackSafe.closureConvert
closureConvert(e)
}
Expand Down

0 comments on commit 2ecdfa4

Please sign in to comment.