1
0
mirror of https://github.com/golang/go synced 2024-10-05 16:41:21 -06:00
Commit Graph

4996 Commits

Author SHA1 Message Date
Shenghou Ma
dbf406a9d8 [dev.power64] cmd/gc: disable magic multiply optimizations for now
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/126110043
2014-08-12 22:07:15 -04:00
Russ Cox
53b78c84bc [dev.power64] cmd/9a: use new flag parser
Copy main from 6a. Fixes various things, but the
main thing is the use of the new flag parser.
The go command expects to be able to use -trimpath
and not have it be interpreted as -t rimpath.

LGTM=minux
R=minux
CC=golang-codereviews
https://golang.org/cl/126100043
2014-08-12 21:41:42 -04:00
Shenghou Ma
3e4dfdad34 [dev.power64] cmd/9g, cmd/gc, cmd/ld: fix build.
1. disable nonsplit stack overflow check
2. disable OLROT recognition
3. emit correct instructions for adding offsets to an address

LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/123310043
2014-08-12 21:22:27 -04:00
Shenghou Ma
860f941e7f [dev.power64] cmd/9c: fix endian issue in integer to floating point conversion
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/129850043
2014-08-12 20:58:05 -04:00
Shenghou Ma
560cf4c6de [dev.power64] cmd/9l: remove MAXIO (fix build)
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/124270043
2014-08-12 20:57:54 -04:00
Shenghou Ma
5e4989cf0a [dev.power64] cmd/gc: handle thechar=='9', disable nilopt() for now
LGTM=rsc
R=rsc, iant, dave
CC=golang-codereviews
https://golang.org/cl/121630043
2014-08-12 20:57:32 -04:00
Shenghou Ma
b1c9a8bce3 [dev.power64] cmd/9g: implement zerorange
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/121540043
2014-08-12 19:51:01 -04:00
Shenghou Ma
4928b2074b [dev.power64] cmd/9g: first check point
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/123170043
2014-08-11 23:44:55 -04:00
Shenghou Ma
552d8b79dd [dev.power64] cmd/9l/9.out.h: introduce NFREG, REGG, REGRT1 and REGRT2
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/125990043
2014-08-11 23:44:38 -04:00
Shenghou Ma
1a1d450712 [dev.power64] cmd/9l: introduce the power64 linker, based loosely on 5l
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/123940043
2014-08-11 23:44:23 -04:00
Shenghou Ma
6e692b35bb [dev.power64] cmd/cgo: add {ppc,power}64{,le} to pointer and int size maps
LGTM=rsc
R=rsc, iant, dave
CC=golang-codereviews
https://golang.org/cl/119640043
2014-08-11 23:43:51 -04:00
Shenghou Ma
40d7a6d582 [dev.power64] cmd/ld: add MAXIO back in lib.h
It was accidentally removed.

LGTM=dave
R=rsc, iant, dave
CC=golang-codereviews
https://golang.org/cl/124880043
2014-08-11 23:31:28 -04:00
Shenghou Ma
05d72029db [dev.power64] cmd/9c: add Makefile
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/121370043
2014-08-07 18:41:37 -04:00
Shenghou Ma
6e02e1cfc2 [dev.power64] cmd/ld: update for power64
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/121380043
2014-08-07 18:36:42 -04:00
Shenghou Ma
95e8a3a1da [dev.power64] cmd/9c: fix switch bug
The cmd/cc bundled with 9c has additional code compared to our cmd/cc, and
without those code, 9c couldn't handle switch statement where the expression
is not just a simple int32 or int64 variable (e.g. g->status or int8 variable).

All credit goes to rsc.

LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/125840043
2014-08-07 18:34:25 -04:00
Shenghou Ma
7c33e5078f [dev.power64] cmd/9l: update header files for liblink
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/128720044
2014-08-07 14:56:59 -04:00
Shenghou Ma
bcf7f61f83 [dev.power64] cmd/9a: use liblink, add required additional instructions.
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/127730043
2014-08-07 14:49:41 -04:00
Shenghou Ma
83f6aadf16 [dev.power64] cmd/9c: use liblink, use Go argument passing rules, support both endians
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/126800043
2014-08-07 14:36:34 -04:00
Shenghou Ma
c689eb9b21 [dev.power64] cmd/dist: power64/power64le support.
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/117670045
2014-08-06 23:59:14 -04:00
Shenghou Ma
7582ecc996 [dev.power64] cmd/9g: add doc.go to prevent build failures.
After CL 117670045, cmd/dist will expect to have a cmd/9g directory.

LGTM=rsc, dave
R=rsc, iant, dave
CC=golang-codereviews
https://golang.org/cl/126780043
2014-08-06 23:43:36 -04:00
Shenghou Ma
117b1d4685 [dev.power64] cmd/9a, cmd/9c, cmd/9l, liblink: import code from Vita Nuova.
No modifications other than adding copyright header to each file, and
concatenating several cmd/9l files together to form the liblink files.

LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/123840043
2014-08-06 23:41:29 -04:00
Shenghou Ma
9512e470e1 [dev.power64] cmd/dist: recognize power64 and power64le as GOHOSTARCH
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/125760043
2014-08-06 16:16:28 -04:00
Russ Cox
ffb07c0e6c [dev.power64] all: merge default, for codereview update
LGTM=minux
R=minux
CC=golang-codereviews
https://golang.org/cl/124820043
2014-08-06 16:15:22 -04:00
Russ Cox
7aa3031eba cmd/gc: make liveness ~10x faster
1) The arrayindexof lookup function is O(n). Replace with O(1) lookups.

2) The checkptxt function is O(n²) and is purely for debugging.
Only run when the debugging flags are turned on.

3) Iterating over sparse bitmaps can be done faster word by word.
Introduce and use bvnext for that.

Run times before and after, on my 2.5 GHz Core i5 MacBook Pro.

x.go       9.48  0.84  issue 8259

x100.go    0.01  0.01  issue 8354
x1000.go   0.10  0.10
x2000.go   0.62  0.19
x3000.go   1.33  0.34
x4000.go   2.29  0.49
x5000.go   3.89  0.67
x6000.go   5.00  0.90
x7000.go   6.70  1.13
x8000.go   9.44  1.38
x9000.go  11.23  1.87
x10000.go 13.78  2.09

Fixes #8259.
Fixes #8354.

LGTM=iant, r
R=golang-codereviews, iant, r
CC=golang-codereviews
https://golang.org/cl/125720043
2014-08-06 15:46:33 -04:00
Russ Cox
bd69b4479a cmd/dist: generate anames9.c
LGTM=minux
R=minux
CC=golang-codereviews
https://golang.org/cl/120690043
2014-08-06 15:12:08 -04:00
Russ Cox
ccd880f290 cmd/dist, go/build: add power64, power64le to known GOARCH lists
LGTM=dave, minux, aram
R=minux, dave, bradfitz, aram
CC=golang-codereviews
https://golang.org/cl/119470043
2014-08-06 14:58:17 -04:00
Matthew Dempsky
2b9f3fcead cmd/cgo: consistently map void* to *byte under -{c,go}defs
Fixes #8478.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/122150043
2014-08-06 10:28:19 -07:00
David du Colombier
de1ab89f03 dist: fix Plan 9 build
Since CL 115060044, mkanames declares an empty
array in anames8.c and anames6.c, which is not
valid for the Plan 9 compiler.

char* cnames8[] = {
};

This change makes mkanames not declaring the
cnames array when no C_ constants are found.

LGTM=iant
R=minux, iant
CC=golang-codereviews
https://golang.org/cl/117680043
2014-08-06 06:11:41 -07:00
Shenghou Ma
6503d40051 undo CL 114420043 / b613f2acdf69
Broke freebsd/amd64 due to exposure of a latent bug.

««« original CL description
cmd/ld: fix operator precedence

LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/114420043
»»»

TBR=dfc
R=dave
CC=golang-codereviews
https://golang.org/cl/120630043
2014-08-06 02:07:31 -04:00
Shenghou Ma
d69d0fe92b liblink, cmd/dist, cmd/5l: introduce %^ and move C_* constants.
The helps certain diagnostics and also removed duplicated enums as a side effect.

LGTM=dave, rsc
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/115060044
2014-08-06 00:31:22 -04:00
Shenghou Ma
ae027f52fe cmd/cc, cmd/gc: set ctxt->debugvlog with debug['v']
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/118610043
2014-08-06 00:27:14 -04:00
Shenghou Ma
45bd2f8c45 cmd/5l, cmd/6l, cmd/8l, cmd/ld: remove unused code, consolidate enums
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/120220043
2014-08-06 00:25:52 -04:00
Shenghou Ma
2c181f0355 cmd/ld: fix operator precedence
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/114420043
2014-08-06 00:25:05 -04:00
Matthew Dempsky
0da4b2dbc2 cmd/cgo: fix recursive type mapping
Instead of immediately completing pointer type mappings, add them to
a queue to allow them to be completed later.  This fixes issues	caused
by Type() returning arbitrary in-progress type mappings.

Fixes #8368.
Fixes #8441.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/122850043
2014-08-05 18:16:56 -07:00
Matthew Dempsky
f7a8adbd51 cmd/cgo: fix handling of defs_linux.go
Instead of including <sys/types.h> to get size_t, instead include
the ISO C standard <stddef.h> header, which defines fewer additional
types at risk of colliding with the user code.  In particular, this
prevents collisions between <sys/types.h>'s userspace definitions with
the kernel definitions needed by defs_linux.go.

Also, -cdefs mode uses #pragma pack, so we can keep misaligned fields.

Fixes #8477.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/120610043
2014-08-05 18:12:32 -07:00
Ian Lance Taylor
f2f17c0ff2 cmd/cgo: for -godefs, promote first field of anonymous union
Update #6677

When a struct contains an anonymous union, use the type and
name of the first field in the union.

This should make the glibc <sys/resource.h> file work; in that
file struct rusage has fields like

__extension__ union
{
        long int ru_maxrss;
        __syscall_slong_t __ru_maxrss_word;
};

in which the field that matters is ru_maxrss and
__ru_maxrss_word just exists to advance to the next field on
systems where the kernel uses long long fields but userspace
expects long fields.

LGTM=mikioh.mikioh
R=golang-codereviews, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/106260044
2014-08-05 17:10:15 -07:00
Dmitriy Vyukov
81674f3135 runtime: remove type.go
We have an autogenerated version in zruntime_defs.
I am not sure what are the consequences as gdb never printed any values for me.
But it looks unnecessary to manually duplicate it.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews, iant, khr
https://golang.org/cl/115660043
2014-08-05 22:32:24 +04:00
Peter Collingbourne
fe513d8b3e cmd/go: use correct link flags if main package contains C++/ObjC files
LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/117470043
2014-08-01 16:45:33 -07:00
Keith Randall
668a55a882 runtime: move constants from map header to map type
A good cleanup anyway, and it makes some room for an additional
field needed for issue 8412.

Update #8412

LGTM=iant
R=iant, khr
CC=golang-codereviews
https://golang.org/cl/112700043
2014-08-01 14:38:56 -07:00
Keith Randall
a2a9768414 runtime: convert hash functions to Go calling convention.
Create proper closures so hash functions can be called
directly from Go.  Rearrange calling convention so return
value is directly accessible.

LGTM=dvyukov
R=golang-codereviews, dvyukov, dave, khr
CC=golang-codereviews
https://golang.org/cl/119360043
2014-07-31 15:07:05 -07:00
Keith Randall
cc9ec52d73 runtime: convert slice operations to Go.
LGTM=bradfitz, dvyukov
R=golang-codereviews, bradfitz, dvyukov
CC=golang-codereviews
https://golang.org/cl/120190044
2014-07-31 12:43:40 -07:00
Josh Bleecher Snyder
2c982ce9a0 cmd/gc: fix example flag in comment
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/118480044
2014-07-31 10:34:51 -07:00
Keith Randall
4aa50434e1 runtime: rewrite malloc in Go.
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-30 09:01:52 -07:00
Keith Randall
d2204e6c0e cmd/gc: don't allow escaping arguments in the runtime package.
This is a case that was missed in https://golang.org/cl/105280047/

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/120910043
2014-07-29 14:38:08 -07:00
Dmitriy Vyukov
9333fe8e92 cmd/ld: better diagnostics on unaligned symbols
Want to see why builders are failing.
Then decide whether to rollback or fix.

TBR=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/114510043
2014-07-29 11:22:57 +04:00
Dmitriy Vyukov
cd17a717f9 runtime: simpler and faster GC
Implement the design described in:
https://docs.google.com/document/d/1v4Oqa0WwHunqlb8C3ObL_uNQw3DfSY-ztoA-4wWbKcg/pub

Summary of the changes:
GC uses "2-bits per word" pointer type info embed directly into bitmap.
Scanning of stacks/data/heap is unified.
The old spans types go away.
Compiler generates "sparse" 4-bits type info for GC (directly for GC bitmap).
Linker generates "dense" 2-bits type info for data/bss (the same as stacks use).

Summary of results:
-1680 lines of code total (-1000+ in mgc0.c only)
-25% memory consumption
-3-7% binary size
-15% GC pause reduction
-7% run time reduction

LGTM=khr
R=golang-codereviews, rsc, christoph, khr
CC=golang-codereviews, rlh
https://golang.org/cl/106260045
2014-07-29 11:01:02 +04:00
Shenghou Ma
faa223459a cmd/ld: remove duplicated nuxiinit() call.
It is already called by linknew().

LGTM=dave
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/120760043
2014-07-26 17:45:45 -04:00
Shenghou Ma
a57dda74d9 cmd/5g: remove dead code.
LGTM=bradfitz, dave
R=rsc, bradfitz, dave
CC=golang-codereviews
https://golang.org/cl/115070043
2014-07-26 17:45:24 -04:00
Shenghou Ma
61864c09fc cmd/5l: remove unused noop.c
LGTM=dave
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/116330043
2014-07-26 17:44:47 -04:00
Shenghou Ma
595dcef80a cmd/5l, cmd/6l, cmd/8l: remove mkenam.
Unused. cmd/dist will generate enams as liblink/anames[568].c.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/119940043
2014-07-26 17:43:10 -04:00