Skip to content

Commit

Permalink
different types for different speedy phases (#11605)
Browse files Browse the repository at this point in the history
* Refactor speedy to distinuish SExpr types before/after ANF compilation phase

CHANGELOG_BEGIN
CHANGELOG_END

* remove commment/marker left in error

* make SExpr0 private to speedy

* reinstate (non-pp) print of original expression in AnfTest faiure

* avoid use of s./t. prefixes for expressions in SBuiltin; add 3 TODO markers

* inline "runtime" apply methods of SDefinitionRef into sole caller: SBCallInterface

* avoid use of t. prefix in SExpr0

* change s./t. prefix to source./target.

* add comment to summarize differences between SExpr0 and SExpr
  • Loading branch information
nickchapman-da authored Nov 11, 2021
1 parent 44d604d commit 2dd5289
Show file tree
Hide file tree
Showing 22 changed files with 782 additions and 572 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.daml.lf.engine.script._
import com.daml.lf.language.Ast._
import com.daml.lf.language.{Ast, LanguageVersion, Util => AstUtil}
import com.daml.lf.speedy.SExpr._
import com.daml.lf.speedy.{Compiler, SDefinition, SError, SExpr, SValue}
import com.daml.lf.speedy.{Compiler, SDefinition, SError, SValue}
import com.daml.grpc.adapter.{AkkaExecutionSequencerPool, ExecutionSequencerFactory}
import com.daml.ledger.api.refinements.ApiTypes.ApplicationId
import com.daml.ledger.api.tls.{TlsConfiguration, TlsConfigurationCli}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import com.daml.lf.command._
import com.daml.lf.data._
import com.daml.lf.data.Ref.{PackageId, ParticipantId, Party}
import com.daml.lf.language.Ast._
import com.daml.lf.speedy.{InitialSeeding, PartialTransaction, Pretty, SError, SExpr}
import com.daml.lf.speedy.{InitialSeeding, PartialTransaction, Pretty, SError}
import com.daml.lf.speedy.SExpr.{SExpr, SEApp, SEValue}
import com.daml.lf.speedy.Speedy.Machine
import com.daml.lf.speedy.SResult._
import com.daml.lf.transaction.{SubmittedTransaction, VersionedTransaction, Transaction => Tx}
Expand Down Expand Up @@ -309,7 +310,7 @@ class Engine(val config: EngineConfig = Engine.StableConfig) {
compiledPackages = compiledPackages,
submissionTime = submissionTime,
initialSeeding = seeding,
expr = SExpr.SEApp(sexpr, Array(SExpr.SEValue.Token)),
expr = SEApp(sexpr, Array(SEValue.Token)),
committers = submitters,
readAs = readAs,
validating = validating,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package speedy
package explore

import com.daml.lf.language.PackageInterface
import com.daml.lf.speedy.SExpr._
import com.daml.lf.speedy.SExpr0._
import com.daml.lf.speedy.SValue._
import com.daml.lf.speedy.SResult._
import com.daml.lf.speedy.SBuiltin._
Expand Down Expand Up @@ -35,7 +35,7 @@ object PlaySpeedy {
names.foreach { name =>
val (expected, expr) = examples(name)
val converted = compiler.unsafeClosureConvert(expr)
val machine = Speedy.Machine.fromPureSExpr(PureCompiledPackages.Empty, converted)
val machine = Machine.fromPureSExpr(PureCompiledPackages.Empty, converted)
runMachine(name, machine, expected)
}
}
Expand Down
Loading

0 comments on commit 2dd5289

Please sign in to comment.