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

17900 Commits

Author SHA1 Message Date
Russ Cox
4d571c9093 fix up arg list parsing to handle any names:
type t1 int;
type t2 int;
type t3 int;
func f1(t1, t2, t3);
func f2(t1, t2, t3 bool);
func f3(t1, t2, x t3);
func f4(*t2, x t3);	// error: cannot mix
func f5(t1, *t3);
func (x *t1) f6(y *[]t2) (t1, *t3);
func f7() (int, *string);
func f8(t1, *t2, x t3);	// error: cannot mix
func f9() (x int, *string);
func f10(*t2, t3);

R=ken
OCL=16202
CL=16210
2008-09-30 12:53:11 -07:00
Ken Thompson
b6f59358b5 minor bugs
R=r
OCL=16163
CL=16163
2008-09-29 20:33:51 -07:00
Ian Lance Taylor
489b5001e2 Use unsigned int in itoa to avoid relying on the behaviour of
signed integer overflow when negating the most negative
integer.

R=rsc
DELTA=11  (0 added, 7 deleted, 4 changed)
OCL=16105
CL=16120
2008-09-29 13:40:23 -07:00
Russ Cox
e4a61c6524 * implement Linux epoll for polling i/o
* isolate OS-specific polling goop in Pollster type
* move generic poll loop out of fd_darwin.go into fd.go

R=r
DELTA=782  (448 added, 281 deleted, 53 changed)
OCL=16108
CL=16119
2008-09-29 13:37:00 -07:00
Russ Cox
878fe69bc1 delete unused files
R=r
DELTA=494  (0 added, 494 deleted, 0 changed)
OCL=16109
CL=16115
2008-09-29 13:16:28 -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
3a884d76ac bug in simul assignment
R=r
OCL=16053
CL=16053
2008-09-27 17:46:40 -07:00
Ken Thompson
ce0f1dee6f change print(float) from 5 to 7 sig digits
R=r
OCL=16045
CL=16045
2008-09-27 13:33:50 -07:00
Ken Thompson
7be2b9fdf6 bug in argument passing
R=r
OCL=16044
CL=16044
2008-09-27 13:32:38 -07:00
Ian Lance Taylor
2fb4edd3e1 Correct zoneinfo version number: it's not 2, it's '2'.
R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=16032
CL=16040
2008-09-27 09:39:37 -07:00
Ken Thompson
9f3d600be6 export
syntax for inheritance

R=r
OCL=16028
CL=16028
2008-09-26 21:27:26 -07:00
Ken Thompson
fb86c39362 bug with array bounds
R=r
OCL=16021
CL=16023
2008-09-26 17:41:43 -07:00
Ken Thompson
8545700af8 export
R=r
OCL=16018
CL=16022
2008-09-26 17:41:23 -07:00
Russ Cox
43c5e63c00 Darwin kqueue/kevent-based network FDs
R=r
OCL=15998
CL=16004
2008-09-26 14:46:28 -07:00
Russ Cox
5267db394c add os.Pipe
R=r
OCL=15989
CL=16001
2008-09-26 14:31:17 -07:00
Russ Cox
185a309737 fix build: new net Makefile
TBR=r
OCL=15996
CL=15996
2008-09-26 14:18:34 -07:00
Russ Cox
6201a963f1 move src/syscall to src/lib/syscall.
enforce rule: all kernel data structures and constants
	go in syscall module.
move things that should be in syscall out of net.
make net a single package.

R=r
OCL=15985
CL=15994
2008-09-26 14:11:26 -07:00
Russ Cox
2662aad7b7 libmach_amd64: refresh darwin thread list each time we get asked.
R=r
DELTA=1  (1 added, 0 deleted, 0 changed)
OCL=15982
CL=15993
2008-09-26 14:10:33 -07:00
Russ Cox
72154b042f go/acid/go
R=r
DELTA=99  (95 added, 1 deleted, 3 changed)
OCL=15983
CL=15992
2008-09-26 14:10:26 -07:00
Russ Cox
d448d18cb4 test and fix non-blocking chan ops on buffered chans
R=ken
DELTA=68  (19 added, 0 deleted, 49 changed)
OCL=15966
CL=15969
2008-09-26 11:47:04 -07:00
Russ Cox
c3d841f5d4 handle negative numeric constants in import.
(fixes bugs/bug106)

package bug0
export const A = -1

package bug1
import "bug0"

R=ken
DELTA=21  (19 added, 0 deleted, 2 changed)
OCL=15901
CL=15968
2008-09-26 11:44:20 -07:00
Russ Cox
2c52881a85 fix ELF bugs found by iant
- .text begins at INITTEXT, not 0
	   and does not include HEADR
	- .shstrtab, .gosymtab, .gopclntab have alignment 1
	- .gosymtab, .gopclntab have type SHT_PROGBITS

R=r
DELTA=9  (0 added, 0 deleted, 9 changed)
OCL=15953
CL=15956
2008-09-26 10:25:13 -07:00
Russ Cox
a0e7937243 6ar: exit with error status if files cannot be opened.
R=r
DELTA=15  (8 added, 0 deleted, 7 changed)
OCL=15952
CL=15954
2008-09-26 10:13:57 -07:00
Ian Lance Taylor
f023b7a997 Change the name of the result variable so that it does not
hide the package "ip".

R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=15914
CL=15914
2008-09-25 17:36:37 -07:00
Russ Cox
d4edee3dd0 prototype nit
R=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=15906
CL=15909
2008-09-25 17:07:24 -07:00
Russ Cox
34bb7a0bb2 gobuild -m: replace value of $GOARCH and $GOOS
in Makefile with $(GOARCH) and $(GOOS)

R=r
DELTA=40  (38 added, 0 deleted, 2 changed)
OCL=15905
CL=15908
2008-09-25 17:07:06 -07:00
Ian Lance Taylor
99ec031391 To get an empty string, return an empty string, not 0.
R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=15858
CL=15860
2008-09-25 10:51:23 -07:00
Ken Thompson
bcd07252e1 export
R=r
OCL=15805
CL=15805
2008-09-24 16:20:01 -07:00
Russ Cox
afd04fdb98 cleanup; sys.sleep can go.
R=r
OCL=15786
CL=15792
2008-09-24 15:28:03 -07:00
Russ Cox
42b7789a92 early HTTP library and trivial server
R=r
OCL=15777
CL=15791
2008-09-24 15:26:55 -07:00
Russ Cox
a61bb95497 get rid of per-G Note, avoids per-G kernel semaphore on Mac.
2.14u 19.82s 22.17r 	 6.out 100000	# old
1.87u 0.43s 2.31r 	 6.out 100000	# new

R=r
OCL=15762
CL=15772
2008-09-24 14:13:07 -07:00
Ken Thompson
5f0a5e7a13 more export
R=r
OCL=15771
CL=15771
2008-09-24 14:12:21 -07:00
Russ Cox
3f106f976a make prof work on linux
R=r
DELTA=18  (11 added, 1 deleted, 6 changed)
OCL=15752
CL=15755
2008-09-24 11:07:21 -07:00
Rob Pike
c79dffd5ef bug: updated wrong counter when combining values
R=rsc
OCL=15751
CL=15751
2008-09-24 10:35:59 -07:00
Russ Cox
5ff12f871f only use mach kernel semaphores for actual contention.
running rob's powser p.go:

3.21u 2.58s 5.80r 	 6.out	# old
1.48u 0.05s 1.54r 	 6.out	# new

R=r
OCL=15748
CL=15750
2008-09-24 10:25:28 -07:00
Rob Pike
eea21f8b85 rudimentary real-time profiler.
tested on mac only.
output like this:
	tubenose=% sudo go/src/cmd/prof/6prof -p 71839 -c  -d 10
	63.93%	mach_semaphore_signal
	 4.64%	sys·chansend1
	 3.93%	chanrecv
	 2.86%	semrelease
	 1.43%	cas
	 1.43%	sendchan
	 1.07%	xadd
	 0.71%	main·f
	 0.71%	scheduler
	 0.71%	sys·gosched
	 0.71%	dequeue
	 ...

R=rsc
DELTA=361  (361 added, 0 deleted, 0 changed)
OCL=15731
CL=15736
2008-09-23 18:45:44 -07:00
Rob Pike
7c48a39423 better debuggers:
- follow through segmented stacks
	- a couple of fixes to db

R=rsc
DELTA=72  (62 added, 0 deleted, 10 changed)
OCL=15713
CL=15717
2008-09-23 15:08:39 -07:00
Ken Thompson
1101d406ec more on export
R=r
OCL=15704
CL=15704
2008-09-23 14:16:41 -07:00
Ken Thompson
dc04d096f0 fixed export sort for methods
R=r
OCL=15699
CL=15699
2008-09-23 12:48:52 -07:00
Russ Cox
5383e28ea0 change string([]byte) to pass array, rather than &a[0],
to string convert.  if the byte array has length 0,
the computation of &a[0] throws an index bounds error.

for fixed size arrays, this ends up invoking arrays2d
unnecessarily, but it works.

R=ken
DELTA=304  (44 added, 28 deleted, 232 changed)
OCL=15674
CL=15678
2008-09-22 20:12:15 -07:00
Rob Pike
4d12c0e170 add os.Getenv()
R=rsc
DELTA=51  (50 added, 0 deleted, 1 changed)
OCL=15665
CL=15667
2008-09-22 17:31:41 -07:00
Ken Thompson
4332e0a546 remove extraneous print
R=r
OCL=15666
CL=15666
2008-09-22 17:29:12 -07:00
Ken Thompson
adaec0c4f4 vectors bug
R=r
OCL=15664
CL=15664
2008-09-22 16:58:30 -07:00
Russ Cox
c14924bcc8 implement zoneinfo reader
R=r
DELTA=348  (338 added, 0 deleted, 10 changed)
OCL=15648
CL=15660
2008-09-22 16:41:14 -07:00
Russ Cox
3c17ee69d9 add "once" package
R=r
DELTA=79  (79 added, 0 deleted, 0 changed)
OCL=15656
CL=15656
2008-09-22 16:26:57 -07:00
Russ Cox
ebd1eef41e implement spec: when main.main returns, the program exits
R=r
DELTA=9  (7 added, 2 deleted, 0 changed)
OCL=15628
CL=15643
2008-09-22 13:47:59 -07:00
Russ Cox
fb40f88c40 test cleanup
- do not print tracebacks if $GOTRACEBACK=0
	- set GOTRACEBACK=0 during tests
	- filter out pc numbers in errors

R=r
DELTA=70  (22 added, 30 deleted, 18 changed)
OCL=15618
CL=15642
2008-09-22 13:47:53 -07:00
Russ Cox
a27e61e2fe time bug: darwin, linux return microseconds not nanoseconds
R=r
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=15626
CL=15641
2008-09-22 13:46:57 -07:00
Russ Cox
fb2c66710c compiler changes:
export.c:
		- only expose explicitly exported types to importer
		- fix behind your back
	go.h:
		- add deep() prototype (fixes 64-bit linux crash on time.go)
	go.y:
		- add a new syntax error case
	walk.c:
		- allow a,b = f() where f is func ptr (fixes bug088)

R=ken
OCL=15617
CL=15630
2008-09-22 12:45:01 -07:00
Ken Thompson
8231e94520 now method/interface code
R=r
OCL=15627
CL=15627
2008-09-22 12:16:19 -07:00
Russ Cox
b676b0e125 better yacc rule in Makefile
if y.tab.c is older than y.tab.h, make
interprets doing nothing as a failure,
because y.tab.c hasn't been updated.
so update it.

R=r
DELTA=4  (0 added, 0 deleted, 4 changed)
OCL=15615
CL=15622
2008-09-22 10:56:54 -07:00
Ken Thompson
8a9752dcfb another async select bug
R=r
OCL=15599
CL=15599
2008-09-20 19:56:40 -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
1da727a31f fix bugs in asynch select
R=r
OCL=15586
CL=15586
2008-09-19 20:43:30 -07:00
Russ Cox
0e81bba1fe export an os.Error constructor
R=r
DELTA=20  (6 added, 7 deleted, 7 changed)
OCL=15569
CL=15571
2008-09-19 15:23:16 -07:00
Rob Pike
995f938ae3 more nuanced handling of usage message to allow user control.
also print argv(0) in default message

R=gri
DELTA=37  (21 added, 9 deleted, 7 changed)
OCL=15540
CL=15554
2008-09-19 12:52:00 -07:00
Russ Cox
72e3b204e4 add gobuild.
use gobuild-generated Makefile for math and os.
other makefile tweaks.
move math/main.go to test/math.go

R=r
OCL=15529
CL=15537
2008-09-19 11:55:46 -07:00
Russ Cox
5eb9e0621b avoid dereferencing nil type on undefined name.
R=ken
DELTA=12  (12 added, 0 deleted, 0 changed)
OCL=15506
CL=15528
2008-09-19 09:39:09 -07:00
Russ Cox
a67258f380 proper handling of signals.
do not run init on g0.

R=r
DELTA=161  (124 added, 23 deleted, 14 changed)
OCL=15490
CL=15497
2008-09-18 15:56:46 -07:00
Russ Cox
326bb67fbf whitespace
R=r
DELTA=0  (0 added, 0 deleted, 0 changed)
OCL=15492
CL=15494
2008-09-18 15:54:21 -07:00
Russ Cox
aca4f19e20 clean blyacc
R=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=15489
CL=15493
2008-09-18 15:50:28 -07:00
Russ Cox
f74ec00278 add -K flag to check stack underflow
R=ken
DELTA=38  (36 added, 0 deleted, 2 changed)
OCL=15482
CL=15491
2008-09-18 15:41:20 -07:00
Russ Cox
d1d7dc6c42 make blyacc too
R=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=15488
CL=15488
2008-09-18 15:09:48 -07:00
Russ Cox
76036192b9 make Makefiles safe for parallel make
use -j4 (4-way parallel) in make.bash.

halves time for make.bash on r45

also add libregexp, acid to default build

R=r
DELTA=90  (39 added, 37 deleted, 14 changed)
OCL=15485
CL=15487
2008-09-18 15:06:43 -07:00
Russ Cox
899c5281da make acid build on linux.
recognize symbol table info again on 64-only linux.

R=r
DELTA=11  (9 added, 0 deleted, 2 changed)
OCL=15486
CL=15486
2008-09-18 15:06:14 -07:00
Russ Cox
13f3149a01 more helpful messages for name-related syntax errors.
R=ken
OCL=15477
CL=15479
2008-09-18 13:32:14 -07:00
Russ Cox
9f35e8b227 time & date.
rename AddrToInt, StatToInt, etc -> BytePtr, StatPtr, ...

R=r
OCL=15450
CL=15456
2008-09-17 16:20:00 -07:00
Russ Cox
f0635bbfaa Linux bison rejects // comments outside { code snippets }
R=ken
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=15444
CL=15446
2008-09-17 14:09:44 -07:00
Russ Cox
68209ed5e3 fix printing of -(1<<63)
R=r
OCL=15441
CL=15445
2008-09-17 14:08:52 -07:00
Russ Cox
9350ef4eea add network listening & tests
R=r,presotto
OCL=15410
CL=15440
2008-09-17 13:49:23 -07:00
Ken Thompson
304440356d assignment in select
with new select operator

R=r
OCL=15418
CL=15418
2008-09-16 20:51:50 -07:00
Rob Pike
47919799b4 new grammar:
binary <- is send
	unary <- is recv
	-< is gone
	case a := <-ch: works in select
	case a = <-ch: works in select
support for new cases is not yet in the compiler but all non-select
code works

second CL will update affected go source

R=ken
OCL=15414
CL=15414
2008-09-16 19:14:33 -07:00
Russ Cox
4dfc7f0f14 fix / work around bugs in bufio test
R=r
DELTA=11  (8 added, 0 deleted, 3 changed)
OCL=15405
CL=15405
2008-09-16 14:15:54 -07:00
Russ Cox
e8a02230f2 preliminary network - just Dial for now
R=r,presotto
OCL=15393
CL=15399
2008-09-16 13:42:47 -07:00
Russ Cox
1841f3114e acid fixes etc. still not perfect.
R=r
DELTA=764  (694 added, 38 deleted, 32 changed)
OCL=15285
CL=15395
2008-09-16 12:33:00 -07:00
Ken Thompson
721cb9c6a1 redeclaring methods
R=r
OCL=15375
CL=15375
2008-09-15 19:07:23 -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
d01a1ec260 robs wednesday bug
R=r
OCL=15327
CL=15327
2008-09-14 17:29:50 -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
Rob Pike
c1ad0509ee remove special trap-handling code for array out of bounds -
compiler doesn't generate them any more

R=ken
OCL=15309
CL=15309
2008-09-13 13:13:36 -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
Russ Cox
7c9e2c2b6c buffered input & output
R=r
DELTA=812  (803 added, 0 deleted, 9 changed)
OCL=15225
CL=15280
2008-09-12 16:42:53 -07:00
Russ Cox
0a097b5cf3 change rand names to match type names
R=r
DELTA=66  (19 added, 9 deleted, 38 changed)
OCL=15232
CL=15265
2008-09-12 16:17:36 -07:00
Russ Cox
729bc5c0c7 rudimentary string utilities.
R=r
DELTA=314  (306 added, 8 deleted, 0 changed)
OCL=15074
CL=15263
2008-09-12 16:12:20 -07:00
Rob Pike
ab9f27b227 fix up linux trap handling - INTB 5 gives SEGV
R=rsc
OCL=15244
CL=15244
2008-09-12 12:35:06 -07:00
Rob Pike
e9047d1fc2 fix silly portability bug
R=gri
OCL=15238
CL=15238
2008-09-12 12:17:13 -07:00
Rob Pike
6e8dbc2051 - catch trace traps
- disassemble the instructions in a trace trap to see if it's a run-time trap
- if so, print relevant info
- avoid double-printing traceback on panic

R=ken,rsc
DELTA=66  (50 added, 7 deleted, 9 changed)
OCL=15199
CL=15224
2008-09-12 09:44:41 -07:00
Ken Thompson
47580f79b4 bug075
R=r
OCL=15192
CL=15192
2008-09-11 19:09:25 -07:00
Rob Pike
d6f15be61d fixes for funcs without returns
R=ken
OCL=15170
CL=15170
2008-09-11 15:48:42 -07:00
Ken Thompson
ff65872fbf function wo return is an error - not warning
R=r
OCL=15169
CL=15169
2008-09-11 15:44:45 -07:00
Robert Griesemer
0ba1db7475 - fixed missing return issues
R=r
OCL=15168
CL=15168
2008-09-11 15:38:22 -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
Rob Pike
5ea7649b43 pull O_RDONLY etc. up to os library
R=rsc
DELTA=16  (14 added, 0 deleted, 2 changed)
OCL=15156
CL=15163
2008-09-11 15:09:10 -07:00
Rob Pike
ccede3e872 make syscall use strings for file names
tweak os to adjust
move StringToBytes into syscall, at least for now

this program still works:

	package main

	import os "os"

	func main() {
		os.Stdout.WriteString("hello, world\n");
		a, b := os.NewFD(77).WriteString("no way");
		os.Stdout.WriteString(b.String() + "\n");
	}

R=rsc
DELTA=263  (59 added, 176 deleted, 28 changed)
OCL=15153
CL=15153
2008-09-11 13:40:17 -07:00
Rob Pike
c80b06a54e add lib/os to standard build
break lib/os into multiple source files

R=rsc
DELTA=189  (178 added, 4 deleted, 7 changed)
OCL=15149
CL=15152
2008-09-11 13:03:46 -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
a0e57201c7 bug in type of first argument to slice
R=r
OCL=15113
CL=15113
2008-09-10 16:45:41 -07:00
Rob Pike
c2723c23d6 make FD a struct with Read, Write, etc.
as methods

R=gri,rsc
DELTA=99  (56 added, 31 deleted, 12 changed)
OCL=15103
CL=15103
2008-09-10 15:23:28 -07:00
Rob Pike
92ae2cc8a3 add an Error type to be used as a singleton pointer
put all the code in one file for now to work around compiler bug

R=gri,rsc
DELTA=168  (120 added, 41 deleted, 7 changed)
OCL=15100
CL=15100
2008-09-10 14:19:03 -07:00
Rob Pike
795004c6b5 rudimentary beginnings of soon-to-be-real os library
R=gri
DELTA=76  (76 added, 0 deleted, 0 changed)
OCL=15086
CL=15088
2008-09-10 12:14:39 -07:00
Robert Griesemer
0416f994b7 - added convenience wrappers for sort
(work now with Ken's latest compiler fix)
- exoanded test cases accordingly
- fixed a type in the spec (thx r)

R=r
DELTA=65  (62 added, 2 deleted, 1 changed)
OCL=15050
CL=15050
2008-09-09 18:13:08 -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
Russ Cox
376898ca8b go threads for OS X
R=r
OCL=14944
CL=15013
2008-09-09 11:50:14 -07:00
Rob Pike
24838a2df6 fix bug in stack limit calculation - was setting limit reg in wrong place.
R=ken
OCL=14981
CL=14981
2008-09-08 19:30:14 -07:00
Robert Griesemer
18852cf6d3 - added sort package and test case
R=r
OCL=14975
CL=14975
2008-09-08 18:43:42 -07:00
Russ Cox
c3ca056143 go linux x86-64 kernel fixes:
* change .gosymtab and .gopclntab to section 7 (note)
	* start INITTEXT at 4MB, not 4KB

R=r
OCL=14953
CL=14959
2008-09-08 15:22:55 -07:00
Ken Thompson
077fe40867 bug with struct literal with metods
R=r
OCL=14937
CL=14937
2008-09-08 13:10:11 -07:00
Ken Thompson
0194aaf918 T{} syntax for constructors
T(expression) for conversion
FUNC keyword no longer a type

R=r
OCL=14887
CL=14887
2008-09-05 19:50:34 -07:00
Rob Pike
e2e48e9a8e use a makefile to build math
fix a typo in syscall/Makefile

R=ken
OCL=14863
CL=14863
2008-09-05 09:55:33 -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
Rob Pike
eab46c6ef4 include math in standard build
R=ken
OCL=14811
CL=14811
2008-09-04 13:09:49 -07:00
Ken Thompson
9dbaab54d1 rewriting bugs
R=r
OCL=14810
CL=14810
2008-09-04 12:21:10 -07:00
Rob Pike
4c9d84f06a Update fmt, refl, and rpc to exploit bug fixes in compiler
R=gri
OCL=14806
CL=14806
2008-09-04 10:39:04 -07:00
Rob Pike
6c72bfa55b fix bug in stack overflow check.
if stack is in low memory and frame size is huge, test could wrap around!
fix by omitting test altogether if we know frame is big.

R=gri
OCL=14782
CL=14782
2008-09-03 19:58:46 -07:00
Ken Thompson
182f91ffe0 map literals
R=r
OCL=14759
CL=14759
2008-09-03 14:40:22 -07:00
Ken Thompson
4539ced714 array literals
R=r
OCL=14756
CL=14756
2008-09-03 14:09:29 -07:00
Ken Thompson
1423bf3dc4 structure literals
R=r
OCL=14735
CL=14735
2008-09-02 19:11:25 -07:00
Ken Thompson
0ffacfd995 order of evaluation in function args
R=r
OCL=14733
CL=14733
2008-09-02 17:12:32 -07:00
Ken Thompson
9c5669bd0b bug in conv(string, bytearray)
R=r
OCL=14732
CL=14732
2008-09-02 16:21:30 -07:00
Rob Pike
b5eddae554 fix bug: was writing off end of array
R=gri
OCL=14728
CL=14728
2008-09-02 14:31:31 -07:00
Rob Pike
a0b2ccf9f4 vector cleanup:
- change Delete to Remove
- return deleted element in Remove
- remove range checking (runtime does this for you)

R=gri
OCL=14714
CL=14714
2008-09-02 13:16:43 -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
944ad62ecd fix type of (1<<x)
R=r
OCL=14656
CL=14656
2008-08-29 13:24:53 -07:00
Robert Griesemer
08c4380e48 - updated and cleaned up vector.go to use new array instructions
- added initial test cases (needs to be expanded)

R=r
DELTA=135  (84 added, 30 deleted, 21 changed)
OCL=14654
CL=14654
2008-08-29 11:10:23 -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
Rob Pike
b59b551be7 allow predefined identifiers (len, etc.) to be exported.
(they were not accepted as names by the import parser)

R=ken
DELTA=3  (0 added, 0 deleted, 3 changed)
OCL=14159
CL=14159
2008-08-13 15:24:55 -07:00
Ken Thompson
52861558f4 put i2s, s2i and i2i in convert
R=r
OCL=14143
CL=14143
2008-08-12 19:13:09 -07:00
Rob Pike
0f1d439e82 update bugs
exploit the compiler now supporting i2s and i2i and clean up some code
fix up some panics and prints

R=gri
OCL=14141
CL=14141
2008-08-12 17:07:33 -07:00
Ken Thompson
ead7a6d47a i2s and i2i
R=r
OCL=14140
CL=14140
2008-08-12 16:36:18 -07:00
Ken Thompson
c1ab5a554f resolve go.y edits
R=r
OCL=14132
CL=14132
2008-08-12 14:28:58 -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
Rob Pike
7293dab5a9 fix two print statements
R=gri
OCL=14105
CL=14105
2008-08-11 21:37:46 -07:00
Rob Pike
72d50900e3 fix a typo in the comments
R=ken
OCL=14104
CL=14104
2008-08-11 21:29:11 -07:00
Robert Griesemer
683ded80c9 - changed go-in-go parser to require ()'s for panic and print
- adjusted much of the existing go code
- missing: tests

R=r
DELTA=229  (1 added, 17 deleted, 211 changed)
OCL=14103
CL=14103
2008-08-11 21:20:42 -07:00
Ken Thompson
a8a9dbc9c6 print() and field names
R=r
DELTA=86  (61 added, 3 deleted, 22 changed)
OCL=14099
CL=14099
2008-08-11 19:17:28 -07:00
Rob Pike
968701beb1 - fix signedness bug in sys.Inf()
- add NaN, Inf printing to fmt
- fix a couple of bugs in fmt
- add a test for fmt

R=ken
OCL=14092
CL=14092
2008-08-11 15:04:54 -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
2b75556436 export large constants
R=r
DELTA=37  (31 added, 4 deleted, 2 changed)
OCL=14089
CL=14089
2008-08-11 13:22:04 -07:00
Ken Thompson
5649c23c8c fixed op=, ++ and -- on maps (bug060)
R=r
DELTA=22  (21 added, 0 deleted, 1 changed)
OCL=14049
CL=14049
2008-08-10 16:49:01 -07:00
Ken Thompson
258c817a1b allow name-type or pointer-to-named-type as method name (bug046)
R=r
DELTA=17  (11 added, 3 deleted, 3 changed)
OCL=14048
CL=14048
2008-08-10 15:09:09 -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
091047f36c adding and deleting files
R=r
DELTA=1685  (920 added, 765 deleted, 0 changed)
OCL=14030
CL=14030
2008-08-09 17:33:35 -07:00
Ken Thompson
272ae659db mp fixed arith
R=r
DELTA=149  (80 added, 62 deleted, 7 changed)
OCL=14029
CL=14029
2008-08-09 17:29:26 -07:00
Rob Pike
baf0747dd3 fix minor bug uncovered by new constant evaluator
R=gri
OCL=14025
CL=14025
2008-08-09 14:50:29 -07:00
Ken Thompson
67c4cc473c forgot a file
R=r
DELTA=427  (427 added, 0 deleted, 0 changed)
OCL=14017
CL=14017
2008-08-08 17:15:46 -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
907f38acfc Change generated acid to indent nested structures properly.
Before the change:

acid: M(m0)
	g0	00008dd0
	morearg	00000000
	cret	00000000
	curg	2aaaaaaab000
	lastg	00000000
Gobuf sched {
	SP	ffffe5e0
	PC	7fff00001ba1
}
	...
acid:

After the change:

acid: M(m0)
	g0	(G)00008dd0
	morearg	00000000
	cret	00000000
	curg	(G)2aaaaaaab000
	lastg	(G)00000000
	Gobuf sched {
		SP	ffffe5e0
		PC	00001ba1
	}
	...
acid:

R=ken
DELTA=27  (14 added, 2 deleted, 11 changed)
OCL=13802
CL=13998
2008-08-08 04:25:20 -07:00
Rob Pike
fa7d54ff2e include syscall in default build
fix an issue with autolib names by compiling to target location
print a bit more when compiling

R=gri
OCL=13988
CL=13988
2008-08-07 17:36:50 -07:00
Russ Cox
f7f6329e26 kill trailing white space.
(apparently my first attempt didn't work.)

R=r
OCL=13888
CL=13888
2008-08-05 14:21:42 -07:00
Russ Cox
96824000ed * comment, clean up scheduler
* rewrite lock implementation to be correct
  (tip: never assume that an algorithm you found
  in a linux man page is correct.)
* delete unneeded void* arg from clone fn
* replace Rendez with Note
* comment mal better
* use 6c -w, fix warnings
* mark all assembly functions 7

R=r
DELTA=828  (338 added, 221 deleted, 269 changed)
OCL=13884
CL=13886
2008-08-05 14:18:47 -07:00
Rob Pike
5adbacb8e7 allow pointers as keys in maps, treating them the same as ints - ptr eq not value equality
R=ken,gri
OCL=13879
CL=13879
2008-08-05 11:14:35 -07:00
Russ Cox
c8dee2770d acid. works only on Linux for now
R=r
DELTA=7031  (6906 added, 113 deleted, 12 changed)
OCL=13847
CL=13852
2008-08-04 17:24:25 -07:00
Robert Griesemer
2f4352a26d - switched most of existing Go code to new export syntax
- adjusted lang doc

R=r
DELTA=192  (26 added, 65 deleted, 101 changed)
OCL=13844
CL=13848
2008-08-04 17:17:59 -07:00
Russ Cox
d28acc42ec first cut at multithreading. works on Linux.
* kick off new os procs (machs) as needed
* add sys·sleep for testing
* add Lock, Rendez
* properly lock mal, sys·newproc, scheduler
* linux syscall arg #4 is in R10, not CX
* chans are not multithread-safe yet
* multithreading disabled by default;
  set $gomaxprocs=2 (or 1000) to turn it on

This should build on OS X but may not.
Rob and I will fix soon after submitting.

TBR=r
OCL=13784
CL=13842
2008-08-04 16:43:49 -07:00
Rob Pike
4f6ba4c8a5 use new export syntax to avoid repetition
R=gri
OCL=13819
CL=13819
2008-08-04 14:23:51 -07:00
Ken Thompson
695f83a9e0 export external functions
R=r
DELTA=16  (10 added, 4 deleted, 2 changed)
OCL=13815
CL=13815
2008-08-04 13:18:59 -07:00
Robert Griesemer
0cc772cbc0 - adjust Make.conf to use cc instead of cc64 for now
TBR=rsc
OCL=13804
CL=13804
2008-08-04 09:47:52 -07:00
Russ Cox
7b3771401c add nm
R=r
DELTA=339  (339 added, 0 deleted, 0 changed)
OCL=13786
CL=13794
2008-08-03 23:06:00 -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
Ken Thompson
989676d2ba add 'export' adjectives to external
var, const and type declarations.

R=r
DELTA=49  (12 added, 28 deleted, 9 changed)
OCL=13791
CL=13791
2008-08-03 18:47:02 -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
851100683e 6c delete .6 file on error
R=r
DELTA=1  (1 added, 0 deleted, 0 changed)
OCL=13785
CL=13785
2008-08-03 13:31:06 -07:00
Russ Cox
873ba78b79 Remove doubled #else
R=r
DELTA=4  (2 added, 2 deleted, 0 changed)
OCL=13775
CL=13779
2008-08-03 00:34:05 -07:00
Russ Cox
4feda71b7d slightly gratuitous reorg of scheduler code
* rename select (very loaded word) nextgoroutine
	* separate out "enter scheduler" (sys·gosched)
	  from the scheduler itself (scheduler)

R=r
APPROVED=r
DELTA=36  (17 added, 15 deleted, 4 changed)
OCL=13772
CL=13774
2008-08-02 22:34:04 -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
Rob Pike
c557836c8e - mark syscall support routines as non-stack-generating
- add unlink, creat
- add constants for open
- fix some comments

R=gri
OCL=13654
CL=13656
2008-07-30 14:23:53 -07:00
Rob Pike
ebec99179f fix a comment
fix a register name

R=gri
OCL=13548
CL=13548
2008-07-29 15:17:27 -07:00
Rob Pike
e06d1540c8 fixes for linux system call linkage
R=gri
OCL=13547
CL=13547
2008-07-29 15:06:21 -07:00
Rob Pike
ebcd76d540 rewrite system call interface to use less assembler.
R=gri
OCL=13546
CL=13546
2008-07-29 14:44:48 -07:00
Rob Pike
f095e263c5 fix type error caused by recent change
R=gri
OCL=13545
CL=13545
2008-07-29 13:16:42 -07:00
Ken Thompson
b2d9020242 len now takes an expression
R=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=13523
CL=13523
2008-07-28 13:54:58 -07:00
Rob Pike
d302244c6c add lstat
clean up some code
fix comments
add paramter names to interface

R=ken
OCL=13521
CL=13521
2008-07-28 13:07:58 -07:00
Rob Pike
3835e01d97 print tracebacks for all goroutines, not just the crashing one
R=ken
OCL=13518
CL=13518
2008-07-28 11:29:41 -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
bd397d2f9b select
R=r
DELTA=29  (27 added, 1 deleted, 1 changed)
OCL=13503
CL=13503
2008-07-27 11:42:52 -07:00
Rob Pike
eccea1980d add fstat, stat
R=ken
OCL=13497
CL=13497
2008-07-26 16:22:14 -07:00
Rob Pike
20a02661d9 beginnings of a low-level syscall library
R=ken
OCL=13483
CL=13496
2008-07-26 14:49:21 -07:00
Ken Thompson
120827284e select/chan
R=r
DELTA=517  (137 added, 98 deleted, 282 changed)
OCL=13495
CL=13495
2008-07-26 14:21:21 -07:00
Ken Thompson
949ab5c7ff select
R=r
APPROVED=r
DELTA=41  (24 added, 13 deleted, 4 changed)
OCL=13480
CL=13480
2008-07-25 17:03:27 -07:00
Ken Thompson
e963cba8a1 select
R=r
APPROVED=r
DELTA=147  (94 added, 14 deleted, 39 changed)
OCL=13477
CL=13477
2008-07-25 15:55:12 -07:00
Ken Thompson
ece3e57c85 read select
R=r
APPROVED=r
DELTA=120  (108 added, 0 deleted, 12 changed)
OCL=13468
CL=13468
2008-07-25 11:58:26 -07:00
Rob Pike
b4902c5f40 fix ordering problem: flag depends on fmt
R=gri
OCL=13442
CL=13442
2008-07-24 17:01:09 -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
Rob Pike
7693409677 add usage message
R=gri
OCL=13423
CL=13423
2008-07-24 10:38:22 -07:00
Rob Pike
ac0dd5ae52 Add a flags package.
R=gri
OCL=13399
CL=13399
2008-07-23 20:02:54 -07:00
Rob Pike
35b7a174e6 maintain __.PKGDEF files in archives if the 'g' flag is given
use this facility to simplify the math lib-building script

R=ken
DELTA=183  (158 added, 16 deleted, 9 changed)
OCL=13364
CL=13366
2008-07-22 15:57:46 -07:00
Rob Pike
05caa7f820 help management of empty pkg and lib directories in perforce
R=gri
DELTA=4  (4 added, 0 deleted, 0 changed)
OCL=13328
CL=13328
2008-07-21 17:10:49 -07:00
Ken Thompson
b78676a49d start of select
random bugs fixed

SVN=128149
2008-07-20 20:13:07 -07:00
Ken Thompson
963753d3f9 tweaks to init
rand using init

SVN=128142
2008-07-20 13:33:45 -07:00
Ken Thompson
f24f8ffae0 init
SVN=128128
2008-07-19 18:39:12 -07:00
Rob Pike
acf3d59847 update fmt to use some initialization
tweak ar so the pkgdef file doesn't cause it not to generate a symbol table

SVN=128119
2008-07-19 14:52:01 -07:00
Ken Thompson
c92aff2de7 init
SVN=128118
2008-07-19 14:37:02 -07:00
Ken Thompson
90da636c15 init filename vs pkgname
SVN=128117
2008-07-19 14:20:46 -07:00
Ken Thompson
fb3af53f4e initialization
SVN=128115
2008-07-19 13:38:29 -07:00
Ken Thompson
4c5a165873 len(fixed array)
SVN=128050
2008-07-18 11:59:35 -07:00
Ken Thompson
0ca551fc36 loop in subtype
SVN=127933
2008-07-17 18:15:05 -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
Ken Thompson
e7d549fbd7 new (more fifo) schedulint algorithm
newproc will reuse dead procs

SVN=127565
2008-07-16 13:50:23 -07:00
Ken Thompson
44b8934d35 back out last chan fix
allow print of pointers

SVN=127548
2008-07-16 12:44:21 -07:00
Ken Thompson
90da10d7ac chan bool offset bug
SVN=127537
2008-07-16 11:46:33 -07:00
Ken Thompson
ac048ce7f4 new chan syntax
SVN=127437
2008-07-15 21:07:59 -07:00
Rob Pike
cbdaa10f8c add linkage for writefile on darwin
SVN=127208
2008-07-15 08:27:50 -07:00
Rob Pike
c870ac239e add sys.writefile; support for darwin only in this CL
SVN=127153
2008-07-14 20:54:55 -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
2d9ff40774 chan asynch
SVN=127121
2008-07-14 17:41:38 -07:00
Rob Pike
bad8c3d5dd stop traceback when pc leaves text segment
SVN=127088
2008-07-14 16:00:44 -07:00
Ken Thompson
af58f17af9 synch chan
SVN=127057
2008-07-14 14:34:27 -07:00
Ken Thompson
526200345c synch chan
SVN=127055
2008-07-14 14:33:39 -07:00
Ken Thompson
f7e2bb55ae chan
SVN=126960
2008-07-13 16:22:50 -07:00
Ken Thompson
97cab903af chan
SVN=126959
2008-07-13 16:20:27 -07:00
Ken Thompson
594175d0b5 chan
SVN=126958
2008-07-13 14:29:46 -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
Rob Pike
439b0c40bc tools to update math lib.
you need a hack to 6ar to do this, but it's not checked in yet

SVN=126943
2008-07-12 15:56:06 -07:00
Ken Thompson
3856e45e03 more on channels
arg space magic number for morestack

SVN=126936
2008-07-12 13:08:53 -07:00
Rob Pike
2da9783e2b preserve AX across stack jump so C routines return correct value when triggering morestack.
SVN=126935
2008-07-12 11:30:53 -07:00
Rob Pike
b07e084a99 delete dead code
SVN=126932
2008-07-11 19:40:03 -07:00
Rob Pike
c8bce425b0 fix comment
SVN=126931
2008-07-11 19:37:47 -07:00
Rob Pike
44f65c8f08 fix traceback to know about new segmenting
SVN=126930
2008-07-11 19:35:14 -07:00
Ken Thompson
751ce3a77a segmented stacks AND goroutines
SVN=126929
2008-07-11 19:16:39 -07:00
Ken Thompson
2d7eecbbf4 bug in offsets in imported struct fields
SVN=126591
2008-07-09 17:15:10 -07:00
Rob Pike
d5f4d94b80 redefinition fix for autolib: if first ATEXT is already defined, skip this file
SVN=126580
2008-07-09 16:40:11 -07:00
Rob Pike
92bb676290 build packages automatically
SVN=126577
2008-07-09 16:09:48 -07:00
Rob Pike
12c81a0ce8 enable autolib
handle archives with __.PKGDEF elements (although we can't create them yet)
introduce a pkg directory
search the pkg directory for packages during compilation

SVN=126574
2008-07-09 16:05:03 -07:00
Ken Thompson
7b454bb1d9 defined external registers g and m
SVN=126521
2008-07-09 11:35:26 -07:00
Ken Thompson
77e20e8cec converted double to float64
SVN=126446
2008-07-08 20:48:41 -07:00
Rob Pike
41b9617be4 fix ldexp, frexp, and make math package compile and test correctly
SVN=126423
2008-07-08 17:26:10 -07:00
Ken Thompson
4528854308 unique import/export names
more on go statement

SVN=126421
2008-07-08 17:19:17 -07:00
Rob Pike
655c281303 disambiguate typedefs in export blocks of .6 files
SVN=126366
2008-07-08 14:20:04 -07:00
Rob Pike
6db99de606 add bytestorune and stringtorune to sys.
SVN=126321
2008-07-08 10:36:43 -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
999b12c768 remove incorrect (!) consts
-r

SVN=126198
2008-07-07 15:00:12 -07:00
Rob Pike
5b904a3bde update to Unicode 5
SVN=126184
2008-07-07 14:07:46 -07:00
Ken Thompson
0d079a5362 start of coroutine
SVN=126152
2008-07-07 12:29:26 -07:00
Ken Thompson
caa7193c95 took out vlong/uvlong/rune conversions
SVN=126053
2008-07-06 11:20:44 -07:00
Ken Thompson
4d6d4e7f4e random little bugs
SVN=126049
2008-07-05 17:43:25 -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
ac5a887d5d floating point print
SVN=126038
2008-07-04 18:01:35 -07:00
Ken Thompson
1efa6a0544 better recovery after syntax error
SVN=126003
2008-07-03 18:05:20 -07:00
Ken Thompson
81b325db1b a,b := fun()
SVN=125998
2008-07-03 17:41:05 -07:00
Ken Thompson
d915b96100 new iota
SVN=125984
2008-07-03 16:41:32 -07:00
Rob Pike
ef12ae4631 drop some superfluous file prefixes in runtime
SVN=125956
2008-07-03 13:42:04 -07:00
Robert Griesemer
27b4b2e4d3 - fixed .x file permissions
- implemented -strict mode if statement
- added readfile() to sys pkg
- removed outdated sys.go

SVN=125572
2008-07-01 16:48:31 -07:00
Rob Pike
6973e3813f update golden
fix a comment

SVN=125405
2008-06-30 16:30:53 -07:00
Rob Pike
03febb6773 clean up rearrangement of runtime functions in the source
add isNaN, isInf, NaN, Inf

SVN=125389
2008-06-30 15:30:47 -07:00
Rob Pike
d3204ef19f makes stack traces work for segmented stacks
SVN=125371
2008-06-30 14:39:47 -07:00
Rob Pike
8e82a673db Break runtime.c into separate pieces for maps, strings, print, etc.
Share common assembler for amd64 runtime

SVN=125317
2008-06-30 11:50:36 -07:00
Ken Thompson
b987f7a757 segmented stacks
SVN=125267
2008-06-29 20:40:08 -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
Rob Pike
ff4b01b440 fix two (!) bugs printing floating point zero
SVN=125260
2008-06-28 12:54:24 -07:00
Ken Thompson
ca029d34b6 another both sides functions
SVN=125230
2008-06-27 17:53:23 -07:00
Ken Thompson
57d80398e6 line numbers
SVN=125228
2008-06-27 17:35:42 -07:00
Rob Pike
4331293f41 update to new world. still can't use it but it's a lot of editing....
SVN=125218
2008-06-27 17:06:23 -07:00
Ken Thompson
390d5fe5b2 fixed fncall both sides
SVN=125217
2008-06-27 16:59:14 -07:00
Ken Thompson
102fcc6689 sametype message
SVN=125216
2008-06-27 16:43:02 -07:00
Ken Thompson
73f85f8a53 map index of index bug
SVN=125213
2008-06-27 16:30:20 -07:00
Rob Pike
34cb7c299e export sys.exit
update tests to use exit rather than return
ignore return value from main (actually done in prior CL)

SVN=125173
2008-06-27 14:15:06 -07:00
Rob Pike
3719aa4d9a update darwin for segmented stacks
SVN=125154
2008-06-27 13:10:56 -07:00
Ken Thompson
1f6828bcdf segmented stack
SVN=125151
2008-06-27 13:03:19 -07:00
Rob Pike
f977e251fa add a test
fix make.bash for runtime - sysfile.6 depends on OS so simplest thing is to build just our own version

SVN=125130
2008-06-27 11:36:40 -07:00
Rob Pike
1f672596c5 fix a few spelling mistakes in messages
SVN=125108
2008-06-27 10:29:02 -07:00
Ken Thompson
75937c2a16 better line numbers
SVN=125018
2008-06-26 17:54:44 -07:00
Robert Griesemer
553771314c - moved integer code into src/pkg
SVN=125003
2008-06-26 16:52:15 -07:00
Rob Pike
bcfd31f0e9 repair struct definition
SVN=124985
2008-06-26 15:35:43 -07:00
Rob Pike
f28ec1af7f slight change to file names
SVN=124982
2008-06-26 15:27:21 -07:00
Rob Pike
66b240c7a4 make readfile work on darwin
parameterize the system interface a bit

SVN=124981
2008-06-26 15:26:27 -07:00
Ken Thompson
e42d6a5fe2 add pointer to val type of maps
SVN=124971
2008-06-26 14:58:23 -07:00
Rob Pike
3e4e83ab1e add sys.readfile()
add args to linux runtime

SVN=124961
2008-06-26 14:09:26 -07:00
Rob Pike
9ff0e6288e runtime needs runtime.c
6l needs to know that there is no rt_amd64.6

SVN=124766
2008-06-25 21:31:17 -07:00
Rob Pike
41abdad5ec maybe now $O is right
SVN=124764
2008-06-25 21:24:14 -07:00
Rob Pike
5132d10305 O=6 not O=o
SVN=124763
2008-06-25 21:23:14 -07:00
Rob Pike
c87597de2c put a makefile into runtime
make the runtime library an archive (rt0 is still separate)
update 6l to use the archive
add fakeobj.c, missing from prior change

SVN=124762
2008-06-25 21:19:05 -07:00
Rob Pike
250a091922 add plan 9 ar, which understands our symbol tables
SVN=124761
2008-06-25 20:58:35 -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
Robert Griesemer
3311e1b673 - dump registers in case of signal (linux)
SVN=124702
2008-06-25 17:07:22 -07:00
Ken Thompson
1a3f944530 simul assignment
SVN=124591
2008-06-25 11:35:06 -07:00
Rob Pike
deaac9800f previous change was a nit too aggressive - regular comparison should apply when comparing
internal symbol names

SVN=124461
2008-06-24 21:44:48 -07:00
Rob Pike
4061a7e9c7 allow an underscore to match centered dot (rune 00B7), so people don't have to
type a centered dot when debugging.

SVN=124460
2008-06-24 21:42:54 -07:00
Ken Thompson
10296166a5 bug in returning a fat function result
SVN=124436
2008-06-24 18:14:32 -07:00
Rob Pike
1bef250f33 center dots into argument code
SVN=124433
2008-06-24 18:00:24 -07:00
Rob Pike
1e774d9e6a put center dot into main_main
restore smashed arg code, lost in incorrect resolve

SVN=124432
2008-06-24 17:58:18 -07:00
Ken Thompson
7d11924c13 middle dot as alpha package separator
SVN=124419
2008-06-24 17:16:06 -07:00
Robert Griesemer
206daeabda - added access to thread state info from the signal handler
SVN=124404
2008-06-24 16:48:54 -07:00
Rob Pike
2987c8434b arguments available
argc, argv, envc, envv all in sys now
sys.argc() etc.

SVN=124398
2008-06-24 15:31:03 -07:00
Ken Thompson
87dae02a63 string nil same as string ""
SVN=124381
2008-06-24 14:11:20 -07:00
Rob Pike
362ea7c77d remove explicit import of "sys"
add a boolean printer

SVN=124362
2008-06-24 12:54:26 -07:00
Ken Thompson
90846cd447 map[int] bug
SVN=124332
2008-06-24 11:10:47 -07:00
Ken Thompson
78c8dec944 bug miscalculating ullman
in CALLMETH/DOTMETH

SVN=124321
2008-06-24 10:30:33 -07:00
Rob Pike
d4c2da409b safety checks, waiting for gri's real tracking of PC and SP
extant code is too fragile

SVN=124223
2008-06-23 20:12:39 -07:00
Rob Pike
7b210c5b2f add signal handling to mac runtime
SVN=124184
2008-06-23 16:34:17 -07:00
Ken Thompson
dee07c884e maps
SVN=124030
2008-06-22 21:02:06 -07:00
Rob Pike
12c2864e4f more nearly correct interface code for signals on linux
SVN=124021
2008-06-21 17:28:37 -07:00
Rob Pike
aeb43984ec add signal handling and traceback support therein.
factor the runtime into architecture-dependent and -independent pieces.
ditto for the OS dependence.

SVN=124020
2008-06-21 15:36:23 -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
Rob Pike
85785fe577 delete incorrect offset print
SVN=123857
2008-06-20 10:55:53 -07:00
Rob Pike
1a2421e406 improved formatting of traceback
SVN=123527
2008-06-18 23:25:37 -07:00
Rob Pike
d6f25597bb print rudimentary stack traceback after panic
SVN=123524
2008-06-18 23:17:39 -07:00
Ken Thompson
ddba96aed8 stack offset
SVN=123521
2008-06-18 22:07:09 -07:00
Ken Thompson
f997bc6eb6 stack offseet table marker
tacked above each TEXT entry

SVN=123496
2008-06-18 17:51:56 -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
c242b53d22 more maps
more semi-colons
type assignment of constants

SVN=123278
2008-06-17 22:33:32 -07:00
Ken Thompson
c5bb50c9dc assign nil to interface
SVN=123256
2008-06-17 18:07:40 -07:00
Ken Thompson
7131bf476c SVN=123250 2008-06-17 18:02:06 -07:00
Ken Thompson
504aa698f7 SVN=123249 2008-06-17 18:01:05 -07:00
Ken Thompson
53ec6500bc yata
SVN=123246
2008-06-17 17:59:06 -07:00
Ken Thompson
0006c83231 optional semi-colons
SVN=123245
2008-06-17 17:57:31 -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
Rob Pike
88a3371a91 print pc on faults
SVN=123030
2008-06-16 17:04:30 -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
Rob Pike
073486c3ed add support for debugging in MACH binaries
fix up libmach_amd64 to handle MACH binaries and symbols
db now works on mac and linux

SVN=122807
2008-06-15 17:22:57 -07:00
Ken Thompson
efec14bc5a plan9 line numbers and line table
SVN=122793
2008-06-13 18:16:23 -07:00
Rob Pike
1ad1044b2d hack to find first instruction for decoding the pc/line table properly.
SVN=122792
2008-06-13 18:15:30 -07:00
Rob Pike
34691ccd10 support symbol tables and line numbers in 6.out executables
SVN=122700
2008-06-13 12:55:37 -07:00
Rob Pike
e9c9c9ace5 add symbol tables and line/pc information to 6.outs
SVN=122699
2008-06-13 12:54:21 -07:00
Ken Thompson
343f5aa7b4 better import/export
SVN=122584
2008-06-12 21:48:56 -07:00
Rob Pike
67e141b637 Bug fix. Without rounding, .shstrtab is written on top of data segment
SVN=122567
2008-06-12 18:51:06 -07:00
Rob Pike
b6c9221bb1 fix name of mach_amd64 library source dir
SVN=122506
2008-06-12 14:52:41 -07:00
Rob Pike
ed5e39a66d Add 6db
SVN=122505
2008-06-12 14:50:25 -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
54bca54655 make paths explicit for easier installation
SVN=122488
2008-06-12 13:43:47 -07:00
Rob Pike
e2e6b7e4cc remove reference to 9ar
SVN=122487
2008-06-12 13:38:54 -07:00
Rob Pike
24dbd2413b remove reference to 9ar
SVN=122486
2008-06-12 13:37:54 -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
Rob Pike
32aa0d9198 generated file; needs updating
SVN=122179
2008-06-11 14:03:52 -07:00
Rob Pike
820368a19a fix up mkfiles to use $GOROOT instead of $PLAN9
mention in setup doc that binaries go into $HOME/bin

SVN=122177
2008-06-11 13:59:55 -07:00
Rob Pike
df28e14e5b add a setup document, and tweak the scripts that it mentions
SVN=122175
2008-06-11 13:34:08 -07:00
Ken Thompson
2bba3a610d reorder1 - function first instead of last
SVN=122160
2008-06-11 12:25:44 -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
f9c58c25e0 more nihan
SVN=121622
2008-06-08 19:02:27 -07:00
Ken Thompson
9abf9e8a37 nihon
SVN=121620
2008-06-08 18:26:23 -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
Rob Pike
27d95f1372 use /bin/ed to avoid compatibility issues with plan 9 ed
SVN=121611
2008-06-08 17:02:01 -07:00
Ken Thompson
36bfd2a906 floating point
SVN=121607
2008-06-08 16:11:14 -07:00
Ken Thompson
8200a0b088 optional semicolons
SVN=121604
2008-06-08 12:48:37 -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
feb1c77f9c cafebabe
SVN=121574
2008-06-06 19:16:18 -07:00
Ken Thompson
b6218e6907 '\Ucafebabe'
SVN=121562
2008-06-06 17:42:03 -07:00
Ken Thompson
609cf0c3a7 fixed \\ secape in strings
SVN=121553
2008-06-06 17:08:21 -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
fa259ff89c fix different ANON flag between
darwin and linux

SVN=121371
2008-06-05 21:02:55 -07:00
Ken Thompson
959f9fb3d4 goos garch
SVN=121368
2008-06-05 19:53:15 -07:00
Ken Thompson
bbb2073223 goos garch
SVN=121367
2008-06-05 19:38:39 -07:00
Ken Thompson
8527f49e24 goos and goarch
SVN=121349
2008-06-05 16:57:26 -07:00
Ken Thompson
e2c3ec3173 goos goarch
SVN=121348
2008-06-05 16:56:23 -07:00
Ken Thompson
28429aaaa6 goos and goarch
SVN=121346
2008-06-05 16:55:06 -07:00
Ken Thompson
2b77d87fca goos and goarch
SVN=121345
2008-06-05 16:54:34 -07:00
Rob Pike
5624e34494 rearrange tree to reflect design based on $GOROOT $GOOS $GOARCH
SVN=121291
2008-06-05 14:20:24 -07:00
Ken Thompson
f4ccabdea6 stuff
SVN=121190
2008-06-04 16:44:48 -07:00
Rob Pike
df8ac28975 initial runtime code checkin
SVN=121183
2008-06-04 15:52:48 -07:00
Ken Thompson
f1880579ef loaded problem getting main from a library
SVN=121175
2008-06-04 15:33:59 -07:00
Ken Thompson
6633be6a86 fix loader problem loading main from a library
SVN=121174
2008-06-04 15:32:47 -07:00
Ken Thompson
3adcf6fa0e touch to make later modified date
SVN=121172
2008-06-04 15:08:59 -07:00
Rob Pike
6b4d69e5f0 move old code into 'old' directory
add src/test dir

SVN=121166
2008-06-04 14:46:07 -07:00
Rob Pike
0cafb9ea3d Add compiler source to new directory structure
SVN=121164
2008-06-04 14:37:38 -07:00
Rob Pike
7fbe486b1a use new conversion syntax to simplify test
SVN=118019
2008-05-07 17:34:51 -07:00
Rob Pike
37b8eb4648 fix double declaration of g
SVN=118016
2008-05-07 17:32:58 -07:00
Rob Pike
38c083c1ca Require names for return values for functions with complex return types.
SVN=117346
2008-05-01 00:01:45 -07:00
Rob Pike
b806ba4d88 Add description of how compiling and linking handle dependencies.
SVN=115807
2008-04-15 16:43:06 -07:00
Rob Pike
8cdb71017a remove noisy print
SVN=114939
2008-04-03 16:59:46 -07:00
Rob Pike
b749038246 Add a rudimentary vector container to ameliorate the inability to allocate dynamic arrays.
SVN=114931
2008-04-03 16:38:21 -07:00
Rob Pike
01764a30fe make digits a string instead of an array of bytes.
use string* to pass it around.

SVN=114795
2008-04-02 21:32:39 -07:00
Ken Thompson
5d6eba80f8 generate an error if the foreward
declaration of a func does not exactly
match the actual (or another foreward)
declaration. the reason is that when
there are 2 declarations of a function,
the names of the parameters are taken
from the first. thus
   func x(a int);
followed by
   func x(b int) { ... }
will have the parameter named "a" and
"b" will be undefined.

SVN=114788
2008-04-02 20:23:01 -07:00
Ken Thompson
87278c26e2 bug36
fixed error in symbol table in
the second forward declaration of
a function.

SVN=114572
2008-04-01 12:48:20 -07:00
Ken Thompson
e73674b291 code to assign nil to an interface
without conversions

SVN=114453
2008-03-31 19:19:37 -07:00
Ken Thompson
5918f80f1a bug31
failed to correctly convert from pointer
to interface in a return statement.

moved ANY from a special type in
chan/map to a basic type.

SVN=114350
2008-03-31 11:50:47 -07:00
Ken Thompson
c69d54e7cd bug28
fix code generation bug in
second index of string slice.

SVN=114255
2008-03-29 16:27:12 -07:00
Ken Thompson
0b62cb61ca fix bug30
automatic declaration leaking
from one function to another

SVN=114252
2008-03-29 15:37:38 -07:00
Ken Thompson
c5c8268a78 SVN=114213 2008-03-28 15:08:58 -07:00
Ken Thompson
2181098189 SVN=114204 2008-03-28 13:56:47 -07:00
Ken Thompson
cb87526ce3 SVN=114202 2008-03-28 13:41:41 -07:00
Rob Pike
42d7850608 Basic formatted I/O library plus one support lib.
SVN=113977
2008-03-27 00:06:21 -07:00
Brian Kernighan
d82b11e4a4 last-minute fix: convert to ANSI C
R=dmr
DELTA=3  (2 added, 0 deleted, 1 changed)
1988-04-01 02:03:04 -05:00
Brian Kernighan
0744ac9691 convert to Draft-Proposed ANSI C
R=dmr
DELTA=5  (2 added, 0 deleted, 3 changed)
1988-04-01 02:02:04 -05:00
Brian Kernighan
0bb0b61d6a convert to C
R=dmr
DELTA=6  (0 added, 3 deleted, 3 changed)
1974-01-20 01:02:03 -04:00
Brian Kernighan
7d7c6a97f8 hello, world
R=ken
DELTA=7  (7 added, 0 deleted, 0 changed)
1972-07-18 19:05:45 -05:00