aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/api
AgeCommit message (Collapse)Author
2014-09-05runtime: convert panic/recover to GoKeith Randall
created panic1.go just so diffs were available. After this CL is in, I'd like to move panic.go -> defer.go and panic1.go -> panic.go. LGTM=rsc R=rsc, khr CC=golang-codereviews https://golang.org/cl/133530045
2014-09-04runtime: more C to Go conversion adjustmentsRuss Cox
Mostly NOSPLIT additions. Had to rewrite atomic_arm.c in Go because it calls lock, and lock is too complex. With this CL, I find no Go -> C calls that can split the stack on any system except Solaris and Windows. Solaris and Windows need more work and will be done separately. LGTM=iant, dave R=golang-codereviews, bradfitz, iant, dave CC=dvyukov, golang-codereviews, khr, r https://golang.org/cl/137160043
2014-09-04cmd/api: don't depend on os/user or USER to check apiBrad Fitzpatrick
The -nocgo builder failed because it has cgo disabled as well as no USER environment variable: http://build.golang.org/log/2250abb82f5022b72a12997b8ff89fcdeff094c9 # Checking API compatibility. Error getting current user: user: Current not implemented on linux/amd64 exit status 1 Don't require the environment variable here. LGTM=minux R=dave, adg, minux CC=golang-codereviews https://golang.org/cl/140290043
2014-09-04runtime: reconvert sigqueue.goc from C to GoRuss Cox
The original conversion in CL 132090043 cut up the function in an attempt to avoid converting most of the code to Go. This contorts the control flow. While debugging the onM signal stack bug, I reconverted sigqueue.goc in its entirety. This restores the original control flow, which is much easier to understand. The current conversion is correct, it's just complex and will be hard to maintain. The new one is as readable as the original code. I uploaded sigqueue.goc as the initial copy of sigqueue.go in the CL, so if you view the diffs of sigqueue.go comparing against patch set 2 [sic] it will show the actual starting point. For example: https://golang.org/cl/136160043/diff2/20001:60001/src/pkg/runtime/sigqueue.go LGTM=dvyukov, iant R=golang-codereviews, dvyukov, iant CC=golang-codereviews, khr, r https://golang.org/cl/136160043
2014-09-04runtime: convert netpoll to GoDmitriy Vyukov
The common code is converted, epoll and kqueue are converted. Windows and solaris are still C. LGTM=rsc R=golang-codereviews, rsc, dave CC=golang-codereviews, iant, khr, rsc https://golang.org/cl/132910043
2014-09-03runtime: deferproc/deferreturn in GoKeith Randall
LGTM=rsc R=golang-codereviews, rsc, khr CC=golang-codereviews https://golang.org/cl/139900043
2014-09-03runtime: convert a few traceback-related functions from proc.c to traceback.goRuss Cox
They were in proc.c mainly because there was no portable traceback source file. As part of converting them to Go, move to traceback.go. In order to get access to the PC of _rt0_go, rename to runtime.rt0_go. LGTM=r R=golang-codereviews, r CC=dvyukov, golang-codereviews, iant, khr https://golang.org/cl/139110043
2014-09-02runtime: convert select implementation to Go.Keith Randall
LGTM=rsc R=golang-codereviews, bradfitz, iant, khr, rsc CC=golang-codereviews https://golang.org/cl/139020043
2014-09-02runtime: convert traceback*.c to GoRuss Cox
The two converted files were nearly identical. Instead of continuing that duplication, I merged them into a single traceback.go. Tested on arm, amd64, amd64p32, and 386. LGTM=r R=golang-codereviews, remyoudompheng, dave, r CC=dvyukov, golang-codereviews, iant, khr https://golang.org/cl/134200044
2014-09-01runtime: convert mprof.goc to mprof.goRuss Cox
The exported Go definitions appearing in mprof.go are copied verbatim from debug.go. The unexported Go funcs and types are new. The C Bucket type used a union and was not a line-for-line translation. LGTM=remyoudompheng R=golang-codereviews, remyoudompheng CC=dvyukov, golang-codereviews, iant, khr, r https://golang.org/cl/137040043
2014-08-28cmd/api: more runtime fixesRuss Cox
This is getting a little annoying, but once the runtime structs are being defined in Go, these will go away. So it's only a temporary cost. TBR=bradfitz CC=golang-codereviews https://golang.org/cl/135940043
2014-08-27cmd/api: fix for Lock⇒Mutex changeRuss Cox
TBR=iant CC=golang-codereviews https://golang.org/cl/133150043
2014-08-27cmd/cc, runtime: convert C compilers to use Go calling conventionRuss Cox
To date, the C compilers and Go compilers differed only in how values were returned from functions. This made it difficult to call Go from C or C from Go if return values were involved. It also made assembly called from Go and assembly called from C different. This CL changes the C compiler to use the Go conventions, passing results on the stack, after the arguments. [Exception: this does not apply to C ... functions, because you can't know where on the stack the arguments end.] By doing this, the CL makes it possible to rewrite C functions into Go one at a time, without worrying about which languages call that function or which languages it calls. This CL also updates all the assembly files in package runtime to use the new conventions. Argument references of the form 40(SP) have been rewritten to the form name+10(FP) instead, and there are now Go func prototypes for every assembly function called from C or Go. This means that 'go vet runtime' checks effectively every assembly function, and go vet's output was used to automate the bulk of the conversion. Some functions, like seek and nsec on Plan 9, needed to be rewritten. Many assembly routines called from C were reading arguments incorrectly, using MOVL instead of MOVQ or vice versa, especially on the less used systems like openbsd. These were found by go vet and have been corrected too. If we're lucky, this may reduce flakiness on those systems. Tested on: darwin/386 darwin/amd64 linux/arm linux/386 linux/amd64 If this breaks another system, the bug is almost certainly in the sys_$GOOS_$GOARCH.s file, since the rest of the CL is tested by the combination of the above systems. LGTM=dvyukov, iant R=golang-codereviews, 0intro, dave, alex.brainman, dvyukov, iant CC=golang-codereviews, josharian, r https://golang.org/cl/135830043
2014-08-25runtime: convert NewCallback and NewCallbackCDecl to GoAlex Brainman
LGTM=khr R=khr, remyoudompheng CC=golang-codereviews https://golang.org/cl/132820043
2014-08-24runtime: convert channel operations to Go, part 1 (chansend1).Keith Randall
LGTM=dvyukov R=dvyukov, khr CC=golang-codereviews https://golang.org/cl/127460044
2014-08-22runtime: convert note to GoDmitriy Vyukov
Note is required for timers and heap scavenger. LGTM=rsc R=golang-codereviews, rsc CC=golang-codereviews, khr, rlh https://golang.org/cl/128620043
2014-08-21cmd/api: reduce stutter in runtime type stubsJosh Bleecher Snyder
LGTM=khr R=khr CC=dvyukov, golang-codereviews https://golang.org/cl/132770044
2014-08-21runtime: convert common scheduler functions to GoDmitriy Vyukov
These are required for chans, semaphores, timers, etc. LGTM=khr R=golang-codereviews, khr CC=golang-codereviews, rlh, rsc https://golang.org/cl/123640043
2014-08-21cmd/api: add missing runtime structDmitriy Vyukov
Fixes build. TBR=khr R=golang-codereviews CC=golang-codereviews, khr https://golang.org/cl/130390044
2014-08-18runtime: don't acquirem on malloc fast pathDmitriy Vyukov
Mallocgc must be atomic wrt GC, but for performance reasons don't acquirem/releasem on fast path. The code does not have split stack checks, so it can't be preempted by GC. Functions like roundup/add are inlined. And onM/racemalloc are nosplit. Also add debug code that checks these assumptions. benchmark old ns/op new ns/op delta BenchmarkMalloc8 20.5 17.2 -16.10% BenchmarkMalloc16 29.5 27.0 -8.47% BenchmarkMallocTypeInfo8 31.5 27.6 -12.38% BenchmarkMallocTypeInfo16 34.7 30.9 -10.95% LGTM=khr R=golang-codereviews, khr CC=golang-codereviews, rlh, rsc https://golang.org/cl/123100043
2014-08-07runtime: convert interface routines from C to Go.Keith Randall
LGTM=dvyukov R=golang-codereviews, dave, bradfitz, dvyukov, khr CC=golang-codereviews https://golang.org/cl/98510044
2014-08-06runtime: shorten hash declarationsKeith Randall
LGTM=iant R=dvyukov, iant CC=golang-codereviews https://golang.org/cl/117680044
2014-07-31runtime: convert slice operations to Go.Keith Randall
LGTM=bradfitz, dvyukov R=golang-codereviews, bradfitz, dvyukov CC=golang-codereviews https://golang.org/cl/120190044
2014-07-30runtime: rewrite malloc in Go.Keith Randall
This change introduces gomallocgc, a Go clone of mallocgc. Only a few uses have been moved over, so there are still lots of uses from C. Many of these C uses will be moved over to Go (e.g. in slice.goc), but probably not all. What should remain of C's mallocgc is an open question. LGTM=rsc, dvyukov R=rsc, khr, dave, bradfitz, dvyukov CC=golang-codereviews https://golang.org/cl/108840046
2014-07-21cmd/api: ignore internal packagesBrad Fitzpatrick
We might want to add a go/build.IsInternal(pkg string) bool later, but this works for now. LGTM=dave, rsc R=rsc, dave CC=golang-codereviews https://golang.org/cl/113300044
2014-07-16runtime: convert map implementation to Go.Keith Randall
It's a bit slower, but not painfully so. There is still room for improvement (saving space so we can use nosplit, and removing the requirement for hash/eq stubs). benchmark old ns/op new ns/op delta BenchmarkMegMap 23.5 24.2 +2.98% BenchmarkMegOneMap 14.9 15.7 +5.37% BenchmarkMegEqMap 71668 72234 +0.79% BenchmarkMegEmptyMap 4.05 4.93 +21.73% BenchmarkSmallStrMap 21.9 22.5 +2.74% BenchmarkMapStringKeysEight_16 23.1 26.3 +13.85% BenchmarkMapStringKeysEight_32 21.9 25.0 +14.16% BenchmarkMapStringKeysEight_64 21.9 25.1 +14.61% BenchmarkMapStringKeysEight_1M 21.9 25.0 +14.16% BenchmarkIntMap 21.8 12.5 -42.66% BenchmarkRepeatedLookupStrMapKey32 39.3 30.2 -23.16% BenchmarkRepeatedLookupStrMapKey1M 322353 322675 +0.10% BenchmarkNewEmptyMap 129 136 +5.43% BenchmarkMapIter 137 107 -21.90% BenchmarkMapIterEmpty 7.14 8.71 +21.99% BenchmarkSameLengthMap 5.24 6.82 +30.15% BenchmarkBigKeyMap 34.5 35.3 +2.32% BenchmarkBigValMap 36.1 36.1 +0.00% BenchmarkSmallKeyMap 26.9 26.7 -0.74% LGTM=rsc R=golang-codereviews, dave, dvyukov, rsc, gobot, khr CC=golang-codereviews https://golang.org/cl/99380043
2014-06-02api: add go1.3.txtBrad Fitzpatrick
Update #8112 LGTM=adg R=adg CC=golang-codereviews https://golang.org/cl/104790045
2014-05-02std lib: fix various typos in commentsRobert Griesemer
Where the spelling changed from British to US norm (e.g., optimise -> optimize) it follows the style in that file. LGTM=adonovan R=golang-codereviews, adonovan CC=golang-codereviews https://golang.org/cl/96980043
2014-01-14cmd/api: ensure GOPATH always points to the correct go.toolsAlex Brainman
R=golang-codereviews, dave, bradfitz CC=golang-codereviews https://golang.org/cl/51000043
2013-10-18api: add go1.2.txt, use in testsAndrew Gerrand
R=golang-dev, iant CC=golang-dev https://golang.org/cl/14860043
2013-10-14cmd/api: make it work even when cgo is disabledShenghou Ma
make use of $USER or %USERNAME% to determine the current user. Fixes #6578. R=golang-dev, bradfitz, alex.brainman CC=golang-dev https://golang.org/cl/14649043
2013-09-22cmd/api: always do API check if hg is availableBrad Fitzpatrick
Fixes #6124 R=golang-dev, minux.ma CC=golang-dev https://golang.org/cl/13500046
2013-09-11cmd/api: fix tool for recent go/build changeRuss Cox
Asking about runtime/cgo when CgoEnabled=false now correctly returns an error from build.Import (specifically, NoGoError), because there are no buildable Go files in that directory. The API tool was depending on it returning a package with no Go files instead. Correct that assumption. Fixes all.bash on local machines. (Dashboard appears not to be running the api tool at all.) Update #6124 TBR=golang-dev CC=golang-dev https://golang.org/cl/13385046
2013-09-11undo CL 13632053 / dc7bfe0f022dRuss Cox
It was never going to last. ««« original CL description cmd/api: break the builds There is some question about whether the api tool is running on Windows (see issue 6124), and now I'm starting to question whether it runs on any of the builders, since both darwin/amd64 and linux/amd64 are crashing for me in the api tool due to a recent cgo-related change, and yet the dashboard is happy. If the dashboard is still happy after this CL, we have a problem. Update #6124 TBR=golang-dev CC=golang-dev https://golang.org/cl/13632053 »»» TBR=golang-dev CC=golang-dev https://golang.org/cl/13474045
2013-09-11cmd/api: break the buildsRuss Cox
There is some question about whether the api tool is running on Windows (see issue 6124), and now I'm starting to question whether it runs on any of the builders, since both darwin/amd64 and linux/amd64 are crashing for me in the api tool due to a recent cgo-related change, and yet the dashboard is happy. If the dashboard is still happy after this CL, we have a problem. Update #6124 TBR=golang-dev CC=golang-dev https://golang.org/cl/13632053
2013-09-11cmd/api: make api check directory per-userRobert Daniel Kortschak
Fixes #6353. R=golang-dev, bradfitz, alex.brainman CC=golang-dev https://golang.org/cl/13652043
2013-09-06cmd/api: include constant valuesBrad Fitzpatrick
Update #5935 R=golang-dev, rsc, iant, dave CC=golang-dev https://golang.org/cl/13261050
2013-08-24cmd/api: be more robust against OS deleting temp filesBrad Fitzpatrick
OS X in particular deletes tmp files (but not directories) pretty reliably. Ask hg whether the go.tools directory in tmp is good before using it. Fixes issue Rob and others were reporting, which I just hit myself now. R=golang-dev, r CC=golang-dev https://golang.org/cl/13084049
2013-08-24cmd/api: ignore GOARCH when building cmd/api.Brad Fitzpatrick
This was breaking people setting GOARCH=386 before running all.bash on amd64 machines. cmd/go puts different architecture binaries where "go tool" can't find them. R=golang-dev, r, khr CC=golang-dev https://golang.org/cl/13139044
2013-08-12cmd/api: don't fail API check if there's no networkBrad Fitzpatrick
If the hg checkout of go.tools fails, check for Internet connectivity before failing. R=golang-dev, shivakumar.gn CC=golang-dev https://golang.org/cl/12814043
2013-08-09cmd/api: eliminate duplicate package import workRuss Cox
On my Mac, cuts the API checks from 15 seconds to 6 seconds. Also clean up some tag confusion: go run list-of-files ignores tags. R=bradfitz, gri CC=golang-dev https://golang.org/cl/12699048
2013-08-08cmd/api: add a benchmark over the standard libraryBrad Fitzpatrick
R=golang-dev, gri CC=golang-dev https://golang.org/cl/12603045
2013-08-08cmd/api: rewrite using go/typesRobert Griesemer
- adjusted test files so that they actually type-check - adjusted go1.txt, go1.1.txt, next.txt - to run, provide build tag: api_tool Fixes #4538. R=bradfitz CC=golang-dev https://golang.org/cl/12300043
2013-08-08cmd/api: show output of api tool even if exit status is 0Brad Fitzpatrick
We weren't seeing additions. (stuff to put in next.txt) R=golang-dev, rsc CC=golang-dev https://golang.org/cl/12678043
2013-08-08cmd/api: update run.go to fetch from go.tools when neededBrad Fitzpatrick
R=gri CC=golang-dev https://golang.org/cl/12639043
2013-08-07build: change how cmd/api is run in run.bash and run.batBrad Fitzpatrick
In prep for Robert's forthcoming cmd/api rewrite which depends on the go.tools subrepo, we'll need to be more careful about how and when we run cmd/api. Rather than implement this policy in both run.bash and run.bat, this change moves the policy and mechanism into cmd/api/run.go, which will then evolve. The plan is in a TODO in run.go. R=golang-dev, gri CC=golang-dev https://golang.org/cl/12482044
2013-05-21cmd/api: add more platformsShenghou Ma
as OpenBSD lacks 4 errno constants, api/go1.txt is updated so that api check won't fail. R=golang-dev, iant, bradfitz, r CC=golang-dev https://golang.org/cl/9149045
2013-05-14cmd/api: don't print out except.txt removed features to stdoutBrad Fitzpatrick
It's just noise. They've already been acknowledged in except.txt. R=golang-dev, r CC=golang-dev https://golang.org/cl/9392047
2013-05-06api: add go1.1.txt; update cmd/api to use itBrad Fitzpatrick
R=golang-dev, adg, r CC=golang-dev https://golang.org/cl/9250043
2013-03-11all: remove now-unnecessary unreachable panicsBrad Fitzpatrick
Take advantage of the new terminating statement rule. R=golang-dev, r, gri CC=golang-dev https://golang.org/cl/7712044