Commit Graph

47 Commits

Author SHA1 Message Date
Ian Lance Taylor 7e56d66864 runtime: Ignore stack sizes when deciding when to GC.
This restores https://golang.org/cl/6081043 which was lost accidentally
    when updating a new version of libgo in https://golang.org/cl/22440043 .
    
    Reviewed-on: https://go-review.googlesource.com/14569

From-SVN: r227784
2015-09-15 12:32:31 +00:00
Richard Henderson 38bf819a5f compiler, reflect, runtime: Use static chain for closures.
Change from using __go_set_closure to passing the closure
value in the static chain field.  Uses new backend support for
setting the closure chain in a call from C via
__builtin_call_with_static_chain.  Uses new support in libffi
for Go closures.

The old architecture specific support for reflect.MakeFunc is
removed, replaced by the libffi support.

All work done by Richard Henderson.

	* go-gcc.cc (Gcc_backend::call_expression): Add chain_expr argument.
	(Gcc_backend::static_chain_variable): New method.

From-SVN: r219776
2015-01-16 22:58:53 +00:00
Ian Lance Taylor f8d9fa9e80 libgo, compiler: Upgrade libgo to Go 1.4, except for runtime.
This upgrades all of libgo other than the runtime package to
the Go 1.4 release.  In Go 1.4 much of the runtime was
rewritten into Go.  Merging that code will take more time and
will not change the API, so I'm putting it off for now.

There are a few runtime changes anyhow, to accomodate other
packages that rely on minor modifications to the runtime
support.

The compiler changes slightly to add a one-bit flag to each
type descriptor kind that is stored directly in an interface,
which for gccgo is currently only pointer types.  Another
one-bit flag (gcprog) is reserved because it is used by the gc
compiler, but gccgo does not currently use it.

There is another error check in the compiler since I ran
across it during testing.

gotools/:
	* Makefile.am (go_cmd_go_files): Sort entries.  Add generate.go.
	* Makefile.in: Rebuild.

From-SVN: r219627
2015-01-15 00:27:56 +00:00
Ian Lance Taylor bca4b95c4a runtime: Remove undefined references to runtime_race*.
From-SVN: r219049
2014-12-23 20:33:53 +00:00
Ian Lance Taylor f0c1b5671a runtime: Restore copyright notice accidentally removed from mgc0.c.
From-SVN: r215423
2014-09-20 20:42:59 +00:00
Chris Manghane f1d2ac4f84 compiler: Add precise type information on the heap.
* go-gcc.cc (Gcc_backend::implicit_variable): Remove init
	parameter.  Add is_hidden parameter.
	(Gcc_backend::implicit_variable_set_init): New method.
	(Gcc_backend::implicit_variable_reference): New method.

From-SVN: r214894
2014-09-03 22:56:09 +00:00
Ian Lance Taylor ab36d98dd2 runtime: Don't get confused if m changes during runtime_gc.
From-SVN: r214048
2014-08-15 22:16:55 +00:00
Ian Lance Taylor 00d86ac99f libgo: Update to Go 1.3 release.
From-SVN: r212837
2014-07-19 08:53:52 +00:00
Ian Lance Taylor 2fa39ad859 runtime: Merge master revision 19185.
This revision renames several files in the runtime directory
from .c to .goc.

From-SVN: r212472
2014-07-12 00:01:09 +00:00
Ian Lance Taylor 6736ef96ea libgo: Merge to master revision 19184.
The next revision, 19185, renames several runtime files, and
will be handled in a separate change.

From-SVN: r211328
2014-06-06 22:37:27 +00:00
Ian Lance Taylor bae90c989c libgo: Merge from revision 18783:00cce3a34d7e of master library.
This revision was committed January 7, 2014.  The next
revision deleted runtime/mfinal.c.  That will be done in a
subsequent merge.

This merge changes type descriptors to add a zero field,
pointing to a zero value for that type.  This is implemented
as a common variable.

	* go-gcc.cc (Gcc_backend::implicit_variable): Add is_common and
	alignment parameters.  Permit init parameter to be NULL.

From-SVN: r211249
2014-06-04 23:15:33 +00:00
Ian Lance Taylor a10d35a8ba libgo: Update to Go 1.2.1 release.
From-SVN: r208286
2014-03-03 20:14:52 +00:00
Ian Lance Taylor 6fbfce7841 re PR go/59866 (gccgo gc work buffer is misaligned)
PR go/59866
runtime: Force work variable in mgc0 to be aligned on 8-byte boundary.

From-SVN: r206738
2014-01-17 22:43:03 +00:00
Ian Lance Taylor abd471378c runtime: fix 32-bit malloc for pointers >= 0x80000000
The spans array is allocated in runtime_mallocinit.  On a
32-bit system the number of entries in the spans array is
MaxArena32 / PageSize, which (2U << 30) / (1 << 12) == (1 << 19).
So we are allocating an array that can hold 19 bits for an
index that can hold 20 bits.  According to the comment in the
function, this is intentional: we only allocate enough spans
(and bitmaps) for a 2G arena, because allocating more would
probably be wasteful.

But since the span index is simply the upper 20 bits of the
memory address, this scheme only works if memory addresses are
limited to the low 2G of memory.  That would be OK if we were
careful to enforce it, but we're not.  What we are careful to
enforce, in functions like runtime_MHeap_SysAlloc, is that we
always return addresses between the heap's arena_start and
arena_start + MaxArena32.

We generally get away with it because we start allocating just
after the program end, so we only run into trouble with
programs that allocate a lot of memory, enough to get past
address 0x80000000.

This changes the code that computes a span index to subtract
arena_start on 32-bit systems just as we currently do on
64-bit systems.

From-SVN: r206501
2014-01-09 23:16:56 +00:00
Ian Lance Taylor 03a231f752 runtime: Add netpoll code that uses select.
Required for Solaris support.

From-SVN: r204817
2013-11-14 20:15:04 +00:00
Ian Lance Taylor f038dae646 libgo: Update to October 24 version of master library.
From-SVN: r204466
2013-11-06 19:49:01 +00:00
Ian Lance Taylor 05a7d56678 compiler, runtime: Use runtime functions to pass closure value.
This changes the compiler and runtime to not pass a closure
value as the last argument, but to instead pass it via
__go_set_closure and retrieve it via __go_get_closure.  This
eliminates the need for function descriptor wrapper functions.
It will make it possible to retrieve the closure value in a
reflect.MakeFunc function.

From-SVN: r202233
2013-09-03 21:52:37 +00:00
Ian Lance Taylor be47d6ecef libgo: Update to Go 1.1.1.
From-SVN: r200974
2013-07-16 06:54:42 +00:00
Ian Lance Taylor fdbc38a6e8 compiler, runtime: Use function descriptors.
This changes the representation of a Go value of function type
from being a pointer to function code (like a C function
pointer) to being a pointer to a struct.  The first field of
the struct points to the function code.  The remaining fields,
if any, are the addresses of variables referenced in enclosing
functions.  For each call to a function, the address of the
function descriptor is passed as the last argument.

This lets us avoid generating trampolines, and removes the use
of writable/executable sections of the heap.

From-SVN: r200181
2013-06-18 23:49:49 +00:00
Ian Lance Taylor d6f2922e91 libgo: Update Go library to master revision 15489/921e53d4863c.
From-SVN: r195560
2013-01-29 20:52:43 +00:00
Ian Lance Taylor f6b1e65ec3 re PR go/46986 (Go is not supported on Darwin)
PR go/46986
all: prepend #__USER_LABEL_PREFIX__ to mangled Go symbols
For old-fashioned Darwin.

From-SVN: r195438
2013-01-24 19:44:23 +00:00
Ian Lance Taylor 409a5e7eb4 libgo: Update to revision 15193:6fdc1974457c of master library.
From-SVN: r194692
2012-12-22 01:15:33 +00:00
Ian Lance Taylor a42a906c42 libgo: Update to current master library sources.
From-SVN: r194460
2012-12-12 23:13:29 +00:00
Ian Lance Taylor fabcaa8df3 libgo: Update to current version of master library.
From-SVN: r193688
2012-11-21 07:03:38 +00:00
Ian Lance Taylor 4ccad563d2 libgo: Update to current sources.
From-SVN: r192704
2012-10-23 04:31:11 +00:00
Ian Lance Taylor 08a680a887 libgo: Update to Go 1.0.2 release.
From-SVN: r188943
2012-06-25 16:20:03 +00:00
Ian Lance Taylor d4dc840de4 runtime: More efficient implementation of trampolines.
From-SVN: r187899
2012-05-25 21:51:39 +00:00
Ian Lance Taylor 86ba147f54 runtime: Copy runtime_printf from other Go library.
From-SVN: r187848
2012-05-24 20:44:34 +00:00
Ian Lance Taylor f3ab5720f7 libgo: Use -fgo-pkgpath.
From-SVN: r187485
2012-05-14 22:08:42 +00:00
Ian Lance Taylor 8a72417502 runtime: Ignore stack sizes when deciding when to GC.
Also allocate heap bitmaps bit in page size units and clear
context when putting G structures on free list.

From-SVN: r186607
2012-04-20 04:58:26 +00:00
Ian Lance Taylor 593f74bbab libgo: Update to weekly.2012-03-04 release.
From-SVN: r185010
2012-03-06 17:57:23 +00:00
Ian Lance Taylor 501699af16 libgo: Update to weekly.2012-02-22 release.
From-SVN: r184819
2012-03-02 20:01:37 +00:00
Ian Lance Taylor c91e24907b runtime: Save all registers on stack for GC scan.
From-SVN: r184098
2012-02-10 15:52:37 +00:00
Ian Lance Taylor 94252f4bcc libgo: Update to weekly.2012-02-07.
From-SVN: r184034
2012-02-09 08:19:58 +00:00
Ian Lance Taylor df1304ee03 libgo: Update to weekly.2012-01-15.
From-SVN: r183539
2012-01-25 20:56:26 +00:00
Ian Lance Taylor ab61e9c4da libgo: Update to weekly.2011-11-18.
From-SVN: r182266
2011-12-12 23:40:51 +00:00
Ian Lance Taylor 737087cbc8 runtime: Multiplex goroutines onto OS threads.
From-SVN: r181772
2011-11-28 05:45:49 +00:00
Ian Lance Taylor 48e7d50e9f runtime: New lock/note implementation.
From-SVN: r181633
2011-11-22 20:24:44 +00:00
Ian Lance Taylor 5c262e9444 runtime: Use some of 6g runtime.c for easier merging.
From-SVN: r181368
2011-11-14 22:26:45 +00:00
Ian Lance Taylor 34277c5228 Introduce G structure and thread-local global g.
From-SVN: r181301
2011-11-11 21:02:48 +00:00
Ian Lance Taylor d8f412571f Update Go library to last weekly.
From-SVN: r180552
2011-10-26 23:57:58 +00:00
Ian Lance Taylor adb0401dac Update Go library to r60.
From-SVN: r178910
2011-09-16 15:47:21 +00:00
Ian Lance Taylor 9ff56c9570 Update to current version of Go library.
From-SVN: r173931
2011-05-20 00:18:15 +00:00
Ian Lance Taylor 5133f00ef8 Update to current version of Go library (revision 94d654be2064).
From-SVN: r171076
2011-03-16 23:05:44 +00:00
Ian Lance Taylor ff5f50c52c Remove the types float and complex.
Update to current version of Go library.

Update testsuite for removed types.

	* go-lang.c (go_langhook_init): Omit float_type_size when calling
	go_create_gogo.
	* go-c.h: Update declaration of go_create_gogo.

From-SVN: r169098
2011-01-21 18:19:03 +00:00
Ian Lance Taylor a4ad1c7a08 Rework locking code to split stack much less.
From-SVN: r167973
2010-12-17 06:42:06 +00:00
Ian Lance Taylor 7a9389330e Add Go frontend, libgo library, and Go testsuite.
gcc/:
	* gcc.c (default_compilers): Add entry for ".go".
	* common.opt: Add -static-libgo as a driver option.
	* doc/install.texi (Configuration): Mention libgo as an option for
	--enable-shared.  Mention go as an option for --enable-languages.
	* doc/invoke.texi (Overall Options): Mention .go as a file name
	suffix.  Mention go as a -x option.
	* doc/frontends.texi (G++ and GCC): Mention Go as a supported
	language.
	* doc/sourcebuild.texi (Top Level): Mention libgo.
	* doc/standards.texi (Standards): Add section on Go language.
	Move references for other languages into their own section.
	* doc/contrib.texi (Contributors): Mention that I contributed the
	Go frontend.
gcc/testsuite/:
	* lib/go.exp: New file.
	* lib/go-dg.exp: New file.
	* lib/go-torture.exp: New file.
	* lib/target-supports.exp (check_compile): Match // Go.

From-SVN: r167407
2010-12-03 04:34:57 +00:00