Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize interpreter: Evaluate statements and declarations directly, remove trampolines #684

Merged
merged 3 commits into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions runtime/ast/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ type Condition struct {
Message Expression
}

func (c *Condition) Accept(visitor Visitor) Repr {
return visitor.VisitCondition(c)
}

// Conditions

type Conditions []*Condition
1 change: 0 additions & 1 deletion runtime/ast/visitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ type Visitor interface {
VisitInterfaceDeclaration(*InterfaceDeclaration) Repr
VisitFieldDeclaration(*FieldDeclaration) Repr
VisitEnumCaseDeclaration(*EnumCaseDeclaration) Repr
VisitCondition(*Condition) Repr
VisitPragmaDeclaration(*PragmaDeclaration) Repr
VisitImportDeclaration(*ImportDeclaration) Repr
VisitTransactionDeclaration(*TransactionDeclaration) Repr
Expand Down
5 changes: 2 additions & 3 deletions runtime/interpreter/authaccount_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/errors"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/runtime/trampoline"
)

// AuthAccountContractsValue
Expand Down Expand Up @@ -72,8 +71,8 @@ func (AuthAccountContractsValue) SetModified(_ bool) {
// NO-OP
}

func (v AuthAccountContractsValue) Destroy(_ *Interpreter, _ LocationRange) trampoline.Trampoline {
return trampoline.Done{Result: NilValue{}}
func (v AuthAccountContractsValue) Destroy(_ *Interpreter, _ LocationRange) {
// NO-OP
}

func (v AuthAccountContractsValue) String() string {
Expand Down
5 changes: 2 additions & 3 deletions runtime/interpreter/deployed_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/errors"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/runtime/trampoline"
)

// DeployedContractValue
Expand Down Expand Up @@ -70,8 +69,8 @@ func (DeployedContractValue) SetModified(_ bool) {
// NO-OP
}

func (v DeployedContractValue) Destroy(_ *Interpreter, _ LocationRange) trampoline.Trampoline {
return trampoline.Done{Result: NilValue{}}
func (v DeployedContractValue) Destroy(_ *Interpreter, _ LocationRange) {
// NO-OP
}

func (v DeployedContractValue) String() string {
Expand Down
Loading