Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(639)

Issue 149770043: code review 149770043: cmd/cc, cmd/ld, runtime: disallow conservative data/bss... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 6 months ago by rsc
Modified:
9 years, 6 months ago
Reviewers:
gobot, iant
CC:
iant, golang-codereviews
Visibility:
Public.

Description

cmd/cc, cmd/ld, runtime: disallow conservative data/bss objects In linker, refuse to write conservative (array of pointers) as the garbage collection type for any variable in the data/bss GC program. In the linker, attach the Go type to an already-read C declaration during dedup. This gives us Go types for C globals for free as long as the cmd/dist-generated Go code contains the declaration. (Most runtime C declarations have a corresponding Go declaration. Both are bss declarations and so the linker dedups them.) In cmd/dist, add a few more C files to the auto-Go-declaration list in order to get Go type information for the C declarations into the linker. In C compiler, mark all non-pointer-containing global declarations and all string data as NOPTR. This allows them to exist in C files without any corresponding Go declaration. Count C function pointers as "non-pointer-containing", since we have no heap-allocated C functions. In runtime, add NOPTR to the remaining pointer-containing declarations, none of which refer to Go heap objects. In runtime, also move os.Args and syscall.envs data into runtime-owned variables. Otherwise, in programs that do not import os or syscall, the runtime variables named os.Args and syscall.envs will be missing type information. I believe that this CL eliminates the final source of conservative GC scanning in non-SWIG Go programs, and therefore... Fixes issue 909.

Patch Set 1 #

Patch Set 2 : diff -r 8b46511b1bbff31514c3edc8508f1019a189196e https://code.google.com/p/go/ #

Patch Set 3 : diff -r 2f66d595a9ec50db3bf4fe871c6a25a5fff21df3 https://code.google.com/p/go/ #

Patch Set 4 : diff -r aac3a857c5d81500efc60854ddd39dd549c036de https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+126 lines, -77 lines) Patch
M src/cmd/cc/dcl.c View 1 3 chunks +6 lines, -3 lines 0 comments Download
M src/cmd/cc/lex.c View 1 2 chunks +2 lines, -0 lines 0 comments Download
M src/cmd/cgo/out.go View 1 3 chunks +13 lines, -0 lines 0 comments Download
M src/cmd/dist/buildruntime.c View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/ld/data.c View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/liblink/objfile.c View 1 2 chunks +4 lines, -2 lines 0 comments Download
M src/os/proc.go View 1 1 chunk +6 lines, -0 lines 0 comments Download
M src/runtime/asm_386.s View 1 1 chunk +0 lines, -2 lines 0 comments Download
M src/runtime/asm_amd64.s View 1 1 chunk +0 lines, -2 lines 0 comments Download
M src/runtime/asm_amd64p32.s View 1 1 chunk +0 lines, -2 lines 0 comments Download
M src/runtime/heapdump.c View 1 2 chunks +3 lines, -0 lines 0 comments Download
M src/runtime/malloc.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M src/runtime/malloc.c View 1 1 chunk +0 lines, -23 lines 0 comments Download
M src/runtime/mcache.c View 1 1 chunk +1 line, -1 line 0 comments Download
M src/runtime/mgc0.c View 1 3 chunks +2 lines, -3 lines 0 comments Download
M src/runtime/os_windows.c View 1 2 chunks +3 lines, -3 lines 0 comments Download
M src/runtime/proc.c View 1 3 chunks +9 lines, -21 lines 0 comments Download
M src/runtime/proc.go View 1 1 chunk +8 lines, -0 lines 0 comments Download
M src/runtime/runtime.c View 1 2 5 chunks +16 lines, -9 lines 0 comments Download
M src/runtime/runtime.go View 1 2 2 chunks +11 lines, -0 lines 0 comments Download
M src/runtime/signals_darwin.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/runtime/signals_dragonfly.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/runtime/signals_freebsd.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/runtime/signals_linux.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/runtime/signals_nacl.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/runtime/signals_netbsd.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/runtime/signals_openbsd.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/runtime/signals_plan9.h View 1 2 chunks +3 lines, -0 lines 0 comments Download
M src/runtime/signals_solaris.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/runtime/stack.c View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/runtime/thunk.s View 1 2 chunks +7 lines, -1 line 0 comments Download
M src/syscall/env_unix.go View 1 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 4
rsc
Hello iant (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
9 years, 6 months ago (2014-09-24 18:56:51 UTC) #1
iant
LGTM Nice.
9 years, 6 months ago (2014-09-24 20:50:08 UTC) #2
rsc
*** Submitted as https://code.google.com/p/go/source/detail?r=12a2c798d360 *** cmd/cc, cmd/ld, runtime: disallow conservative data/bss objects In linker, refuse ...
9 years, 6 months ago (2014-09-24 20:55:31 UTC) #3
gobot
9 years, 6 months ago (2014-09-26 00:55:37 UTC) #4
Message was sent while issue was closed.
This CL appears to have broken the linux-amd64-perf builder.
See http://build.golang.org/log/05258d33ebdfd598ea55477ad7778b54c5a2d90f
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b