Skip to content

[WIP][go1.20] Working on go1.20 native overrides #1283

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

Closed
wants to merge 244 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
244 commits
Select commit Hold shift + click to select a range
7b4eb0f
Updated the linkname to handle new directives
grantnelson-wf Apr 2, 2024
6805770
Adding some updates
grantnelson-wf Apr 2, 2024
1317857
purging some unneeded methods
grantnelson-wf Apr 2, 2024
e89fa96
removing temp.txt dump file
grantnelson-wf Apr 2, 2024
a0d9755
Updating crypto
grantnelson-wf Apr 3, 2024
f7218c1
Updated crypto
grantnelson-wf Apr 3, 2024
baf6678
Fixed http use of atomic pointer
grantnelson-wf Apr 3, 2024
002cfe4
Fixed self referencing links
grantnelson-wf Apr 3, 2024
4415fb0
Updated the linkname to handle new directives
grantnelson-wf Apr 2, 2024
45a558d
Merge branch 'updateLinkname' of github.com:Workiva/gopherjs into wor…
grantnelson-wf Apr 3, 2024
cdd523b
Updated the linkname to handle new directives
grantnelson-wf Apr 2, 2024
dfeb70c
Merge branch 'updateLinkname' of github.com:Workiva/gopherjs into wor…
grantnelson-wf Apr 3, 2024
f07226e
Touchup the linkname update
grantnelson-wf Apr 3, 2024
8ba1a1f
Merge branch 'updateLinkname' of github.com:Workiva/gopherjs into wor…
grantnelson-wf Apr 3, 2024
fd5c620
Updating crypto sublte xor overrides
grantnelson-wf Apr 3, 2024
6472867
Merge branch 'subtleXor' of github.com:Workiva/gopherjs into workingO…
grantnelson-wf Apr 3, 2024
df3496e
Merge branch 'subtleXor' of github.com:Workiva/gopherjs into workingO…
grantnelson-wf Apr 8, 2024
dcfcb7d
Merge branch 'master' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Apr 9, 2024
bb2df97
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Apr 9, 2024
81b5fc3
Working on fixedbugs/issues
grantnelson-wf Apr 9, 2024
64162ee
Working on fixedbugs/issues
grantnelson-wf Apr 9, 2024
88ff565
Fixed the var link in cgo
grantnelson-wf Apr 10, 2024
ad564b5
Update build constraint checks
grantnelson-wf Apr 10, 2024
676ef5a
Undoing tags update to instead match changes to go/test/run.go
grantnelson-wf Apr 10, 2024
a52c6c1
Updating to match changes to go/test/run.go
grantnelson-wf Apr 11, 2024
6e6162d
Pulling back some changes to run.go
grantnelson-wf Apr 11, 2024
90d474e
Pulling back some changes to run.go
grantnelson-wf Apr 11, 2024
72ff7e3
Pulling back some changes to run.go
grantnelson-wf Apr 11, 2024
90ed493
Pulling back some changes to run.go
grantnelson-wf Apr 11, 2024
6f02db7
Pulling back some changes to run.go
grantnelson-wf Apr 11, 2024
652feaa
Pulling back some changes to run.go
grantnelson-wf Apr 11, 2024
bfd15d6
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Apr 11, 2024
ddebeb6
Merge branch 'master' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Apr 16, 2024
2ec76a8
Merge branch 'mergeMaster' of github.com:Workiva/gopherjs into workin…
grantnelson-wf Apr 16, 2024
a0dc317
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Apr 18, 2024
90c7868
Updating testing example.go
grantnelson-wf Apr 18, 2024
e093117
Updated godebug setUpdate
grantnelson-wf Apr 18, 2024
0c908e4
Doing some cleanup
grantnelson-wf Apr 18, 2024
18ab043
Removing generics overrides
grantnelson-wf Apr 18, 2024
f200ab8
Removing generics overrides
grantnelson-wf Apr 18, 2024
d3314f1
Removing generics overrides
grantnelson-wf Apr 18, 2024
3ce79d7
Removing generics overrides
grantnelson-wf Apr 18, 2024
b68671c
Removing generic overrides that are no longer needed
grantnelson-wf Apr 18, 2024
1114f24
Working on gorepo
grantnelson-wf Apr 18, 2024
f819697
Updating known fails for gorepo
grantnelson-wf Apr 18, 2024
6aef801
Merge branch 'updateKnownFails' of github.com:Workiva/gopherjs into w…
grantnelson-wf Apr 19, 2024
52275f4
Merge branch 'cleanGenericsOverrides' of github.com:Workiva/gopherjs …
grantnelson-wf Apr 19, 2024
4403e4b
Merge branch 'updateTestRunExample' of github.com:Workiva/gopherjs in…
grantnelson-wf Apr 19, 2024
05955a6
fix merge mistake
grantnelson-wf Apr 19, 2024
dc407c6
updating known failures
grantnelson-wf Apr 19, 2024
70d9464
Merge branch 'updateKnownFails' of github.com:Workiva/gopherjs into w…
grantnelson-wf Apr 19, 2024
7007a46
remove some testing code
grantnelson-wf Apr 19, 2024
eb1a98e
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Apr 22, 2024
f7026da
Got gorepo/run.go running
grantnelson-wf Apr 23, 2024
8feee13
Removing unneeded prune of imports from build
grantnelson-wf Apr 23, 2024
5f306a3
candidate for sliceData built-in
grantnelson-wf Apr 23, 2024
efb9a2c
Correctly typed slideData
grantnelson-wf Apr 24, 2024
dc31d02
Added nil testing to SliceData
grantnelson-wf Apr 25, 2024
4c32459
Added a comment to SliceData
grantnelson-wf Apr 25, 2024
9926aed
Updating bcache override
grantnelson-wf Apr 25, 2024
eb0ddf7
Overriding an unsafe.String
grantnelson-wf Apr 25, 2024
3b9b7de
Updated signatures in clientserver_test
grantnelson-wf Apr 25, 2024
5bd55cc
Fixing cache_test.go
grantnelson-wf Apr 25, 2024
5f26960
Cleaning up gorepo from experiments
grantnelson-wf Apr 25, 2024
b9384be
Fixing cache_test.go
grantnelson-wf Apr 25, 2024
e1b1dcb
Merge branch 'gorepoTestTimeout' of github.com:Workiva/gopherjs into …
grantnelson-wf Apr 26, 2024
c702160
Reducing the number of expression formatting in SliceData
grantnelson-wf May 2, 2024
befe8df
Merge branch 'addUnsafeSliceData' of github.com:Workiva/gopherjs into…
grantnelson-wf May 2, 2024
6f15b82
Merge branch 'master' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf May 2, 2024
b3a6078
Added runtime set and unset env
grantnelson-wf May 2, 2024
b07854f
Add a link to fastrand64 into math/rand
grantnelson-wf May 2, 2024
c7add00
Add unsafe for link
grantnelson-wf May 2, 2024
bff3255
Merge branch 'internalizingNulls' of github.com:Workiva/gopherjs into…
grantnelson-wf May 3, 2024
a0eaa4b
Fixing strings tests
grantnelson-wf May 3, 2024
6081da0
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf May 6, 2024
3d8a85e
Merge branch 'master' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf May 7, 2024
1c9d76b
Working on unsafe.SliceData
grantnelson-wf May 8, 2024
86cf474
Fixes to unsafe.SliceData
grantnelson-wf May 8, 2024
f2f0627
Merge branch 'addUnsafeSliceData' of github.com:Workiva/gopherjs into…
grantnelson-wf May 8, 2024
138c6b6
Adding back in overrides to crypto
grantnelson-wf May 8, 2024
3aaef46
Adding back in overrides to godebug
grantnelson-wf May 8, 2024
3887460
Adding back in overrides to atomic
grantnelson-wf May 8, 2024
f855e86
Adding back in overrides to gob
grantnelson-wf May 8, 2024
1d582c2
Adding back in overrides to token position
grantnelson-wf May 8, 2024
a18b2fe
Adding back in overrides to http
grantnelson-wf May 8, 2024
0ef8838
Adding back in overrides to map
grantnelson-wf May 8, 2024
b1aeef3
Adding back in overrides to time
grantnelson-wf May 8, 2024
eaf7664
Adding back in overrides to reflects
grantnelson-wf May 8, 2024
b88e0f5
Adding back in overrides to testing
grantnelson-wf May 8, 2024
d6863c2
Adding back in overrides to time format
grantnelson-wf May 8, 2024
67a4a2d
Undoing a comment
grantnelson-wf May 8, 2024
815e712
Working on pointer override
grantnelson-wf May 8, 2024
dcecc94
Working on overrides for unit-tests
grantnelson-wf May 8, 2024
a382c95
Working on overrides for unit-tests
grantnelson-wf May 8, 2024
f0a817c
Updating overrides for crypto
grantnelson-wf May 8, 2024
504352d
Some native overrides for go1.20
grantnelson-wf May 8, 2024
ce3f8cc
Merge branch 'nativesBatch2' of github.com:Workiva/gopherjs into work…
grantnelson-wf May 8, 2024
5c48676
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf May 13, 2024
25731b0
Some native overrides for go1.20
grantnelson-wf May 8, 2024
cecb4e6
Merge branch 'nativesBatch2' of github.com:Workiva/gopherjs into work…
grantnelson-wf May 15, 2024
f6a2036
Adding most basic override to Nat uint32 problem
grantnelson-wf May 21, 2024
a16deee
Trying a different way of solving the uint32 problem in crypto
grantnelson-wf May 21, 2024
cd12395
Merge branch 'master' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf May 23, 2024
6034a76
Merge branch 'atomicPntrOverrides' of github.com:Workiva/gopherjs int…
grantnelson-wf May 23, 2024
8d751cc
Merge branch 'g1.20overridesA' of github.com:Workiva/gopherjs into wo…
grantnelson-wf May 23, 2024
397c611
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf May 28, 2024
8d140c0
Merge branch 'updatingCrypto' of github.com:Workiva/gopherjs into wor…
grantnelson-wf May 28, 2024
3db0eca
Working on setUpdate
grantnelson-wf May 28, 2024
2099c41
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf May 29, 2024
459eda4
Fixing name
grantnelson-wf May 29, 2024
c0877f6
Reworking setUpdate
grantnelson-wf May 29, 2024
421ffbf
Updating setUpdate godebug
grantnelson-wf May 29, 2024
ce0b73b
Cleaned up godebug
grantnelson-wf May 30, 2024
46f5363
Fix indents
grantnelson-wf May 30, 2024
c3a6441
Fixing AnyOverlap
grantnelson-wf May 31, 2024
4ca1283
Fixing AnyOverlap
grantnelson-wf May 31, 2024
3bcfdd3
Fixing AnyOverlap
grantnelson-wf May 31, 2024
44d6401
Fixing AnyOverlap
grantnelson-wf May 31, 2024
8d32c49
Fixing AnyOverlap
grantnelson-wf May 31, 2024
834e190
Fixing AnyOverlap
grantnelson-wf May 31, 2024
be1cb06
Fixing env watcher for godebug
grantnelson-wf May 31, 2024
e08899b
Merge branch 'godebugUpdate' of github.com:Workiva/gopherjs into work…
grantnelson-wf May 31, 2024
def9bca
Fixing AnyOverlap
grantnelson-wf May 31, 2024
00bd305
Fixing AnyOverlap
grantnelson-wf May 31, 2024
ee079de
Fixing AnyOverlap
grantnelson-wf May 31, 2024
4580bf0
Fixing AnyOverlap
grantnelson-wf May 31, 2024
b0753a9
Fixing AnyOverlap
grantnelson-wf May 31, 2024
e351689
Fixing AnyOverlap
grantnelson-wf May 31, 2024
394cf53
Adding reflect Grow
grantnelson-wf May 31, 2024
46429a4
Merge branch 'updateAnyOverlap' of github.com:Workiva/gopherjs into w…
grantnelson-wf May 31, 2024
352005b
Merge branch 'godebugUpdate' of github.com:Workiva/gopherjs into work…
grantnelson-wf Jun 3, 2024
d136379
Removing old stuff
grantnelson-wf Jun 3, 2024
9ba1ca2
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Jun 3, 2024
94c5321
Filling out Value.Grow
grantnelson-wf Jun 3, 2024
40aa2e1
Working on Grow
grantnelson-wf Jun 4, 2024
cc57095
Merge branch 'master' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Jun 4, 2024
a2e80ed
Working on Grow
grantnelson-wf Jun 4, 2024
5610925
Adding reflect Grow
grantnelson-wf Jun 4, 2024
d911660
Merge branch 'addReflectGrow' of github.com:Workiva/gopherjs into wor…
grantnelson-wf Jun 4, 2024
9ee247c
bump
grantnelson-wf Jun 4, 2024
ad9f304
Working on growSlice issue
grantnelson-wf Jun 4, 2024
b3c0b51
Working on growSlice issue
grantnelson-wf Jun 4, 2024
3e85ba5
Working on growSlice issue
grantnelson-wf Jun 4, 2024
9bac56a
Working on growSlice issue
grantnelson-wf Jun 4, 2024
05a24f8
Working on growSlice issue
grantnelson-wf Jun 4, 2024
76345b1
Working on growSlice issue
grantnelson-wf Jun 4, 2024
4851d0d
Working on Append
grantnelson-wf Jun 4, 2024
10fb108
Merge branch 'addReflectGrow' of github.com:Workiva/gopherjs into wor…
grantnelson-wf Jun 4, 2024
3a8ee85
Working on extendSlice
grantnelson-wf Jun 4, 2024
98d2501
Working on reflect and removing unsafeheader
grantnelson-wf Jun 6, 2024
2653c4e
Working on reflect
grantnelson-wf Jun 6, 2024
db7f7a3
Working on reflect
grantnelson-wf Jun 6, 2024
545b7d5
Debugging grow and field
grantnelson-wf Jun 11, 2024
8dcc666
Oops, removing js file
grantnelson-wf Jun 11, 2024
595cc0c
Debugging nil growth
grantnelson-wf Jun 12, 2024
6b0017e
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Jun 12, 2024
b3a013b
Updating tests
grantnelson-wf Jun 12, 2024
15d522c
Merge branch 'addReflectGrow' of github.com:Workiva/gopherjs into wor…
grantnelson-wf Jun 12, 2024
7a79c9c
Implemented SemacquireRWMutex
grantnelson-wf Jun 13, 2024
5fea1c7
Made changes per suggestions and help
grantnelson-wf Jun 26, 2024
60ca3ef
Merge branch 'addReflectGrow' of github.com:Workiva/gopherjs into wor…
grantnelson-wf Jun 26, 2024
40c0b52
Working on reflect for go1.20
grantnelson-wf Jun 26, 2024
4037511
fixing cvtSliceArray
grantnelson-wf Jun 28, 2024
a3162a6
Trying to figure out cvtSliceArray
grantnelson-wf Jul 1, 2024
0990476
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Jul 2, 2024
bf66c71
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Jul 8, 2024
42acfc2
Moving from CircleCI to GHA
grantnelson-wf Jun 20, 2024
fb81bbe
Merge branch 'fixingMoreReflect' of github.com:Workiva/gopherjs into …
grantnelson-wf Jul 11, 2024
54c2172
Appear to have gotten cvtSliceArray working
grantnelson-wf Jul 12, 2024
837c24a
Fixed UnsafePointer to use Pointer
grantnelson-wf Jul 12, 2024
f8d823b
Merge branch 'add2Reflects' of github.com:Workiva/gopherjs into worki…
grantnelson-wf Jul 12, 2024
d8fba87
Merge branch 'add3Reflects' of github.com:Workiva/gopherjs into worki…
grantnelson-wf Jul 12, 2024
424d10e
fixed encoding/gob
grantnelson-wf Jul 15, 2024
c883b7a
Merge branch 'fixGob' of github.com:Workiva/gopherjs into workingOnGo20
grantnelson-wf Jul 15, 2024
3aa58ea
Merge branch 'gha2' of github.com:Workiva/gopherjs into workingOnGo20
grantnelson-wf Jul 16, 2024
9c14c4c
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Jul 16, 2024
5427c56
Changed repreat code back to go1.19 implementation
grantnelson-wf Jul 16, 2024
d157d13
Changing repeat to use JS
grantnelson-wf Jul 16, 2024
d397c8f
Going back to go1.19 version of repeat
grantnelson-wf Jul 16, 2024
68b79a0
Adding fail-fast: false to the CI
grantnelson-wf Jul 17, 2024
7c6b932
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Jul 17, 2024
df5759f
Merge branch 'repeatStringRepeat' of github.com:Workiva/gopherjs into…
grantnelson-wf Jul 17, 2024
e9984b7
Merge branch 'gha2' of github.com:Workiva/gopherjs into workingOnGo20
grantnelson-wf Jul 17, 2024
c2085a8
Added generics to measure-size.yml
grantnelson-wf Jul 17, 2024
1ad55ee
Added test showing issue in compiler conversion
grantnelson-wf Jul 17, 2024
da96406
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Jul 17, 2024
7887c96
Merge branch 'master' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Jul 17, 2024
93996d1
Skipping some bad tests in crypto/tls
grantnelson-wf Jul 18, 2024
707213e
Factor out unimplemented function translation.
nevkontakte Feb 19, 2023
0ee97fe
Remove a special case for methods with array-pointer receivers.
nevkontakte Mar 11, 2023
06e8925
Refactor method translation code.
nevkontakte Jul 20, 2024
d16c974
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Jul 22, 2024
5659271
Simplifying the array slice test
grantnelson-wf Jul 22, 2024
b7cb883
Merge branch 'fixMeasureSizeCI' of github.com:Workiva/gopherjs into w…
grantnelson-wf Jul 23, 2024
8c7c8cf
Merge branch 'master' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Jul 23, 2024
4e8dd64
Added copy from slice to array's copy
grantnelson-wf Jul 23, 2024
131f9e0
Adding slice to array conversion
grantnelson-wf Jul 23, 2024
effe0d6
made the test more readable
grantnelson-wf Jul 23, 2024
76bff9e
added copy from slice to array copy
grantnelson-wf Jul 23, 2024
d34d43d
Merge branch 'sliceToArrayCast' of github.com:Workiva/gopherjs into w…
grantnelson-wf Jul 23, 2024
7df3b21
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Jul 24, 2024
7c62ec8
Removing generic overrides from atomic
grantnelson-wf Jul 24, 2024
bdfd4dc
Removing generic overrides from atomic tests
grantnelson-wf Jul 24, 2024
bb9cf54
removed generic overrides from time
grantnelson-wf Jul 24, 2024
46f0310
removed generics from testing.
grantnelson-wf Jul 24, 2024
ba56db7
Removing generics from sync's map
grantnelson-wf Jul 24, 2024
1c46eb5
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Jul 24, 2024
86b7d8f
Merge branch 'bumpMaster4' of github.com:Workiva/gopherjs into workin…
grantnelson-wf Jul 24, 2024
a50185a
Removing generics overrides from reflect
grantnelson-wf Jul 24, 2024
3e48ee9
Removing generic overrides from net/netip
grantnelson-wf Jul 24, 2024
8bef672
Removing generic overrides from reflectlite
grantnelson-wf Jul 24, 2024
d41aa89
Removing generic overrides from encoding/gob
grantnelson-wf Jul 24, 2024
695b130
Removing generic overrides from internal/godebug
grantnelson-wf Jul 24, 2024
7293b47
Removing generic overrides from go/token
grantnelson-wf Jul 24, 2024
f2a4bec
Removing generic override from go/doc
grantnelson-wf Jul 24, 2024
e125af9
Removing generic overrides from crypto
grantnelson-wf Jul 24, 2024
4a02426
Merge branch 'go1.20' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Jul 25, 2024
a566fde
Exploring DCE
grantnelson-wf Jul 30, 2024
a84e705
Encapsulating DCE
grantnelson-wf Jul 31, 2024
77f03af
Encapsulating DCE
grantnelson-wf Jul 31, 2024
dff6f62
Encapsulating DCE
grantnelson-wf Jul 31, 2024
a681fc1
Encapsulating DCE
grantnelson-wf Jul 31, 2024
3a9e67e
Encapsulating DCE
grantnelson-wf Jul 31, 2024
6770879
Remove uglify-es from package.json.
nevkontakte Jul 31, 2024
22c65b8
Use Node's native source map support instead of a third-party module.
nevkontakte Jul 31, 2024
97dc96a
Moving DCE to isolate filter naming
grantnelson-wf Jul 31, 2024
df21a88
Merge branch 'encapDCE' of github.com:Workiva/gopherjs into workingOn…
grantnelson-wf Jul 31, 2024
0390b03
Merge pull request #1336 from nevkontakte/drop-deps
nevkontakte Aug 1, 2024
9fc41fa
Moving DCE to isolate filter naming
grantnelson-wf Jul 31, 2024
42f9041
Merge branch 'encapDCE' of github.com:Workiva/gopherjs into workingOn…
grantnelson-wf Aug 1, 2024
e4bdb62
Remove old dceInfo file
grantnelson-wf Aug 1, 2024
d5771cc
Assign identity to all function literals and use them as funcRefs.
nevkontakte Jul 20, 2024
4ebc56c
Temporarily disable reflect tests that depend on caller function names.
nevkontakte Aug 3, 2024
1ebb325
Merge pull request #1335 from nevkontakte/gng7
nevkontakte Aug 3, 2024
faed822
Learning more about the DCE
grantnelson-wf Aug 5, 2024
a802b89
Moving DCE to isolate filter naming
grantnelson-wf Jul 31, 2024
45cd8a5
Merge branch 'encapDCE' of github.com:Workiva/gopherjs into workingOn…
grantnelson-wf Aug 8, 2024
b82553d
Merge branch 'master' of github.com:gopherjs/gopherjs into workingOnGo20
grantnelson-wf Aug 9, 2024
790baaa
In progress with an update to DCE
grantnelson-wf Aug 9, 2024
cacbfcf
Moving DCE to isolate filter naming
grantnelson-wf Jul 31, 2024
75705a6
Merge branch 'encapDCE' of github.com:Workiva/gopherjs into workingOn…
grantnelson-wf Aug 9, 2024
bb30788
In progress with an update to DCE
grantnelson-wf Aug 9, 2024
9b8c285
Rolling back using only objects
grantnelson-wf Aug 12, 2024
7613ba5
Fixed a typo
grantnelson-wf Aug 12, 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
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@ _Note: GopherJS will try to write compiled object files of the core packages to

#### gopherjs run, gopherjs test

If you want to use `gopherjs run` or `gopherjs test` to run the generated code locally, install Node.js 10.0.0 (or newer), and the `source-map-support` module:

```
npm install --global source-map-support
```
If you want to use `gopherjs run` or `gopherjs test` to run the generated code locally, install Node.js 18 (or newer).

On supported `GOOS` platforms, it's possible to make system calls (file system access, etc.) available. See [doc/syscalls.md](https://github.com/gopherjs/gopherjs/blob/master/doc/syscalls.md) for instructions on how to do so.

Expand Down
57 changes: 6 additions & 51 deletions compiler/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"strings"
"time"

"github.com/gopherjs/gopherjs/compiler/internal/dce"
"github.com/gopherjs/gopherjs/compiler/prelude"
"golang.org/x/tools/go/gcexportdata"
)
Expand Down Expand Up @@ -125,12 +126,6 @@ func ImportDependencies(archive *Archive, importPkg func(string) (*Archive, erro
return deps, nil
}

type dceInfo struct {
decl *Decl
objectFilter string
methodFilter string
}

func WriteProgramCode(pkgs []*Archive, w *SourceMapFilter, goVersion string) error {
mainPkg := pkgs[len(pkgs)-1]
minify := mainPkg.Minified
Expand All @@ -141,61 +136,21 @@ func WriteProgramCode(pkgs []*Archive, w *SourceMapFilter, goVersion string) err
gls.Add(pkg.GoLinknames)
}

byFilter := make(map[string][]*dceInfo)
var pendingDecls []*Decl // A queue of live decls to find other live decls.
sel := &dce.Selector[*Decl]{}
for _, pkg := range pkgs {
for _, d := range pkg.Declarations {
if d.DceObjectFilter == "" && d.DceMethodFilter == "" {
// This is an entry point (like main() or init() functions) or a variable
// initializer which has a side effect, consider it live.
pendingDecls = append(pendingDecls, d)
continue
}
implementsLink := false
if gls.IsImplementation(d.LinkingName) {
// If a decl is referenced by a go:linkname directive, we just assume
// it's not dead.
// TODO(nevkontakte): This is a safe, but imprecise assumption. We should
// try and trace whether the referencing functions are actually live.
pendingDecls = append(pendingDecls, d)
}
info := &dceInfo{decl: d}
if d.DceObjectFilter != "" {
info.objectFilter = pkg.ImportPath + "." + d.DceObjectFilter
byFilter[info.objectFilter] = append(byFilter[info.objectFilter], info)
}
if d.DceMethodFilter != "" {
info.methodFilter = pkg.ImportPath + "." + d.DceMethodFilter
byFilter[info.methodFilter] = append(byFilter[info.methodFilter], info)
}
}
}

dceSelection := make(map[*Decl]struct{}) // Known live decls.
for len(pendingDecls) != 0 {
d := pendingDecls[len(pendingDecls)-1]
pendingDecls = pendingDecls[:len(pendingDecls)-1]

dceSelection[d] = struct{}{} // Mark the decl as live.

// Consider all decls the current one is known to depend on and possible add
// them to the live queue.
for _, dep := range d.DceDeps {
if infos, ok := byFilter[dep]; ok {
delete(byFilter, dep)
for _, info := range infos {
if info.objectFilter == dep {
info.objectFilter = ""
}
if info.methodFilter == dep {
info.methodFilter = ""
}
if info.objectFilter == "" && info.methodFilter == "" {
pendingDecls = append(pendingDecls, info.decl)
}
}
implementsLink = true
}
sel.Include(d, implementsLink)
}
}
dceSelection := sel.AliveDecls()

if _, err := w.Write([]byte("\"use strict\";\n(function() {\n\n")); err != nil {
return err
Expand Down
65 changes: 29 additions & 36 deletions compiler/decls.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"strings"

"github.com/gopherjs/gopherjs/compiler/analysis"
"github.com/gopherjs/gopherjs/compiler/internal/dce"
"github.com/gopherjs/gopherjs/compiler/internal/symbol"
"github.com/gopherjs/gopherjs/compiler/internal/typeparams"
"github.com/gopherjs/gopherjs/compiler/typesutil"
Expand Down Expand Up @@ -51,16 +52,8 @@ type Decl struct {
// JavaScript code that needs to be executed during the package init phase to
// set the symbol up (e.g. initialize package-level variable value).
InitCode []byte
// Symbol's identifier used by the dead-code elimination logic, not including
// package path. If empty, the symbol is assumed to be alive and will not be
// eliminated. For methods it is the same as its receiver type identifier.
DceObjectFilter string
// The second part of the identified used by dead-code elimination for methods.
// Empty for other types of symbols.
DceMethodFilter string
// List of fully qualified (including package path) DCE symbol identifiers the
// symbol depends on for dead code elimination purposes.
DceDeps []string
// dce stores the information for dead-code elimination.
dce dce.Info
// Set to true if a function performs a blocking operation (I/O or
// synchronization). The compiler will have to generate function code such
// that it can be resumed after a blocking operation completes without
Expand All @@ -78,6 +71,11 @@ func (d Decl) minify() Decl {
return d
}

// Dce gets the information for dead-code elimination.
func (d *Decl) Dce() *dce.Info {
return &d.dce
}

// topLevelObjects extracts package-level variables, functions and named types
// from the package AST.
func (fc *funcContext) topLevelObjects(srcs sources) (vars []*types.Var, functions []*ast.FuncDecl, typeNames typesutil.TypeNames) {
Expand Down Expand Up @@ -161,11 +159,13 @@ func (fc *funcContext) importDecls() (importedPaths []string, importDecls []*Dec
// newImportDecl registers the imported package and returns a Decl instance for it.
func (fc *funcContext) newImportDecl(importedPkg *types.Package) *Decl {
pkgVar := fc.importedPkgVar(importedPkg)
return &Decl{
d := &Decl{
Vars: []string{pkgVar},
DeclCode: []byte(fmt.Sprintf("\t%s = $packages[\"%s\"];\n", pkgVar, importedPkg.Path())),
InitCode: fc.CatchOutput(1, func() { fc.translateStmt(fc.importInitializer(importedPkg.Path()), nil) }),
}
d.Dce().SetAsAlive()
return d
}

// importInitializer calls the imported package $init() function to ensure it is
Expand Down Expand Up @@ -241,7 +241,7 @@ func (fc *funcContext) newVarDecl(init *types.Initializer) *Decl {
}
}

d.DceDeps = fc.CollectDCEDeps(func() {
fc.pkgCtx.CollectDCEDeps(&d, func() {
fc.localVars = nil
d.InitCode = fc.CatchOutput(1, func() {
fc.translateStmt(&ast.AssignStmt{
Expand All @@ -257,10 +257,9 @@ func (fc *funcContext) newVarDecl(init *types.Initializer) *Decl {
fc.localVars = nil // Clean up after ourselves.
})

if len(init.Lhs) == 1 {
if !analysis.HasSideEffect(init.Rhs, fc.pkgCtx.Info.Info) {
d.DceObjectFilter = init.Lhs[0].Name()
}
d.Dce().SetName(init.Lhs[0])
if len(init.Lhs) != 1 || analysis.HasSideEffect(init.Rhs, fc.pkgCtx.Info.Info) {
d.Dce().SetAsAlive()
}
return &d
}
Expand All @@ -280,9 +279,8 @@ func (fc *funcContext) funcDecls(functions []*ast.FuncDecl) ([]*Decl, error) {
if fun.Recv == nil {
// Auxiliary decl shared by all instances of the function that defines
// package-level variable by which they all are referenced.
// TODO(nevkontakte): Set DCE attributes such that it is eliminated if all
// instances are dead.
varDecl := Decl{}
varDecl.Dce().SetName(o)
varDecl.Vars = []string{fc.objectName(o)}
if o.Type().(*types.Signature).TypeParams().Len() != 0 {
varDecl.DeclCode = fc.CatchOutput(0, func() {
Expand Down Expand Up @@ -322,30 +320,26 @@ func (fc *funcContext) newFuncDecl(fun *ast.FuncDecl, inst typeparams.Instance)
Blocking: fc.pkgCtx.IsBlocking(o),
LinkingName: symbol.New(o),
}
d.Dce().SetName(o)

if typesutil.IsMethod(o) {
recv := typesutil.RecvType(o.Type().(*types.Signature)).Obj()
d.NamedRecvType = fc.objectName(recv)
d.DceObjectFilter = recv.Name()
if !fun.Name.IsExported() {
d.DceMethodFilter = o.Name() + "~"
}
} else {
d.RefExpr = fc.instName(inst)
d.DceObjectFilter = o.Name()
switch o.Name() {
case "main":
if fc.pkgCtx.isMain() { // Found main() function of the program.
d.DceObjectFilter = "" // Always reachable.
d.Dce().SetAsAlive() // Always reachable.
}
case "init":
d.InitCode = fc.CatchOutput(1, func() { fc.translateStmt(fc.callInitFunc(o), nil) })
d.DceObjectFilter = "" // init() function is always reachable.
d.Dce().SetAsAlive() // init() function is always reachable.
}
}

d.DceDeps = fc.CollectDCEDeps(func() {
d.DeclCode = fc.translateTopLevelFunction(fun, inst)
fc.pkgCtx.CollectDCEDeps(d, func() {
d.DeclCode = fc.namedFuncContext(inst).translateTopLevelFunction(fun)
})
return d
}
Expand Down Expand Up @@ -455,10 +449,9 @@ func (fc *funcContext) newNamedTypeInstDecl(inst typeparams.Instance) (*Decl, er
}

underlying := instanceType.Underlying()
d := &Decl{
DceObjectFilter: inst.Object.Name(),
}
d.DceDeps = fc.CollectDCEDeps(func() {
d := &Decl{}
d.Dce().SetName(inst.Object)
fc.pkgCtx.CollectDCEDeps(d, func() {
// Code that declares a JS type (i.e. prototype) for each Go type.
d.DeclCode = fc.CatchOutput(0, func() {
size := int64(0)
Expand Down Expand Up @@ -577,14 +570,14 @@ func (fc *funcContext) anonTypeDecls(anonTypes []*types.TypeName) []*Decl {
}
decls := []*Decl{}
for _, t := range anonTypes {
d := Decl{
Vars: []string{t.Name()},
DceObjectFilter: t.Name(),
d := &Decl{
Vars: []string{t.Name()},
}
d.DceDeps = fc.CollectDCEDeps(func() {
d.Dce().SetName(t)
fc.pkgCtx.CollectDCEDeps(d, func() {
d.DeclCode = []byte(fmt.Sprintf("\t%s = $%sType(%s);\n", t.Name(), strings.ToLower(typeKind(t.Type())[5:]), fc.initArgs(t.Type())))
})
decls = append(decls, &d)
decls = append(decls, d)
}
return decls
}
11 changes: 4 additions & 7 deletions compiler/expressions.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func (fc *funcContext) translateExpr(expr ast.Expr) *expression {
}

case *ast.FuncLit:
fun := fc.nestedFunctionContext(fc.pkgCtx.FuncLitInfos[e], exprType.(*types.Signature), typeparams.Instance{}).translateFunctionBody(e.Type, nil, e.Body, "")
fun := fc.literalFuncContext(e).translateFunctionBody(e.Type, nil, e.Body)
if len(fc.pkgCtx.escapingVars) != 0 {
names := make([]string, 0, len(fc.pkgCtx.escapingVars))
for obj := range fc.pkgCtx.escapingVars {
Expand Down Expand Up @@ -592,7 +592,7 @@ func (fc *funcContext) translateExpr(expr ast.Expr) *expression {
return fc.formatExpr(`$methodVal(%s, "%s")`, fc.makeReceiver(e), sel.Obj().(*types.Func).Name())
case types.MethodExpr:
if !sel.Obj().Exported() {
fc.DeclareDCEDep(sel.Obj())
fc.pkgCtx.DeclareDCEDep(sel.Obj())
}
if _, ok := sel.Recv().Underlying().(*types.Interface); ok {
return fc.formatExpr(`$ifaceMethodExpr("%s")`, sel.Obj().(*types.Func).Name())
Expand Down Expand Up @@ -730,10 +730,7 @@ func (fc *funcContext) translateExpr(expr ast.Expr) *expression {
}
}

methodName := sel.Obj().Name()
if reservedKeywords[methodName] {
methodName += "$"
}
methodName := fc.methodName(sel.Obj().(*types.Func))
return fc.translateCall(e, sig, fc.formatExpr("%s.%s", recv, methodName))

case types.FieldVal:
Expand Down Expand Up @@ -911,7 +908,7 @@ func (fc *funcContext) delegatedCall(expr *ast.CallExpr) (callable *expression,
func (fc *funcContext) makeReceiver(e *ast.SelectorExpr) *expression {
sel, _ := fc.selectionOf(e)
if !sel.Obj().Exported() {
fc.DeclareDCEDep(sel.Obj())
fc.pkgCtx.DeclareDCEDep(sel.Obj())
}

x := e.X
Expand Down
Loading
Loading