This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libgo patch committed: Expose the g variable


This libgo patch by Cherry Zhang expose the thread-local g variable.

Currently, getg is implemented in C, which loads the thread-local g
variable. The g variable is declared static in C.

This CL exposes the g variable, so it can be accessed from the Go
side. This allows the Go compiler to inline getg calls to direct
access of g.

The actual inlining is not yet implemented in gccgo, because it runs
into trouble when the address of the thread-local variable is cached
across a function call that changes threads.  We will need to develop
a mechanism to disable that caching for at least some functions.
There doesn't seem to be one currently.

Ian

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]