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

68 Commits

Author SHA1 Message Date
Russ Cox
0a6d83567e print uint64 as uint64.
R=ken
OCL=29568
CL=29570
2009-05-28 22:24:03 -07:00
Ken Thompson
e2613711aa detect recursive initialization
R=r
OCL=29544
CL=29544
2009-05-28 16:00:55 -07:00
Ken Thompson
64c3fe05bf string([]int) conversion
R=r
OCL=29466
CL=29466
2009-05-27 15:38:02 -07:00
Russ Cox
a8e4ed6a3d 8g: 64-bit arithmetic and assorted bug fixes;
can run 64-bit sieve and powser.
interfaces are limping along.
next hurdle is floating point.

R=ken
OCL=29418
CL=29423
2009-05-26 21:07:26 -07:00
Russ Cox
f4d3d22a94 enforce channel direction
R=ken
OCL=29209
CL=29216
2009-05-21 17:32:44 -07:00
Russ Cox
23e62d169f stricter interface conversion rule: i.(T)
must have non-nil i.

R=ken
OCL=29136
CL=29136
2009-05-20 18:23:19 -07:00
Russ Cox
2da5022bcf change representation of interface values.
this is not a user-visible change.

before, all interface values were

	struct Itype {
		Sigt *type;
		Sigi *inter;
		void *method[n];
	}

	struct Iface {
		void *addr;
		Itype *itype;
	}

the itype is basically a vtable, but it's unnecessary
if the static type is interface{ }.
for interface values with static type empty, the
new representation is

	struct Eface {
		void *addr;
		Sigt *type;
	}

this complicates the code somewhat, but
it reduces the number of Itypes that
have to be computed and cached,
it opens up opportunities to avoid function
calls in a few common cases,
and it will make it possible to lay out
interface{} values at compile time,
which i think i'll need for the new reflection.

R=ken
OCL=28701
CL=29121
2009-05-20 14:57:55 -07:00
Russ Cox
918afd9491 move things out of sys into os and runtime
R=r
OCL=28569
CL=28573
2009-05-08 15:21:41 -07:00
Rob Pike
c367d1b789 Move sys.Reflect and sys.Unreflect into unsafe.
R=rsc
DELTA=19  (4 added, 5 deleted, 10 changed)
OCL=28563
CL=28566
2009-05-08 14:57:56 -07:00
Russ Cox
f821e3c7c3 6g tweaks
* byteastring is no longer used
	* do not generate ODCL, OAS for globals
	  (wasn't generating any code but might
	  save one or two init functions)
	* do not call self from Init function

R=ken
OCL=28309
CL=28309
2009-05-05 16:53:46 -07:00
Ken Thompson
a91a8042b4 range over strings
R=r
OCL=27332
CL=27332
2009-04-10 19:49:31 -07:00
Ken Thompson
0f469a99a3 binary search on type switches.
new feature 'case nil:' in type switch
will match iff the interface is nil.

R=r
OCL=26404
CL=26404
2009-03-17 13:58:38 -07:00
Ken Thompson
6eb54cb05b chan flags close/closed installed
runtime not finished.

R=r
OCL=26217
CL=26217
2009-03-12 17:55:11 -07:00
Russ Cox
0970c46863 closures - 6g support
R=ken
OCL=24501
CL=24566
2009-02-06 13:47:10 -08:00
Russ Cox
3c5f3a8641 print(map) and print(chan) as pointers.
R=ken
OCL=23520
CL=23520
2009-01-26 15:36:28 -08:00
Russ Cox
1f8a40d85c move math routines from package sys to package math,
though they still build in src/runtime.

use cgo instead of hand-written wrappers.

R=r
DELTA=740  (289 added, 300 deleted, 151 changed)
OCL=23326
CL=23331
2009-01-22 16:23:44 -08:00
Russ Cox
839a68469b delete export
TBR=r
OCL=23121
CL=23127
2009-01-20 14:40:40 -08:00
Russ Cox
360962420c casify, cleanup sys
R=r
OCL=22978
CL=22984
2009-01-16 14:58:14 -08:00
Russ Cox
a3ed4e716a add sys.caller
R=r
DELTA=139  (101 added, 38 deleted, 0 changed)
OCL=22462
CL=22466
2009-01-09 15:52:43 -08:00
Russ Cox
484ba939d2 update sys.reflect and sys.unreflect to accomodate
the possibility of large objects in interface values.

R=r
DELTA=171  (97 added, 22 deleted, 52 changed)
OCL=22382
CL=22382
2009-01-09 00:17:46 -08:00
Russ Cox
dc7b2e98d2 compiler changes for *chan -> chan; *map -> map; new(T) -> new(*T)
mainly a syntactic change: the compiler representations don't change
(chan and map are now hidden pointers like string).

R=ken
OCL=21578
CL=21582
2008-12-19 03:05:54 -08:00
Russ Cox
d47d888ba6 convert *[] to [].
R=r
OCL=21563
CL=21571
2008-12-18 22:37:22 -08:00
Ken Thompson
9786f69f74 print(array)
R=r
OCL=21570
CL=21570
2008-12-18 22:17:05 -08:00
Ken Thompson
4026500d18 arrays
R=r
OCL=21564
CL=21564
2008-12-18 20:06:28 -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
26b357ca5b range statement
R=r
OCL=20667
CL=20667
2008-12-05 18:24:05 -08:00
Russ Cox
bf3dd3f0ef add mutex.Mutex
R=r
DELTA=349  (348 added, 0 deleted, 1 changed)
OCL=20380
CL=20472
2008-12-04 12:51:36 -08:00
Russ Cox
67addd4e11 symbol table changes
* add gotype string to symbol table
	* fill in gotype in 6l for known funcs/vars
	* print gotype with nm -t

	* load symbol and pc/ln tables into memory at magic address 0x99<<32.
	* add sys.symdat() to retrieve raw bytes of symbol table
	  and pc/ln table.

most of this should be considered experimental
and subject to change.

R=r
DELTA=157  (128 added, 0 deleted, 29 changed)
OCL=19746
CL=19750
2008-11-20 17:32:18 -08:00
Rob Pike
2f4d35ffb9 converting uint bits back into floats
R=rsc
DELTA=32  (32 added, 0 deleted, 0 changed)
OCL=19084
CL=19091
2008-11-12 11:51:34 -08:00
Rob Pike
335a5236e7 add sys.float32bits, sys.float64bits
R=rsc
DELTA=21  (21 added, 0 deleted, 0 changed)
OCL=18709
CL=18718
2008-11-06 15:48:36 -08:00
Ken Thompson
79fbbe37a7 select default
R=r
OCL=18646
CL=18646
2008-11-05 21:50:28 -08:00
Russ Cox
e5d9a5c9f0 runtime support for interface ok,
whatever the final syntax ends up being.

R=ken
OCL=18414
CL=18414
2008-11-03 17:34:37 -08:00
Russ Cox
47caf6424c 6l: generate gotypesigs on demand.
add sys.unreflect, which uses gotypesigs.

R=r
DELTA=170  (152 added, 12 deleted, 6 changed)
OCL=18396
CL=18404
2008-11-03 16:03:12 -08: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
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
Rob Pike
5933dbda3a delete hack for interface equality now that it supported by the 6g compiler
R=rsc
DELTA=21  (0 added, 21 deleted, 0 changed)
OCL=17123
CL=17136
2008-10-14 16:33:11 -07:00
Ken Thompson
edb1412c50 interface equality
R=r
OCL=17116
CL=17118
2008-10-14 15:08:23 -07:00
Russ Cox
827dcb86b7 add sys.BUG_intereq to compare interfaces for equality
R=r
OCL=16929
CL=16929
2008-10-10 15:30:32 -07:00
Rob Pike
7ee60b174d sys.stringtorune doesn't need a length parameter.
R=rsc
DELTA=7  (0 added, 0 deleted, 7 changed)
OCL=16600
CL=16630
2008-10-07 10:03:34 -07:00
Russ Cox
b8babed7c2 new import/export format
package flag
	export type flag.Flag struct { name flag.string; usage flag.string; \
		value flag.Value; next *flag.Flag }
	type flag.string string
	type flag.Value interface { AsBool () (? *flag.BoolValue); \
		AsInt () (? *flag.IntValue); AsString () (? *flag.StringValue); \
		IsBool () (? flag.bool); IsInt () (? flag.bool); IsString () (? flag.bool); \
		Str () (? flag.string); ValidValue (str flag.string) (? flag.bool) }
	type flag.BoolValue struct { val flag.bool; p *flag.bool }
	type flag.IntValue struct { val flag.int64; p *flag.int64 }
	type flag.StringValue struct { val flag.string; p *flag.string }
	type flag.bool bool
	func (e *flag.StringValue) AsBool () (? *flag.BoolValue)
	func (e *flag.StringValue) AsInt () (? *flag.IntValue)
	...

the \ continuations are for this message, not real.

changed delimiter for import from (( )) to $$ $$.

replaced mksys.bash with mksys.c

changed sys.go to use leading export,
	fake package name is now SYS not foop

don't always require ; on forward func decls

R=ken,r
DELTA=1827  (446 added, 1083 deleted, 298 changed)
OCL=16433
CL=16463
2008-10-03 16:15:55 -07:00
Ken Thompson
f21e731c71 added printn and panicn
prints that insert spaces and new line

R=r
OCL=16370
CL=16370
2008-10-02 14:38:07 -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
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
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
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
66a603c986 arrays
R=r
OCL=14603
CL=14603
2008-08-27 17:28:30 -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
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
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