From patchwork Wed Dec 12 23:13:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 205683 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id CF1732C008A for ; Thu, 13 Dec 2012 10:13:46 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1355958827; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=8+JKuVk hKXt6J6lt5U6GWX0SZho=; b=jDAy7ISMVhe2vWbLHHQITwu/lvSXOUCAWZEvlXc v8/tPzdWxFGGldTI8Z02TRwr8skQrj+g31uAChU/ThxEoky5rYfEe0NV1nxeJ2n4 c6ROTIPIbyzr0mXKoWI1PIfMJ9dQrKigBn0Gzoy9BcYYH7uVt+rxAe4NE8QMTrDX +lC8= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=TIBBA/XoFQwjF2pQXwAkMSb+En8lbbpT2DCZIQl+GRLMKlUGBE6yH5Fm8TYs0a Ib8Cl8Sc16//myzoJxBm2pp4a763dWLUE0cKRLsETZ6cQDf0hM9Fo4BaAitxbMaZ mMpH8kh+uJaX+YDXxkkR0hyfbR3/MWTU+SPkRK2MGSqi0=; Received: (qmail 12534 invoked by alias); 12 Dec 2012 23:13:41 -0000 Received: (qmail 12523 invoked by uid 22791); 12 Dec 2012 23:13:40 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mail-pb0-f47.google.com (HELO mail-pb0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Dec 2012 23:13:35 +0000 Received: by mail-pb0-f47.google.com with SMTP id un1so929685pbc.20 for ; Wed, 12 Dec 2012 15:13:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type:x-gm-message-state; bh=pVgqiMMdCfTEUr19UjlI8o7SbNbhBkYM23hWjssDGQY=; b=SZ22irbPAAoX2A0e/UaNCskGmEUscQczxwfsBE3rY3+1BQ2pgxw2ttbtwDo4smOjui AB5Qa/8T66aRX1kzfPBG3552gYSqiYhwXJKBxLiBGFufY8NnRWyGVnVu7G7U6ObyQaLu cQibPLUlKJHcj5O0bsc6oAjHLK1q2V1kSDvMyuB9+0+BG5ut06wZy8Z9U3I46kS/eACO zPPQXzkiCYnfZpobcEoIn66g/n8POwkXcssSxbAcXWpFvebvVfuHYxk/AeJ0lUamt6ZU RNoU4EBAk/2xXhPCIcUxbckGfRbu3TVUeq4mrfpnzVX5bAXjBx+GE+50g5Mg8SSgg/JQ Eo3Q== Received: by 10.66.86.71 with SMTP id n7mr391566paz.77.1355354014885; Wed, 12 Dec 2012 15:13:34 -0800 (PST) Received: from coign.google.com ([2620:0:1000:1804:224:d7ff:fe8f:f634]) by mx.google.com with ESMTPS id rq7sm16366429pbc.69.2012.12.12.15.13.33 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Dec 2012 15:13:34 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: libgo patch committed: Update to current library Date: Wed, 12 Dec 2012 15:13:32 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQm39O9eCehh+l+dSug0p8gruHlOlKO8cYStZHJENOyYFPR4iKoOtmXeMUkbtwHFMwmwRBc5pTnqbVdv8YpcpCySuo7Ni+DVJx4Eqam8eJLCUYI/fW2EzNGj3AAaX6ZtMdCTpYlvvJrXCimDTZPCXsR6iroSJYbBM0KSUnR2Dou2B9EKzoXlFzYK6ZVEetb/iKA2pF9S X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org I've updated libgo to the current master Go library sources. As usual this e-mail only includes patches to files that are substantially specific to gccgo. The bulk of the patch is available from the repository or from the master Go repository. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r ddfa689e6405 libgo/MERGE --- a/libgo/MERGE Wed Dec 05 20:09:59 2012 -0800 +++ b/libgo/MERGE Wed Dec 12 15:03:42 2012 -0800 @@ -1,4 +1,4 @@ -a070de932857 +c031aa767edf The first line of this file holds the Mercurial revision number of the last merge done from the master library sources. diff -r ddfa689e6405 libgo/Makefile.am --- a/libgo/Makefile.am Wed Dec 05 20:09:59 2012 -0800 +++ b/libgo/Makefile.am Wed Dec 12 15:03:42 2012 -0800 @@ -221,6 +221,7 @@ toolexeclibgoexpdir = $(toolexeclibgodir)/exp toolexeclibgoexp_DATA = \ + exp/cookiejar.gox \ exp/ebnf.gox \ exp/html.gox \ $(exp_inotify_gox) \ @@ -251,6 +252,7 @@ go/ast.gox \ go/build.gox \ go/doc.gox \ + go/format.gox \ go/parser.gox \ go/printer.gox \ go/scanner.gox \ @@ -1194,6 +1196,9 @@ go/encoding/xml/typeinfo.go \ go/encoding/xml/xml.go +go_exp_cookiejar_files = \ + go/exp/cookiejar/jar.go \ + go/exp/cookiejar/storage.go go_exp_ebnf_files = \ go/exp/ebnf/ebnf.go \ go/exp/ebnf/parser.go @@ -1284,6 +1289,8 @@ go/go/doc/filter.go \ go/go/doc/reader.go \ go/go/doc/synopsis.go +go_go_format_files = \ + go/go/format/format.go go_go_parser_files = \ go/go/parser/interface.go \ go/go/parser/parser.go @@ -1384,6 +1391,7 @@ go_mime_multipart_files = \ go/mime/multipart/formdata.go \ go/mime/multipart/multipart.go \ + go/mime/multipart/quotedprintable.go \ go/mime/multipart/writer.go go_net_http_files = \ @@ -1456,6 +1464,7 @@ go_os_user_files = \ go/os/user/user.go \ + go/os/user/lookup.go \ go/os/user/lookup_unix.go go_path_filepath_files = \ @@ -1822,6 +1831,7 @@ encoding/json.lo \ encoding/pem.lo \ encoding/xml.lo \ + exp/cookiejar.lo \ exp/ebnf.lo \ exp/html.lo \ exp/html/atom.lo \ @@ -1836,6 +1846,7 @@ go/ast.lo \ go/build.lo \ go/doc.lo \ + go/format.lo \ go/parser.lo \ go/printer.lo \ go/scanner.lo \ @@ -2658,6 +2669,15 @@ @$(CHECK) .PHONY: encoding/xml/check +@go_include@ exp/cookiejar.lo.dep +exp/cookiejar.lo.dep: $(go_exp_cookiejar_files) + $(BUILDDEPS) +exp/cookiejar.lo: $(go_exp_cookiejar_files) + $(BUILDPACKAGE) +exp/cookiejar/check: $(CHECK_DEPS) + @$(CHECK) +.PHONY: exp/cookiejar/check + @go_include@ exp/ebnf.lo.dep exp/ebnf.lo.dep: $(go_exp_ebnf_files) $(BUILDDEPS) @@ -2802,6 +2822,15 @@ @$(CHECK) .PHONY: go/doc/check +@go_include@ go/format.lo.dep +go/format.lo.dep: $(go_go_format_files) + $(BUILDDEPS) +go/format.lo: $(go_go_format_files) + $(BUILDPACKAGE) +go/format/check: $(CHECK_DEPS) + @$(CHECK) +.PHONY: go/format/check + @go_include@ go/parser.lo.dep go/parser.lo.dep: $(go_go_parser_files) $(BUILDDEPS) @@ -3450,6 +3479,8 @@ encoding/xml.gox: encoding/xml.lo $(BUILDGOX) +exp/cookiejar.gox: exp/cookiejar.lo + $(BUILDGOX) exp/ebnf.gox: exp/ebnf.lo $(BUILDGOX) exp/html.gox: exp/html.lo @@ -3482,6 +3513,8 @@ $(BUILDGOX) go/doc.gox: go/doc.lo $(BUILDGOX) +go/format.gox: go/format.lo + $(BUILDGOX) go/parser.gox: go/parser.lo $(BUILDGOX) go/printer.gox: go/printer.lo @@ -3681,6 +3714,7 @@ encoding/json/check \ encoding/pem/check \ encoding/xml/check \ + exp/cookiejar/check \ exp/ebnf/check \ exp/html/check \ exp/html/atom/check \ @@ -3696,6 +3730,7 @@ go/ast/check \ $(go_build_check_omitted_since_it_calls_6g) \ go/doc/check \ + go/format/check \ go/parser/check \ go/printer/check \ go/scanner/check \ diff -r ddfa689e6405 libgo/runtime/chan.c --- a/libgo/runtime/chan.c Wed Dec 05 20:09:59 2012 -0800 +++ b/libgo/runtime/chan.c Wed Dec 12 15:03:42 2012 -0800 @@ -197,7 +197,7 @@ runtime_lock(c); // TODO(dvyukov): add similar instrumentation to select. if(raceenabled) - runtime_racereadpc(c, pc); + runtime_racereadpc(c, pc, runtime_chansend); if(c->closed) goto closed; @@ -1271,7 +1271,7 @@ } if(raceenabled) { - runtime_racewritepc(c, runtime_getcallerpc(&c)); + runtime_racewritepc(c, runtime_getcallerpc(&c), runtime_closechan); runtime_racerelease(c); } diff -r ddfa689e6405 libgo/runtime/mgc0.c --- a/libgo/runtime/mgc0.c Wed Dec 05 20:09:59 2012 -0800 +++ b/libgo/runtime/mgc0.c Wed Dec 12 15:03:42 2012 -0800 @@ -949,6 +949,7 @@ dumpspan(spanidx); } } + void runtime_gchelper(void) { @@ -1025,16 +1026,21 @@ mstats.stacks_sys = stacks_sys; } +// Structure of arguments passed to function gc(). +// This allows the arguments to be passed via reflect_call. +struct gc_args +{ + int32 force; +}; + +static void gc(struct gc_args *args); + void runtime_gc(int32 force) { M *m; - int64 t0, t1, t2, t3; - uint64 heap0, heap1, obj0, obj1; const byte *p; - GCStats stats; - M *m1; - uint32 i; + struct gc_args a, *ap; // The atomic operations are not atomic if the uint64s // are not aligned on uint64 boundaries. This has been @@ -1074,12 +1080,37 @@ if(gcpercent < 0) return; + // Run gc on a bigger stack to eliminate + // a potentially large number of calls to runtime_morestack. + // But not when using gccgo. + a.force = force; + ap = &a; + gc(ap); + + if(gctrace > 1 && !force) { + a.force = 1; + gc(&a); + } +} + +static void +gc(struct gc_args *args) +{ + M *m; + int64 t0, t1, t2, t3; + uint64 heap0, heap1, obj0, obj1; + GCStats stats; + M *m1; + uint32 i; + runtime_semacquire(&runtime_worldsema); - if(!force && mstats.heap_alloc < mstats.next_gc) { + if(!args->force && mstats.heap_alloc < mstats.next_gc) { runtime_semrelease(&runtime_worldsema); return; } + m = runtime_m(); + t0 = runtime_nanotime(); m->gcing = 1; @@ -1181,9 +1212,6 @@ // give the queued finalizers, if any, a chance to run if(finq != nil) runtime_gosched(); - - if(gctrace > 1 && !force) - runtime_gc(1); } void runtime_ReadMemStats(MStats *) diff -r ddfa689e6405 libgo/runtime/race.h --- a/libgo/runtime/race.h Wed Dec 05 20:09:59 2012 -0800 +++ b/libgo/runtime/race.h Wed Dec 12 15:03:42 2012 -0800 @@ -20,8 +20,8 @@ void runtime_racefree(void *p); void runtime_racegostart(int32 goid, void *pc); void runtime_racegoend(int32 goid); -void runtime_racewritepc(void *addr, void *pc); -void runtime_racereadpc(void *addr, void *pc); +void runtime_racewritepc(void *addr, void *callpc, void *pc); +void runtime_racereadpc(void *addr, void *callpc, void *pc); void runtime_racefingo(void); void runtime_raceacquire(void *addr); void runtime_raceacquireg(G *gp, void *addr);