Re: libgo patch committed: Update to weekly.2012-02-22 release

2012-03-05 Thread Ian Lance Taylor
Uros Bizjak ubiz...@gmail.com writes:

 It looks that this patch introduced:

 /home/uros/gcc-build-go/x86_64-unknown-linux-gnu/32/libgo/.libs/libgo.so:
 undefined reference to `libgo_runtime.runtime.Callers'
 collect2: error: ld returned 1 exit status

 All libgo tests fail due to this undefined reference.

I guess I'm not seeing it because your system is defaulting to
-Wl,-z,now.

Fixed with this patch.  Sorry about that.

Bootstrapped on x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

diff -r 2f1b1ab1b4d9 libgo/runtime/go-callers.c
--- a/libgo/runtime/go-callers.c	Sun Mar 04 22:37:34 2012 -0800
+++ b/libgo/runtime/go-callers.c	Mon Mar 05 09:06:45 2012 -0800
@@ -55,3 +55,12 @@
   _Unwind_Backtrace (backtrace, arg);
   return arg.index;
 }
+
+int Callers (int, struct __go_open_array)
+  __asm__ (libgo_runtime.runtime.Callers);
+
+int
+Callers (int skip, struct __go_open_array pc)
+{
+  return runtime_callers (skip, (uintptr *) pc.__values, pc.__count);
+}


Re: libgo patch committed: Update to weekly.2012-02-22 release

2012-03-04 Thread Uros Bizjak
Hello!

It looks that this patch introduced:

/home/uros/gcc-build-go/x86_64-unknown-linux-gnu/32/libgo/.libs/libgo.so:
undefined reference to `libgo_runtime.runtime.Callers'
collect2: error: ld returned 1 exit status

All libgo tests fail due to this undefined reference.

Uros.


libgo patch committed: Update to weekly.2012-02-22 release

2012-03-02 Thread Ian Lance Taylor
I have committed a patch to update libgo to the weekly.2012-02-22
release.  As usual this e-mail message only includes the changes to
gccgo-specific files.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

diff -r a2b8eab75cae libgo/MERGE
--- a/libgo/MERGE	Fri Mar 02 08:23:02 2012 -0800
+++ b/libgo/MERGE	Fri Mar 02 10:14:12 2012 -0800
@@ -1,4 +1,4 @@
-43cf9b39b647
+96bd78e7d35e
 
 The first line of this file holds the Mercurial revision number of the
 last merge done from the master library sources.
diff -r a2b8eab75cae libgo/Makefile.am
--- a/libgo/Makefile.am	Fri Mar 02 08:23:02 2012 -0800
+++ b/libgo/Makefile.am	Fri Mar 02 10:14:12 2012 -0800
@@ -504,7 +504,7 @@
 	mv -f $@.tmp $@
 
 sema.c: $(srcdir)/runtime/sema.goc goc2c
-	./goc2c --gcc --go-prefix libgo_runtime $  $@.tmp
+	./goc2c --gcc --go-prefix libgo_sync $  $@.tmp
 	mv -f $@.tmp $@
 
 sigqueue.c: $(srcdir)/runtime/sigqueue.goc goc2c
@@ -847,6 +847,7 @@
 	go/sync/cond.go \
 	go/sync/mutex.go \
 	go/sync/once.go \
+	go/sync/runtime.go \
 	go/sync/rwmutex.go \
 	go/sync/waitgroup.go
 
@@ -878,6 +879,7 @@
 	go/time/tick.go \
 	go/time/time.go \
 	go/time/zoneinfo.go \
+	go/time/zoneinfo_read.go \
 	go/time/zoneinfo_unix.go
 
 go_unicode_files = \
@@ -1091,6 +1093,7 @@
 	go/exp/norm/composition.go \
 	go/exp/norm/forminfo.go \
 	go/exp/norm/input.go \
+	go/exp/norm/iter.go \
 	go/exp/norm/normalize.go \
 	go/exp/norm/readwriter.go \
 	go/exp/norm/tables.go \
@@ -1132,7 +1135,8 @@
 	go/go/doc/example.go \
 	go/go/doc/exports.go \
 	go/go/doc/filter.go \
-	go/go/doc/reader.go
+	go/go/doc/reader.go \
+	go/go/doc/synopsis.go
 go_go_parser_files = \
 	go/go/parser/interface.go \
 	go/go/parser/parser.go
@@ -1159,7 +1163,6 @@
 
 go_html_template_files = \
 	go/html/template/attr.go \
-	go/html/template/clone.go \
 	go/html/template/content.go \
 	go/html/template/context.go \
 	go/html/template/css.go \
diff -r a2b8eab75cae libgo/runtime/malloc.goc
--- a/libgo/runtime/malloc.goc	Fri Mar 02 08:23:02 2012 -0800
+++ b/libgo/runtime/malloc.goc	Fri Mar 02 10:14:12 2012 -0800
@@ -19,6 +19,7 @@
 #include go-type.h
 
 MHeap runtime_mheap;
+
 extern MStats mstats;	// defined in extern.go
 
 extern volatile int32 runtime_MemProfileRate
@@ -429,18 +430,6 @@
 	ret = runtime_mallocgc(typ-__size, flag, 1, 1);
 }
 
-func Alloc(n uintptr) (p *byte) {
-	p = runtime_malloc(n);
-}
-
-func Free(p *byte) {
-	runtime_free(p);
-}
-
-func Lookup(p *byte) (base *byte, size uintptr) {
-	runtime_mlookup(p, base, size, nil);
-}
-
 func GC() {
 	runtime_gc(1);
 }
diff -r a2b8eab75cae libgo/runtime/malloc.h
--- a/libgo/runtime/malloc.h	Fri Mar 02 08:23:02 2012 -0800
+++ b/libgo/runtime/malloc.h	Fri Mar 02 10:14:12 2012 -0800
@@ -205,6 +205,7 @@
 	uint64	heap_sys;	// bytes obtained from system
 	uint64	heap_idle;	// bytes in idle spans
 	uint64	heap_inuse;	// bytes in non-idle spans
+	uint64	heap_released;	// bytes released to the OS
 	uint64	heap_objects;	// total number of allocated objects
 
 	// Statistics about allocation of low-level fixed-size structures.
@@ -220,6 +221,7 @@
 	// Statistics about garbage collector.
 	// Protected by stopping the world during GC.
 	uint64	next_gc;	// next GC (in heap_alloc time)
+	uint64  last_gc;	// last GC (in absolute time)
 	uint64	pause_total_ns;
 	uint64	pause_ns[256];
 	uint32	numgc;
@@ -304,14 +306,16 @@
 {
 	MSpan	*next;		// in a span linked list
 	MSpan	*prev;		// in a span linked list
-	MSpan	*allnext;		// in the list of all spans
+	MSpan	*allnext;	// in the list of all spans
 	PageID	start;		// starting page number
 	uintptr	npages;		// number of pages in span
 	MLink	*freelist;	// list of free objects
 	uint32	ref;		// number of allocated objects in this span
 	uint32	sizeclass;	// size class
 	uint32	state;		// MSpanInUse etc
-	byte	*limit;	// end of data in span
+	int64   unusedsince;	// First time spotted by GC in MSpanFree state
+	uintptr npreleased;	// number of pages released to the OS
+	byte	*limit;		// end of data in span
 };
 
 void	runtime_MSpan_Init(MSpan *span, PageID start, uintptr npages);
@@ -381,6 +385,7 @@
 void	runtime_MGetSizeClassInfo(int32 sizeclass, uintptr *size, int32 *npages, int32 *nobj);
 void*	runtime_MHeap_SysAlloc(MHeap *h, uintptr n);
 void	runtime_MHeap_MapBits(MHeap *h);
+void	runtime_MHeap_Scavenger(void*);
 
 void*	runtime_mallocgc(uintptr size, uint32 flag, int32 dogc, int32 zeroed);
 int32	runtime_mlookup(void *v, byte **base, uintptr *size, MSpan **s);
@@ -406,19 +411,11 @@
 
 void	runtime_MProf_Malloc(void*, uintptr);
 void	runtime_MProf_Free(void*, uintptr);
+void	runtime_MProf_GC(void);
 void	runtime_MProf_Mark(void (*scan)(byte *, int64));
 int32	runtime_helpgc(bool*);
 void	runtime_gchelper(void);
 
-// Malloc profiling settings.
-// Must match definition in extern.go.
-enum {
-	MProf_None = 0,
-	MProf_Sample = 1,
-	MProf_All = 2,
-};
-extern int32 runtime_malloc_profile;
-
 struct __go_func_type;
 bool	runtime_getfinalizer(void *p, bool del, void