aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/api/goapi.go
AgeCommit message (Collapse)Author
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-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-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
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-06cmd/api: include constant valuesBrad Fitzpatrick
Update #5935 R=golang-dev, rsc, iant, dave CC=golang-dev https://golang.org/cl/13261050
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: 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-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
2013-03-06all: delete a couple of mentions of the exp and old treesRob Pike
R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/7551043
2013-02-01bytes, strings: add TrimPrefix and TrimSuffixBrad Fitzpatrick
Everybody either gets confused and thinks this is TrimLeft/TrimRight or does this by hand which gets repetitive looking. R=rsc, kevlar CC=golang-dev https://golang.org/cl/7239044
2013-01-28cmd/api: normalize byte to uint8 and rune to int32Brad Fitzpatrick
R=golang-dev, adg, mikioh.mikioh CC=golang-dev https://golang.org/cl/7195049
2013-01-22cmd/api: fix type scrubbingBrad Fitzpatrick
It wasn't removing names from func parameters for func types, and it was handling "a, b string" as "string", not "string, string". Fixes #4688 R=golang-dev, rsc CC=golang-dev https://golang.org/cl/7181051
2013-01-19cmd/api: sort featuresAnthony Martin
R=golang-dev, minux.ma, bradfitz CC=golang-dev https://golang.org/cl/7141062
2012-11-19cmd/api: speed up API check by 2x, caching parser.ParseFile callsBrad Fitzpatrick
Saves 5 seconds on my machine. If Issue 4380 is fixed this clone can be removed. Update #4380 R=golang-dev, remyoudompheng, minux.ma, gri CC=golang-dev https://golang.org/cl/6845058
2012-11-13cmd/api: use one token.FileSet for all contextsBrad Fitzpatrick
Prep for future CL. R=gri CC=golang-dev https://golang.org/cl/6843048
2012-11-08cmd/api: bug fix for goapi's lame type checkerBrad Fitzpatrick
This is blocking me submitting the net fd timeout CL, since goapi chokes on my constant. The much more extensive fix to goapi's type checker in pending review in https://golang.org/cl/6742050 But I'd rather get this quick fix in first. R=golang-dev, mikioh.mikioh CC=golang-dev https://golang.org/cl/6818104
2012-10-30cmd/api: handle contexts re-convergingBrad Fitzpatrick
Fixes #4303 R=golang-dev, adg CC=golang-dev https://golang.org/cl/6816058
2012-10-30cmd/api: add more testsBrad Fitzpatrick
Feature extraction was tested before, but not the final diffs. This CL breaks function main into a smaller main + testable compareAPI. No functional changes. R=golang-dev, adg CC=golang-dev https://golang.org/cl/6820057
2012-10-04cmd/api: add exception fileRob Pike
Fixes build. R=golang-dev, adg, bradfitz, dsymonds, dave CC=golang-dev https://golang.org/cl/6586074
2012-09-27cmd/api: delete redundant text from deletion messageRob Pike
R=bradfitz, minux.ma, rsc CC=golang-dev https://golang.org/cl/6543064
2012-09-24cmd/dist: new version for string for development branchRuss Cox
Remove VERSION, which was forcing version to 'devel'. Old: $ go version go version devel New: $ go version go version devel +0a3866d6cc6b Mon Sep 24 20:08:05 2012 -0400 The date and time (and time zone) is that of the most recent commit, not the time of the build itself. With some effort we could normalize the zone, but I don't think it's worth the effort (more C coding, since Mercurial is unhelpful). R=r, dsymonds CC=golang-dev https://golang.org/cl/6569049
2012-09-19cmd/api: fix signatures like func(x, y, z int)Mikio Hara
Fixes writing of function parameter, result lists which consist of multiple named or unnamed items with same type. Fixes #4011. R=golang-dev, bsiegert, bradfitz, rsc CC=golang-dev https://golang.org/cl/6475062
2012-09-18cmd/api: allow extension of interfaces with unexported methodsRuss Cox
Fixes #4061. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/6525047