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

cmd/gc: use two-word representation for func #4081

Closed
rsc opened this issue Sep 14, 2012 · 6 comments
Closed

cmd/gc: use two-word representation for func #4081

rsc opened this issue Sep 14, 2012 · 6 comments
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Sep 14, 2012

Making a func two words would avoid runtime code generation for closures.
It might also make curried method expressions (issue #2280) practical.
@rsc
Copy link
Contributor Author

rsc commented Dec 10, 2012

Comment 1:

Labels changed: added size-xl.

@remyoudompheng
Copy link
Contributor

Comment 2:

Another reason to do that is that cacheflush calls during closure generation are
incredibly expensive, for example on linux/arm. See CL7062045 for an example where
removing closures from GcImporter speeds up package typechecking by 2x.

@minux
Copy link
Member

minux commented Jan 5, 2013

Comment 3:

fixing this will also reduce security surface for cgo binaries because the elimination
of executable heap.
besides, runtime.cacheflush has tripped me twice.
we just need to discuss the interaction between this and method functions:
should (T).M return a wrapper function (takes an extra closure data
parameter) or not?

@davecheney
Copy link
Contributor

Comment 4:

Are closures the only place where we use runtime.cacheflush ? If we
didn't have to support this runtime facility any more that would be a
great boon to people porting Go to new platforms. For example, how
does one do a cacheflush on plan9 ? On Solaris ?

@minux
Copy link
Member

minux commented Jan 5, 2013

Comment 5:

Re #4, yes, closure creation is the only place we use runtime.cacheflush.

@rsc
Copy link
Contributor Author

rsc commented Feb 22, 2013

Comment 9:

This issue was closed by revision b1b67a3.

Status changed to Fixed.

@rsc rsc added fixed labels Feb 22, 2013
@rsc rsc self-assigned this Feb 22, 2013
@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants