1
0
mirror of https://github.com/golang/go synced 2024-10-04 09:11:21 -06:00
Commit Graph

282 Commits

Author SHA1 Message Date
Ken Thompson
42d89ac02c even more code improvement
R=r
OCL=21160
CL=21160
2008-12-14 18:45:00 -08:00
Ken Thompson
23fc0ac061 more code optimization
R=r
OCL=21159
CL=21159
2008-12-14 17:06:06 -08:00
Ken Thompson
719b088697 code generation
R=r
OCL=21146
CL=21146
2008-12-13 16:41:47 -08:00
Ken Thompson
937ac13f26 code improvement
R=r
OCL=21144
CL=21144
2008-12-13 13:16:14 -08:00
Russ Cox
cb64ec5bb6 only generate non-trivial signatures in the
file in which they occur.  avoids duplicate
trampoline generation across multiple files.

R=ken
OCL=20976
CL=20980
2008-12-11 11:54:33 -08:00
Ken Thompson
a4459c5520 bug
R=r
OCL=20940
CL=20940
2008-12-10 16:23:29 -08:00
Ken Thompson
1d4daa2d39 foundation for import unsafe
R=r
OCL=20794
CL=20794
2008-12-08 19:46:39 -08:00
Ken Thompson
a0a14b98fa empty switches -- bug128
R=r
OCL=20520
CL=20522
2008-12-04 16:05:40 -08:00
Ken Thompson
c8a66a98ff small code improvement to
used scaled indexing

R=r
OCL=20308
CL=20310
2008-12-02 19:54:51 -08:00
Ken Thompson
9a5c7eab16 better code for += -= ^= |= and &=
R=r
OCL=19953
CL=19953
2008-11-24 17:51:26 -08:00
Ken Thompson
8e3fe10ee3 1. retract general field names
2. array bounds bug
3. ... optimization bug

R=r
OCL=19927
CL=19927
2008-11-24 14:01:12 -08:00
Ken Thompson
a6182dab47 indexing optimizations and bug fix
R=r
OCL=19886
CL=19886
2008-11-23 17:26:49 -08:00
Ken Thompson
e081f25c3e reg and peep
R=r
OCL=19871
CL=19871
2008-11-22 17:58:53 -08:00
Russ Cox
9a6fd41a01 silence gcc warnings: missing prototypes and unused variables
R=ken
OCL=19583
CL=19583
2008-11-19 09:49:06 -08:00
Ken Thompson
64718ec262 oops
R=r
OCL=19566
CL=19566
2008-11-18 19:27:15 -08:00
Ken Thompson
2dd16a3208 first cut at optimizing
R=r
OCL=19564
CL=19564
2008-11-18 19:24:37 -08:00
Ken Thompson
93c8d3c41b another shift bug
R=r
OCL=19525
CL=19525
2008-11-18 17:15:42 -08:00
Ken Thompson
b7f01f9f41 silence compiler warning
R=r
OCL=19382
CL=19382
2008-11-17 12:55:22 -08:00
Ken Thompson
e875055461 switch
R=r
OCL=19288
CL=19288
2008-11-14 16:24:27 -08:00
Russ Cox
792145723e width fixes.
* check for uncomputed struct offsets
* distinguish function structs from ordinary structs
* make sure function structs are not examined in isolation

R=ken
OCL=19005
CL=19005
2008-11-11 13:46:55 -08:00
Ken Thompson
79f5697b02 byte multiply
R=r
OCL=18830
CL=18830
2008-11-07 16:05:17 -08:00
Ken Thompson
dc78c64f23 byte multiply
R=r
OCL=18807
CL=18807
2008-11-07 14:20:32 -08:00
Russ Cox
ec81145565 s/gins/gbranch/
R=ken
OCL=18713
CL=18713
2008-11-06 15:05:19 -08:00
Russ Cox
0eda21a2fd change minimum sethi/ullman number to 1
to distinguish not computed (0) vs trivial (1).

add missing ullmancalc on function args.

R=ken
OCL=18711
CL=18711
2008-11-06 14:50:58 -08:00
Russ Cox
1983121bbb 6g interface changes:
* allow conversion between nil interface and any type.
	* mark signatures as DUPOK so that multiple .6 can
	  contain sigt.*[]byte and only one gets used.

R=ken
OCL=18538
CL=18542
2008-11-05 11:27:50 -08:00
Russ Cox
c249a8de32 rename various magic names.
sigi and sigt:
	sys·sigi_inter -> sigi·inter
	sys·sigt_int -> sigt·int
	Package·sigt_Type -> sigt·Package.Type

	local type T in file x.go T_x -> T·x
	second one T_x_1 -> T·x·1

	method names M on T  T_M -> T·M

correctly handle local embedded types

init functions are the only place left that use underscores

R=ken
OCL=18377
CL=18377
2008-11-03 15:36:08 -08:00
Ken Thompson
250ec1665a unsigned divide by fn()
R=r
OCL=18351
CL=18351
2008-11-03 13:27:16 -08:00
Ken Thompson
d2472eb812 >>= and <<= shift bug
R=r
OCL=18322
CL=18322
2008-11-01 17:53:12 -07:00
Ken Thompson
74427c6346 DOTDOTDOT
R=r
OCL=18317
CL=18317
2008-11-01 16:36:46 -07:00
Ken Thompson
fd922c875d shift bug
R=r
OCL=18166
CL=18166
2008-10-30 14:32:04 -07:00
Ken Thompson
4a3ce5f19e sigt_int
R=r
OCL=18030
CL=18030
2008-10-29 13:40:00 -07:00
Ken Thompson
c21d9a1ec9 the end of life as we know it
int is new type

R=r
OCL=18023
CL=18023
2008-10-29 12:46:44 -07:00
Ken Thompson
b642cf8c00 embedded methods
R=r
OCL=17851
CL=17851
2008-10-25 13:31:25 -07:00
Ken Thompson
b379d54dea another step toward interface subtypes
put explicit ./ on some runtime tests

R=r
OCL=17839
CL=17839
2008-10-24 20:14:28 -07:00
Russ Cox
ad48706a24 do not use fake names on anonymous function return values
R=ken
OCL=17679
CL=17679
2008-10-22 17:45:47 -07:00
Russ Cox
44b0ecc5ca 6g: use full type in sigt[0].name
sys: add sys.reflect
runtime: add canfail flag for later

R=ken
OCL=17583
CL=17583
2008-10-21 15:38:26 -07:00
Ian Lance Taylor
907fea6b54 Link against -lm so that we can find the function "floor".
R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=17375
CL=17375
2008-10-17 15:52:49 -07:00
Russ Cox
b4f8e01acb more interface checks:
- pointer to interface cannot have methods
	- record type names for better runtime error

R=r,ken
DELTA=85  (80 added, 0 deleted, 5 changed)
OCL=16658
CL=16722
2008-10-08 09:21:57 -07:00
Russ Cox
74e2e087e2 change type names to go live at the name, so that
type T struct {
		next *T
	}

and

	type T *struct {
		next T
	}

are valid without needing forward declarations.

add "type T struct" syntax for forward struct declarations.

add "type T interface" syntax, but commented out
	(need to fix semicolons first)

R=ken
DELTA=452  (259 added, 115 deleted, 78 changed)
OCL=16580
CL=16584
2008-10-06 16:44:17 -07:00
Ken Thompson
f25843e65e bug 026
R=r
OCL=16494
CL=16494
2008-10-04 15:17:49 -07:00
Russ Cox
45f4e38506 silence gcc warnings
R=ken
OCL=16449
CL=16466
2008-10-03 16:23:02 -07:00
Ken Thompson
8877d27b40 interfaces of all types
R=r
OCL=16462
CL=16462
2008-10-03 16:12:21 -07:00
Ken Thompson
ed139c1e37 more on arbitrary receiver types
this CL passes the tests, but should
be considered unstable

R=r
OCL=16390
CL=16390
2008-10-02 20:51:10 -07:00
Ken Thompson
53a22770a7 names now println/panicln
bug fix in named-return

R=r
OCL=16377
CL=16377
2008-10-02 15:37:15 -07:00
Ken Thompson
d015f896bb clear output parameters
R=r
OCL=16345
CL=16345
2008-10-01 20:00:58 -07:00
Ken Thompson
970d6a14c4 initialization of
var a,b int;

R=r
OCL=16318
CL=16318
2008-10-01 14:16:57 -07:00
Ken Thompson
89ac5618ac toward methods on any type
R=r
OCL=16068
CL=16068
2008-09-28 20:22:31 -07:00
Ken Thompson
8545700af8 export
R=r
OCL=16018
CL=16022
2008-09-26 17:41:23 -07:00
Ken Thompson
adaec0c4f4 vectors bug
R=r
OCL=15664
CL=15664
2008-09-22 16:58:30 -07:00
Ken Thompson
8231e94520 now method/interface code
R=r
OCL=15627
CL=15627
2008-09-22 12:16:19 -07:00
Ken Thompson
39a4b1421f bug103 - but the fix caused other
things to break. hopefully all fixed
now.

R=r
OCL=15597
CL=15597
2008-09-20 14:59:15 -07:00
Ken Thompson
5d5e9f74cb bug - divide and mod of a byte
R=r
OCL=15370
CL=15370
2008-09-15 15:03:10 -07:00
Ken Thompson
2119294af9 methods on any type
-- but only *struct tested

R=r
OCL=15326
CL=15326
2008-09-14 16:57:55 -07:00
Ken Thompson
b9cee1b6c1 package name on signatures thru rename
R=r
OCL=15314
CL=15314
2008-09-13 14:51:39 -07:00
Ken Thompson
1ae08bee90 Automated g4 rollback of changelist 15312.
*** Reason for rollback ***

  <enter reason for rollback>

*** Original change description ***

correct signal name thru package rename

R=r
OCL=15313
CL=15313
2008-09-13 14:49:36 -07:00
Ken Thompson
28b9702741 correct signal name thru package rename
R=r
OCL=15312
CL=15312
2008-09-13 14:46:19 -07:00
Ken Thompson
bb3269fba0 snprints for safety
R=r
OCL=15311
CL=15311
2008-09-13 14:37:56 -07:00
Ken Thompson
904d4045d3 1 got rid if static 'fn wo return' test
2 added dynamic calls to throw for array bounds
  and 'fn wo return'
3 small optimization on index[constant]

R=r
OCL=15281
CL=15281
2008-09-12 16:48:35 -07:00
Ken Thompson
d30c9a4be5 implement discussed function wo return statement
R=r
OCL=15166
CL=15166
2008-09-11 15:23:01 -07:00
Ken Thompson
0a7e4a7415 bug generating duplicate interface signatures
R=r
OCL=15119
CL=15119
2008-09-10 19:49:35 -07:00
Ken Thompson
d40f032d18 fixed bug in certain
evaluation of complex literals

R=r
OCL=15036
CL=15036
2008-09-09 15:47:31 -07:00
Ken Thompson
193eac7917 bugs 29, 61, 62, 74
fixedbugs 49 now (correctly) fails
bugs 32, 41, 68, 77 shouldnt be bugs

R=r
OCL=14842
CL=14842
2008-09-04 17:15:15 -07:00
Ken Thompson
1423bf3dc4 structure literals
R=r
OCL=14735
CL=14735
2008-09-02 19:11:25 -07:00
Ken Thompson
a7f1af81bd minor bugs
R=r
OCL=14702
CL=14702
2008-09-01 14:37:32 -07:00
Ken Thompson
33ee52727f fixed labels/break/continue/goto
R=r
OCL=14675
CL=14675
2008-08-29 20:30:19 -07:00
Ken Thompson
53010efe01 shift operations to new spec
R=r
OCL=14641
CL=14641
2008-08-28 19:59:42 -07:00
Ken Thompson
c6130e9f1f get rid of static/dynamic array distinction
R=r
OCL=14634
CL=14634
2008-08-28 15:17:37 -07:00
Ken Thompson
66a603c986 arrays
R=r
OCL=14603
CL=14603
2008-08-27 17:28:30 -07:00
Ken Thompson
30fd44cf9d fix fat copy of overlapping data
R=r
OCL=14417
CL=14417
2008-08-21 20:49:04 -07:00
Ken Thompson
ead7a6d47a i2s and i2i
R=r
OCL=14140
CL=14140
2008-08-12 16:36:18 -07:00
Ken Thompson
4797523572 fixed bugs in const/case
R=r
DELTA=138  (75 added, 12 deleted, 51 changed)
OCL=14129
CL=14131
2008-08-12 14:04:03 -07:00
Ken Thompson
2679eefb31 floating <= and >= compare
R=r
DELTA=8  (0 added, 0 deleted, 8 changed)
OCL=14091
CL=14091
2008-08-11 13:53:50 -07:00
Ken Thompson
b89c538473 fixed unary ^ opcode (bug082)
R=r
DELTA=11  (10 added, 1 deleted, 0 changed)
OCL=14047
CL=14047
2008-08-10 14:35:02 -07:00
Ken Thompson
9c2ade358d mp constants
R=r
DELTA=381  (142 added, 26 deleted, 213 changed)
OCL=14011
CL=14016
2008-08-08 17:13:31 -07:00
Russ Cox
34514bdb72 Use a single Make.conf for setting CC, etc.
This makes it easy to build with other flags
(like -ggdb) or other compilers (like cc64).

R=r
DELTA=45  (6 added, 22 deleted, 17 changed)
OCL=13790
CL=13793
2008-08-03 23:03:31 -07:00
Russ Cox
9aad9fef76 make 6a, 6c, 6g, 6l, libmach_amd64 build on 64-bit gcc.
these guys really really want long to be 32-bits,
so ,s/long/int32/ (and then manual fixup).
still passes all tests.

(i started out looking for just those longs that
needed to be int32 instead, and it was just too hard
to track them down one by one.)

the longs were rare enough that i don't think
it will cause integration problems.

R=ken
OCL=13787
CL=13789
2008-08-03 17:25:15 -07:00
Ken Thompson
7889e03477 go method
R=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=13765
CL=13765
2008-08-02 15:31:21 -07:00
Ken Thompson
b1abcc195d random bug fixes
R=r
DELTA=18  (6 added, 1 deleted, 11 changed)
OCL=13504
CL=13504
2008-07-27 13:09:15 -07:00
Ken Thompson
cb9b1038db select
R=r
APPROVED=r
DELTA=638  (433 added, 21 deleted, 184 changed)
OCL=13426
CL=13438
2008-07-24 15:57:30 -07:00
Ken Thompson
b78676a49d start of select
random bugs fixed

SVN=128149
2008-07-20 20:13:07 -07:00
Ken Thompson
41861ca7bb one more time for divide
SVN=127911
2008-07-17 16:22:40 -07:00
Ken Thompson
9e2d185040 div bug
[]ptr bug
proc reuses old g* structures
differnt assignment of offsets to parameters

SVN=127888
2008-07-17 15:03:39 -07:00
Ken Thompson
814320c8b4 parameter in fn literals
SVN=127695
2008-07-16 18:31:01 -07:00
Ken Thompson
8003849498 parameter declartions in func literals
SVN=127678
2008-07-16 17:22:54 -07:00
Rob Pike
e9a194382e disambiguate error message
SVN=127152
2008-07-14 20:54:16 -07:00
Ken Thompson
c6e8e1cebf go call fn address
SVN=127151
2008-07-14 20:40:48 -07:00
Ken Thompson
3f982aeaf6 morestack magic number
automatically generated in 6g and 6c,
manually set in 6a. format is
	TEXT	a(SB),, $a-b
where a is auto size and b is parameter size

SVN=126946
2008-07-12 17:16:22 -07:00
Ken Thompson
3856e45e03 more on channels
arg space magic number for morestack

SVN=126936
2008-07-12 13:08:53 -07:00
Ken Thompson
751ce3a77a segmented stacks AND goroutines
SVN=126929
2008-07-11 19:16:39 -07:00
Ken Thompson
4528854308 unique import/export names
more on go statement

SVN=126421
2008-07-08 17:19:17 -07:00
Ken Thompson
1d31a25d83 more coroutine
fixed a,b,c := x,x,x

SVN=126250
2008-07-07 17:59:32 -07:00
Ken Thompson
caa7193c95 took out vlong/uvlong/rune conversions
SVN=126053
2008-07-06 11:20:44 -07:00
Ken Thompson
417a971f9a output args declared
arguments in first block for diagnostics
thomo return
better syntax error recovery

SVN=126045
2008-07-05 12:49:25 -07:00
Ken Thompson
d3237f9a2a more line numbers
SVN=125265
2008-06-28 17:27:39 -07:00
Ken Thompson
dc1602ca23 more line numbers
SVN=125261
2008-06-28 13:58:00 -07:00
Ken Thompson
ca029d34b6 another both sides functions
SVN=125230
2008-06-27 17:53:23 -07:00
Ken Thompson
390d5fe5b2 fixed fncall both sides
SVN=125217
2008-06-27 16:59:14 -07:00
Ken Thompson
75937c2a16 better line numbers
SVN=125018
2008-06-26 17:54:44 -07:00
Ken Thompson
e90ae879d6 autolib (#pragma lib)
added to 6g to autoload
the included import files.

SVN=124759
2008-06-25 20:22:10 -07:00
Ken Thompson
10296166a5 bug in returning a fat function result
SVN=124436
2008-06-24 18:14:32 -07:00
Ken Thompson
7d11924c13 middle dot as alpha package separator
SVN=124419
2008-06-24 17:16:06 -07:00
Ken Thompson
87dae02a63 string nil same as string ""
SVN=124381
2008-06-24 14:11:20 -07:00
Ken Thompson
78c8dec944 bug miscalculating ullman
in CALLMETH/DOTMETH

SVN=124321
2008-06-24 10:30:33 -07:00
Ken Thompson
54abac678a redeclarations of variables in the same block.
half-step toward multivalued map indexing

SVN=124019
2008-06-21 15:11:29 -07:00
Ken Thompson
1926fef175 bogus diagnostic with
default as first case
in a switch

SVN=123398
2008-06-18 11:43:50 -07:00
Ken Thompson
c5bb50c9dc assign nil to interface
SVN=123256
2008-06-17 18:07:40 -07:00
Ken Thompson
4e8142c929 maps
SVN=123089
2008-06-16 22:34:50 -07:00
Ken Thompson
3f2d542817 added and, or, xor opcodes
SVN=123031
2008-06-16 17:04:39 -07:00
Ken Thompson
e1a06ccc80 now checks for lvalue/rvalue context of
expressions.
start of generics for calling builtin
     functions
start of map type
'any' demoted from reserved word to type

SVN=122808
2008-06-15 20:24:30 -07:00
Ken Thompson
efec14bc5a plan9 line numbers and line table
SVN=122793
2008-06-13 18:16:23 -07:00
Ken Thompson
ef61a4cb1e better version of op=
fixed bugs in /= and %/

SVN=122493
2008-06-12 14:21:09 -07:00
Rob Pike
69b74c3953 import the plan 9 libraries libc (lib9) and libbio into the tree.
remove the dependency on /home/r.

SVN=122482
2008-06-12 13:26:16 -07:00
Ken Thompson
2254a8ee99 import/export
SVN=122309
2008-06-11 21:06:26 -07:00
Rob Pike
2694a85a52 tweaks in clean rules and dependencies
SVN=122274
2008-06-11 18:01:45 -07:00
Rob Pike
461d1b7987 convert from mk to make
phew.

SVN=122266
2008-06-11 17:50:07 -07:00
Ken Thompson
0b3093f0a5 debugging to get fmt to run
SVN=122046
2008-06-10 21:29:57 -07:00
Ken Thompson
36f21e00f5 mode elf tossing
SVN=121962
2008-06-10 12:42:37 -07:00
Ken Thompson
6a659ebf13 new elf header
SVN=121737
2008-06-09 13:16:50 -07:00
Ken Thompson
b6eca3534c bug in len
SVN=121618
2008-06-08 17:46:28 -07:00
Ken Thompson
610644a1ca asdf
SVN=121615
2008-06-08 17:21:46 -07:00
Ken Thompson
36bfd2a906 floating point
SVN=121607
2008-06-08 16:11:14 -07:00
Ken Thompson
f7753f1687 more code generation - mostly shift and multiply
SVN=121585
2008-06-07 15:21:02 -07:00
Ken Thompson
181ad4743c more div/mod
SVN=121577
2008-06-06 21:21:54 -07:00
Ken Thompson
d83b994da6 div and mod operators
SVN=121576
2008-06-06 20:43:29 -07:00
Ken Thompson
a93099cd8c SVN=121547 2008-06-06 17:01:33 -07:00
Ken Thompson
6b8bd3556a nonaddressable = functioncall
code gen error

SVN=121541
2008-06-06 16:49:35 -07:00
Ken Thompson
d1493d1edc checked into both gc and runtime by mistake
SVN=121498
2008-06-06 15:01:50 -07:00
Ken Thompson
498ed50061 code gen bug calling i2s
SVN=121497
2008-06-06 15:01:02 -07:00
Ken Thompson
e372be9e76 code gen bug in ++ and --
SVN=121476
2008-06-06 13:54:59 -07:00
Ken Thompson
8527f49e24 goos and goarch
SVN=121349
2008-06-05 16:57:26 -07:00
Ken Thompson
6633be6a86 fix loader problem loading main from a library
SVN=121174
2008-06-04 15:32:47 -07:00
Rob Pike
0cafb9ea3d Add compiler source to new directory structure
SVN=121164
2008-06-04 14:37:38 -07:00