From patchwork Fri Mar 30 21:27:15 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: 149756 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 63464B6EEC for ; Sat, 31 Mar 2012 08:27:39 +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=1333747660; h=Comment: DomainKey-Signature:Received: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=/tPtmol/4WV1I0Ga7K8tVpzHZqk=; b=ikwLtHv6N8dREaZ ji+PTPPn+8MFR6lcXrJycKwHdijYNcRmBj05DpIFnQGdRap9PA4o7/6zyPvJiors 0wh9sZo7Iv2raf+RAaa+n4QVBQjMI+x3V+31gaDFFFYzNzHFMMwlZOcgzbRGnZD7 xnM4+Gwisn5BE5+BrfCL7T7NEsBU= 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: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=xW7YKYQfkjfkHny3cdmOlV1q2UdbYrPQic/iQ2NK4YBX94WpCTeuCGaRm94dSp S5Q9LN0jZ4KFqMcoEzR6ytxA+ARNVDnIIQgq20yQCJcyDc+3ot4GtZ5Ccea7jvpB 7zAai/CDfQ+EWb+wNamlSvcBld5vAscBlIQrSlehyKYVE=; Received: (qmail 24220 invoked by alias); 30 Mar 2012 21:27:35 -0000 Received: (qmail 24212 invoked by uid 22791); 30 Mar 2012 21:27:34 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_CV, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mail-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Mar 2012 21:27:21 +0000 Received: by iaag37 with SMTP id g37so1619178iaa.20 for ; Fri, 30 Mar 2012 14:27:21 -0700 (PDT) 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=/EbZ4bswzVS6Fq6Wc/kMwo/OZfCfBCyydKk1+a1o3s8=; b=TAzZHUDXEXeHW3LolzRJoUr0OSaGfRfAjfEx7bn4OAcoy40D9fv6pjJtlVrdSej8KS Oculnl7y26TuJMEjjgVYpS1XVDduaj5nuOzI1K4AuPBeEsQzyR2UCad9z4HLpWFmJlFj XZiONISoJtdVBCK4JV+ytmyyEyMbJgRKjPbWg6pCVQDVoj1NL/AXt7/+O6pvgvylCMAC OLa0wP2P2Rna5544tT8Rt4DfVgs0Z3UQPoVY7Oaf7O9+ercOZNeNz1HgwchMXU62biA6 B8e64Y+CLWBKP06uSJ/EnoW+ojZMxSrbONJ4BHhQTR72rwo+3Qp/uVbP7MuwhHg5GSQD itBg== Received: by 10.50.156.135 with SMTP id we7mr37108igb.0.1333142841050; Fri, 30 Mar 2012 14:27:21 -0700 (PDT) Received: by 10.50.156.135 with SMTP id we7mr37097igb.0.1333142840962; Fri, 30 Mar 2012 14:27:20 -0700 (PDT) Received: from coign.google.com ([2620:0:1000:2301:f2de:f1ff:fe40:72a8]) by mx.google.com with ESMTPS id yg2sm3322953igb.12.2012.03.30.14.27.19 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 30 Mar 2012 14:27:20 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: libgo patch committed: Update to weekly.2012-03-13 Date: Fri, 30 Mar 2012 14:27:15 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQm+a4+h70TPoP/S+w/W23kG6zthEmyMa7nxCdCozYJibyF/z9R5QfJHzmWtWkJechqRdYCOD6yXtN5n+TbwLBo7ogkX4MPO/dsktrW6heQyOgHSpP9/RKuEqI1M9/EB40hZuA+CeKSkpoqbv3zwpkgT1LLDmJdfr8OFJIvhYWz49S/EA6s= 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 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 -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);