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

Implement function pointers in the VM #934

Merged
merged 3 commits into from
May 12, 2020
Merged

Implement function pointers in the VM #934

merged 3 commits into from
May 12, 2020

Conversation

fyrchik
Copy link
Contributor

@fyrchik fyrchik commented May 6, 2020

Closes #883.

@codecov
Copy link

codecov bot commented May 6, 2020

Codecov Report

Merging #934 into master will decrease coverage by 0.08%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #934      +/-   ##
==========================================
- Coverage   64.05%   63.96%   -0.09%     
==========================================
  Files         196      196              
  Lines       16473    16561      +88     
==========================================
+ Hits        10551    10594      +43     
- Misses       5375     5415      +40     
- Partials      547      552       +5     
Impacted Files Coverage Δ
pkg/vm/opcode/opcode_string.go 2.87% <0.00%> (-0.05%) ⬇️
pkg/compiler/codegen.go 85.65% <25.71%> (-2.42%) ⬇️
pkg/vm/stack_item.go 85.01% <54.05%> (-2.80%) ⬇️
pkg/vm/vm.go 82.33% <82.35%> (+<0.01%) ⬆️
pkg/compiler/func_scope.go 100.00% <100.00%> (ø)
pkg/vm/context.go 70.00% <100.00%> (ø)
pkg/vm/serialization.go 93.04% <0.00%> (+1.73%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b83ee77...75fb3af. Read the comment docs.

Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We certainly need additional compiler tests and new issues to track what we're currently missing in terms of lamdas support.

pkg/vm/stack_item.go Outdated Show resolved Hide resolved
pkg/vm/stack_item.go Outdated Show resolved Hide resolved
@fyrchik
Copy link
Contributor Author

fyrchik commented May 7, 2020

@roman-khimov I have created an issue (#939), though there are no things which are really needed. This is more about support in VM.

pkg/vm/stack_item.go Outdated Show resolved Hide resolved
@roman-khimov
Copy link
Member

This one needs to be rebased (see the latest comment also, I think we're better referencing the script itself for now).

Pointer is a generic address type in VM.
It is used for calling lambda-expressions.
Implement basic support for function literals.
Nested function literals and variables from closure are not supported for now.
@roman-khimov roman-khimov merged commit 8e916f5 into master May 12, 2020
@roman-khimov roman-khimov deleted the feature/pointer branch May 12, 2020 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Go smart contract compiler vm VM tasks/bugs/issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add function pointers to VM
2 participants