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

fix(gnovm): follow up works on loop scope(#2429) #2440

Merged
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
c6411d6
add test
ltzmaxwell Jul 1, 2024
99b2a1e
alloc heapItem for ref
ltzmaxwell Jul 1, 2024
e7761ea
Merge remote-tracking branch 'upstream/dev/jae/loopescape' into 2/max…
ltzmaxwell Jul 1, 2024
26580ab
Merge remote-tracking branch 'upstream/dev/jae/loopescape' into 2/max…
ltzmaxwell Jul 1, 2024
0d2bbb1
test ref
ltzmaxwell Jul 1, 2024
e7b4601
Merge remote-tracking branch 'upstream/dev/jae/loopescape' into 2/max…
ltzmaxwell Jul 2, 2024
59ace4e
add forloop tests
ltzmaxwell Jul 2, 2024
348b3f6
revert
ltzmaxwell Jul 2, 2024
256c289
fixup
ltzmaxwell Jul 2, 2024
c2f0d56
clean
ltzmaxwell Jul 2, 2024
9b50f5a
fixup
ltzmaxwell Jul 2, 2024
bc93048
fixup
ltzmaxwell Jul 2, 2024
17e51d1
fixup
ltzmaxwell Jul 2, 2024
bb83812
fixup
ltzmaxwell Jul 2, 2024
e6ec47e
fixup
ltzmaxwell Jul 2, 2024
2332e31
Merge remote-tracking branch 'upstream/dev/jae/loopescape' into 2/max…
ltzmaxwell Jul 3, 2024
e0bd54f
Merge remote-tracking branch 'upstream/dev/jae/loopescape' into 2/max…
ltzmaxwell Jul 3, 2024
cd0f1e8
closure works
ltzmaxwell Jul 3, 2024
ad68fb0
fix copy
ltzmaxwell Jul 3, 2024
69766a0
heapItem work, no loopVar
ltzmaxwell Jul 4, 2024
e20045c
save
ltzmaxwell Jul 4, 2024
cb9fe50
debug
ltzmaxwell Jul 9, 2024
81e0f00
make gotoloop pass
ltzmaxwell Jul 10, 2024
6843928
alloc per loop on for
ltzmaxwell Jul 10, 2024
20f04f5
fixup
ltzmaxwell Jul 10, 2024
9645142
range work
ltzmaxwell Jul 10, 2024
046f07e
range key and value
ltzmaxwell Jul 10, 2024
cfd1cbc
intersection goto loop
ltzmaxwell Jul 11, 2024
9a0fc7f
fix for loop && re-orgnize test files
ltzmaxwell Jul 11, 2024
51574f6
fixup
ltzmaxwell Jul 12, 2024
694cedf
save with logic attempt for optimization
ltzmaxwell Jul 15, 2024
2840f08
test pass
ltzmaxwell Jul 16, 2024
1e088f9
clean
ltzmaxwell Jul 17, 2024
b8a3f22
loopvar implicit decl in runtime
ltzmaxwell Jul 17, 2024
0ad5132
Revert "loopvar implicit decl in runtime"
ltzmaxwell Jul 17, 2024
6cafbb6
more tests
ltzmaxwell Jul 18, 2024
2c2bb15
fixup && rename files
ltzmaxwell Jul 18, 2024
48be792
tune test files
ltzmaxwell Jul 19, 2024
a0ef113
clean
ltzmaxwell Jul 19, 2024
7da572e
fix check locally defined
ltzmaxwell Jul 19, 2024
e08ad98
solve todo
ltzmaxwell Jul 19, 2024
b174eea
fixup
ltzmaxwell Jul 19, 2024
67ef081
fix tests
ltzmaxwell Jul 19, 2024
0e49090
correct init order for func with unnamed return, all tests passed
ltzmaxwell Jul 20, 2024
1d629f7
fixup
ltzmaxwell Jul 20, 2024
7e83eb1
tune
ltzmaxwell Jul 21, 2024
b24a779
add preprocessed infos
ltzmaxwell Jul 21, 2024
f253108
add TODO
ltzmaxwell Jul 21, 2024
20e64f9
delete attr
ltzmaxwell Jul 21, 2024
faecc70
fixup
ltzmaxwell Jul 21, 2024
921b293
fixup
ltzmaxwell Jul 21, 2024
fc9eaa1
fixup
ltzmaxwell Jul 21, 2024
d24a3d5
Merge branch 'dev/jae/loopescape' into dev/maxwell/dev/jae/loopscope
jaekwon Jul 25, 2024
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
58 changes: 29 additions & 29 deletions examples/gno.land/p/demo/avl/z_0_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ func main() {

// Realm:
// switchrealm["gno.land/r/test"]
// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:4]={
// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:3]={
// "ObjectInfo": {
// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4",
// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:3",
// "ModTime": "7",
// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7",
// "RefCount": "1"
Expand All @@ -38,8 +38,8 @@ func main() {
// },
// "V": {
// "@type": "/gno.RefValue",
// "Hash": "627e8e517e7ae5db0f3b753e2a32b607989198b6",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5"
// "Hash": "54bef18ac963dd67ad0634eac6b75a2c4a733b97",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4"
// }
// }
// }
Expand Down Expand Up @@ -162,8 +162,8 @@ func main() {
// "@type": "/gno.PointerValue",
// "Base": {
// "@type": "/gno.RefValue",
// "Hash": "6da365f0d6cacbcdf53cd5a4b125803cddce08c2",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4"
// "Hash": "ce8be5b209e8f322bf1b15c854275064d5645741",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:3"
// },
// "Index": "0",
// "TV": null
Expand Down Expand Up @@ -210,7 +210,7 @@ func main() {
// },
// "V": {
// "@type": "/gno.RefValue",
// "Hash": "ff1a50d8489090af37a2c7766d659f0d717939b5",
// "Hash": "da7583511e84b52e256a57deabe5b390d875407d",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7"
// }
// }
Expand All @@ -237,6 +237,25 @@ func main() {
// "Values": [
// {
// "T": {
// "@type": "/gno.PointerType",
// "Elt": {
// "@type": "/gno.RefType",
// "ID": "gno.land/p/demo/avl.Node"
// }
// },
// "V": {
// "@type": "/gno.PointerValue",
// "Base": {
// "@type": "/gno.RefValue",
// "Hash": "e925bb6bf884ece9620dd27f831dc510b5bc0e55",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6"
// },
// "Index": "0",
// "TV": null
// }
// },
// {
// "T": {
// "@type": "/gno.FuncType",
Comment on lines +240 to 259
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

package var is inited firstly in initStaticBlocks, the the order changes.

// "Params": [],
// "Results": []
Expand All @@ -246,11 +265,11 @@ func main() {
// "Closure": {
// "@type": "/gno.RefValue",
// "Escaped": true,
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:3"
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5"
// },
// "FileName": "main.gno",
// "IsMethod": false,
// "Name": "init.0",
// "Name": "init.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

is this introduced by the initStaticBlocks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes.

// "NativeName": "",
// "NativePkg": "",
// "PkgPath": "gno.land/r/test",
Expand Down Expand Up @@ -282,7 +301,7 @@ func main() {
// "Closure": {
// "@type": "/gno.RefValue",
// "Escaped": true,
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:3"
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5"
// },
// "FileName": "main.gno",
// "IsMethod": false,
Expand All @@ -306,25 +325,6 @@ func main() {
// "Results": []
// }
// }
// },
// {
// "T": {
// "@type": "/gno.PointerType",
// "Elt": {
// "@type": "/gno.RefType",
// "ID": "gno.land/p/demo/avl.Node"
// }
// },
// "V": {
// "@type": "/gno.PointerValue",
// "Base": {
// "@type": "/gno.RefValue",
// "Hash": "ae86874f9b47fa5e64c30b3e92e9d07f2ec967a4",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6"
// },
// "Index": "0",
// "TV": null
// }
// }
// ]
// }
60 changes: 30 additions & 30 deletions examples/gno.land/p/demo/avl/z_1_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ func main() {
// "@type": "/gno.PointerValue",
// "Base": {
// "@type": "/gno.RefValue",
// "Hash": "2f3adc5d0f2a3fe0331cfa93572a7abdde14c9aa",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8"
// "Hash": "b4d88f4e396525f5dd9b2f6599531cc7a9910fc2",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7"
// },
// "Index": "0",
// "TV": null
Expand Down Expand Up @@ -191,7 +191,7 @@ func main() {
// },
// "V": {
// "@type": "/gno.RefValue",
// "Hash": "fe20a19f956511f274dc77854e9e5468387260f4",
// "Hash": "e64dc27f430466fcf8c0bf21aea298161687ca6d",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:13"
// }
// }
Expand Down Expand Up @@ -235,8 +235,8 @@ func main() {
// "@type": "/gno.PointerValue",
// "Base": {
// "@type": "/gno.RefValue",
// "Hash": "c89a71bdf045e8bde2059dc9d33839f916e02e5d",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6"
// "Hash": "0798652a2645fc6cce744f50fc3b0c8b74644273",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:5"
// },
// "Index": "0",
// "TV": null
Expand All @@ -254,7 +254,7 @@ func main() {
// "@type": "/gno.PointerValue",
// "Base": {
// "@type": "/gno.RefValue",
// "Hash": "90fa67f8c47db4b9b2a60425dff08d5a3385100f",
// "Hash": "45c144eab89443ba7649622f95f7b4afe4f1c2ed",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:12"
// },
// "Index": "0",
Expand Down Expand Up @@ -283,7 +283,7 @@ func main() {
// },
// "V": {
// "@type": "/gno.RefValue",
// "Hash": "83e42caaf53070dd95b5f859053eb51ed900bbda",
// "Hash": "f30d9cde2b4b6bb35e422712f4f2a60e3e0d6ebb",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:11"
// }
// }
Expand All @@ -310,6 +310,25 @@ func main() {
// "Values": [
// {
// "T": {
// "@type": "/gno.PointerType",
// "Elt": {
// "@type": "/gno.RefType",
// "ID": "gno.land/p/demo/avl.Node"
// }
// },
// "V": {
// "@type": "/gno.PointerValue",
// "Base": {
// "@type": "/gno.RefValue",
// "Hash": "38137d7532c4cf5c5d1997db211f4144946d2c94",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:10"
// },
// "Index": "0",
// "TV": null
// }
// },
// {
// "T": {
// "@type": "/gno.FuncType",
// "Params": [],
// "Results": []
Expand All @@ -319,11 +338,11 @@ func main() {
// "Closure": {
// "@type": "/gno.RefValue",
// "Escaped": true,
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:3"
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9"
// },
// "FileName": "main.gno",
// "IsMethod": false,
// "Name": "init.0",
// "Name": "init.1",
// "NativeName": "",
// "NativePkg": "",
// "PkgPath": "gno.land/r/test",
Expand Down Expand Up @@ -355,7 +374,7 @@ func main() {
// "Closure": {
// "@type": "/gno.RefValue",
// "Escaped": true,
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:3"
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9"
// },
// "FileName": "main.gno",
// "IsMethod": false,
Expand All @@ -379,27 +398,8 @@ func main() {
// "Results": []
// }
// }
// },
// {
// "T": {
// "@type": "/gno.PointerType",
// "Elt": {
// "@type": "/gno.RefType",
// "ID": "gno.land/p/demo/avl.Node"
// }
// },
// "V": {
// "@type": "/gno.PointerValue",
// "Base": {
// "@type": "/gno.RefValue",
// "Hash": "1faa9fa4ba1935121a6d3f0a623772e9d4499b0a",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:10"
// },
// "Index": "0",
// "TV": null
// }
// }
// ]
// }
// d[a8ada09dee16d791fd406d629fe29bb0ed084a30:3]
// d[a8ada09dee16d791fd406d629fe29bb0ed084a30:4]
// d[a8ada09dee16d791fd406d629fe29bb0ed084a30:5]
24 changes: 12 additions & 12 deletions examples/gno.land/p/demo/avl/z_2_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ func main() {
// "@type": "/gno.PointerValue",
// "Base": {
// "@type": "/gno.RefValue",
// "Hash": "849a50d6c78d65742752e3c89ad8dd556e2e63cb",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:9"
// "Hash": "2f3adc5d0f2a3fe0331cfa93572a7abdde14c9aa",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:8"
// },
// "Index": "0",
// "TV": null
Expand Down Expand Up @@ -190,7 +190,7 @@ func main() {
// },
// "V": {
// "@type": "/gno.RefValue",
// "Hash": "a1160b0060ad752dbfe5fe436f7734bb19136150",
// "Hash": "6d04e651e14c3a835599a39c4092d3bf50a95b8e",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:14"
// }
// }
Expand Down Expand Up @@ -234,8 +234,8 @@ func main() {
// "@type": "/gno.PointerValue",
// "Base": {
// "@type": "/gno.RefValue",
// "Hash": "fd95e08763159ac529e26986d652e752e78b6325",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:7"
// "Hash": "c89a71bdf045e8bde2059dc9d33839f916e02e5d",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:6"
// },
// "Index": "0",
// "TV": null
Expand All @@ -253,7 +253,7 @@ func main() {
// "@type": "/gno.PointerValue",
// "Base": {
// "@type": "/gno.RefValue",
// "Hash": "3ecdcf148fe2f9e97b72a3bedf303b2ba56d4f4b",
// "Hash": "71500837a7725bfb1acd92d2a7c2c522fb01dcba",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:13"
// },
// "Index": "0",
Expand All @@ -272,7 +272,7 @@ func main() {
// "ObjectInfo": {
// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:11",
// "ModTime": "0",
// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4",
// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:3",
// "RefCount": "1"
// },
// "Value": {
Expand All @@ -282,12 +282,12 @@ func main() {
// },
// "V": {
// "@type": "/gno.RefValue",
// "Hash": "63126557dba88f8556f7a0ccbbfc1d218ae7a302",
// "Hash": "4ba75a3b7d996edbfd3c26c0538db48467fccc66",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:12"
// }
// }
// }
// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:4]={
// u[a8ada09dee16d791fd406d629fe29bb0ed084a30:3]={
// "Fields": [
// {
// "T": {
Expand All @@ -301,7 +301,7 @@ func main() {
// "@type": "/gno.PointerValue",
// "Base": {
// "@type": "/gno.RefValue",
// "Hash": "425bc3bff1f4c36b175d055ed8b2c289123fcca1",
// "Hash": "76ac814ba85d9f87cff4964d34c81684f02b0584",
// "ObjectID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:11"
// },
// "Index": "0",
Expand All @@ -310,11 +310,11 @@ func main() {
// }
// ],
// "ObjectInfo": {
// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4",
// "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:3",
// "ModTime": "10",
// "OwnerID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:2",
// "RefCount": "1"
// }
// }
// d[a8ada09dee16d791fd406d629fe29bb0ed084a30:4]
// d[a8ada09dee16d791fd406d629fe29bb0ed084a30:5]
// d[a8ada09dee16d791fd406d629fe29bb0ed084a30:6]
10 changes: 5 additions & 5 deletions examples/gno.land/r/demo/boards/z_4_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func main() {
// "Escaped": true,
// "ObjectID": "336074805fc853987abe6f7fe3ad97a6a6f3077a:2"
// },
// "Index": "192",
// "Index": "182",
// "TV": null
// }
// }
Expand Down Expand Up @@ -497,7 +497,7 @@ func main() {
// },
// "V": {
// "@type": "/gno.RefValue",
// "Hash": "f56a463a97d103e183f1f368bf00a2ce99d4de88",
// "Hash": "0fd3352422af0a56a77ef2c9e88f479054e3d51f",
// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:131"
// }
// },
Expand Down Expand Up @@ -534,7 +534,7 @@ func main() {
// },
// "V": {
// "@type": "/gno.RefValue",
// "Hash": "0651ea376feea18422dbe079f9d7fcbe3dfd32ad",
// "Hash": "c45bbd47a46681a63af973db0ec2180922e4a8ae",
// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:127"
// }
// }
Expand Down Expand Up @@ -785,7 +785,7 @@ func main() {
// },
// "V": {
// "@type": "/gno.RefValue",
// "Hash": "1d70015c486ccc9bfb7c425152605fabc78be1dd",
// "Hash": "a416a751c3a45a1e5cba11e737c51340b081e372",
// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:86"
// }
// },
Expand All @@ -803,7 +803,7 @@ func main() {
// },
// "V": {
// "@type": "/gno.RefValue",
// "Hash": "b8ee1687a4f45886912ba624c8513a2a1526b94c",
// "Hash": "36299fccbc13f2a84c4629fad4cb940f0bd4b1c6",
// "ObjectID": "f6dbf411da22e67d74cd7ddba6a76cd7e14a4822:87"
// }
// },
Expand Down
Loading