diff mbox

libgo patch committed: Update to weekly.2012-03-13

Message ID mcry5qh93v0.fsf@dhcp-172-18-216-180.mtv.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor March 30, 2012, 9:27 p.m. UTC
I have committed a patch to update libgo to the weekly.2012-03-13
release.  As usual this e-mail message only includes the changes to the
files specific to gccgo.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline and 4.7 branch.

Ian
diff mbox

Patch

diff -r 2d2ecf6f57c5 libgo/MERGE
--- a/libgo/MERGE	Fri Mar 30 14:10:10 2012 -0700
+++ b/libgo/MERGE	Fri Mar 30 14:11:58 2012 -0700
@@ -1,4 +1,4 @@ 
-f4470a54e6db
+3cdba7b0650c
 
 The first line of this file holds the Mercurial revision number of the
 last merge done from the master library sources.
diff -r 2d2ecf6f57c5 libgo/Makefile.am
--- a/libgo/Makefile.am	Fri Mar 30 14:10:10 2012 -0700
+++ b/libgo/Makefile.am	Fri Mar 30 14:11:58 2012 -0700
@@ -813,6 +813,7 @@ 
 	go/net/rpc/server.go
 
 go_runtime_files = \
+	go/runtime/compiler.go \
 	go/runtime/debug.go \
 	go/runtime/error.go \
 	go/runtime/extern.go \
@@ -843,6 +844,7 @@ 
 	go/strconv/decimal.go \
 	go/strconv/extfloat.go \
 	go/strconv/ftoa.go \
+	go/strconv/isprint.go \
 	go/strconv/itoa.go \
 	go/strconv/quote.go
 
@@ -1000,12 +1002,13 @@ 
 	go/crypto/tls/handshake_server.go \
 	go/crypto/tls/key_agreement.go \
 	go/crypto/tls/prf.go \
-	go/crypto/tls/root_unix.go \
 	go/crypto/tls/tls.go
 go_crypto_x509_files = \
 	go/crypto/x509/cert_pool.go \
 	go/crypto/x509/pkcs1.go \
 	go/crypto/x509/pkcs8.go \
+	go/crypto/x509/root.go \
+	go/crypto/x509/root_unix.go \
 	go/crypto/x509/verify.go \
 	go/crypto/x509/x509.go
 
@@ -1320,7 +1323,8 @@ 
 go_path_filepath_files = \
 	go/path/filepath/match.go \
 	go/path/filepath/path.go \
-	go/path/filepath/path_unix.go
+	go/path/filepath/path_unix.go \
+	go/path/filepath/symlink.go
 
 go_regexp_syntax_files = \
 	go/regexp/syntax/compile.go \
diff -r 2d2ecf6f57c5 libgo/runtime/malloc.goc
--- a/libgo/runtime/malloc.goc	Fri Mar 30 14:10:10 2012 -0700
+++ b/libgo/runtime/malloc.goc	Fri Mar 30 14:11:58 2012 -0700
@@ -390,6 +390,23 @@ 
 {
 	byte *p;
 
+
+	if(n > (uintptr)(h->arena_end - h->arena_used)) {
+		// We are in 32-bit mode, maybe we didn't use all possible address space yet.
+		// Reserve some more space.
+		byte *new_end;
+		uintptr needed;
+
+		needed = (uintptr)h->arena_used + n - (uintptr)h->arena_end;
+		// Round wanted arena size to a multiple of 256MB.
+		needed = (needed + (256<<20) - 1) & ~((256<<20)-1);
+		new_end = h->arena_end + needed;
+		if(new_end <= h->arena_start + MaxArena32) {
+			p = runtime_SysReserve(h->arena_end, new_end - h->arena_end);
+			if(p == h->arena_end)
+				h->arena_end = new_end;
+		}
+	}
 	if(n <= (uintptr)(h->arena_end - h->arena_used)) {
 		// Keep taking from our reservation.
 		p = h->arena_used;
@@ -411,7 +428,8 @@ 
 		return nil;
 
 	if(p < h->arena_start || (uintptr)(p+n - h->arena_start) >= MaxArena32) {
-		runtime_printf("runtime: memory allocated by OS not in usable range\n");
+		runtime_printf("runtime: memory allocated by OS (%p) not in usable range [%p,%p)\n",
+			p, h->arena_start, h->arena_start+MaxArena32);
 		runtime_SysFree(p, n);
 		return nil;
 	}
diff -r 2d2ecf6f57c5 libgo/runtime/proc.c
--- a/libgo/runtime/proc.c	Fri Mar 30 14:10:10 2012 -0700
+++ b/libgo/runtime/proc.c	Fri Mar 30 14:11:58 2012 -0700
@@ -406,7 +406,9 @@ 
 			n = maxgomaxprocs;
 		runtime_gomaxprocs = n;
 	}
-	setmcpumax(runtime_gomaxprocs);
+	// wait for the main goroutine to start before taking
+	// GOMAXPROCS into account.
+	setmcpumax(1);
 	runtime_singleproc = runtime_gomaxprocs == 1;
 
 	canaddmcpu();	// mcpu++ to account for bootstrap m
@@ -432,6 +434,8 @@ 
 	// by calling runtime.LockOSThread during initialization
 	// to preserve the lock.
 	runtime_LockOSThread();
+	// From now on, newgoroutines may use non-main threads.
+	setmcpumax(runtime_gomaxprocs);
 	runtime_sched.init = true;
 	scvg = __go_go(runtime_MHeap_Scavenger, nil);
 	main_init();
diff -r 2d2ecf6f57c5 libgo/runtime/runtime.h
--- a/libgo/runtime/runtime.h	Fri Mar 30 14:10:10 2012 -0700
+++ b/libgo/runtime/runtime.h	Fri Mar 30 14:11:58 2012 -0700
@@ -416,7 +416,6 @@ 
 /*
  * runtime c-called (but written in Go)
  */
-void	runtime_newError(String, Eface*);
 void	runtime_printany(Eface)
      __asm__("libgo_runtime.runtime.Printany");
 void	runtime_newTypeAssertionError(const String*, const String*, const String*, const String*, Eface*)
@@ -429,7 +428,6 @@ 
  */
 void	runtime_semacquire(uint32 volatile *);
 void	runtime_semrelease(uint32 volatile *);
-String	runtime_signame(int32 sig);
 int32	runtime_gomaxprocsfunc(int32 n);
 void	runtime_procyield(uint32);
 void	runtime_osyield(void);