Austin Clements
816e3da26d
Make Value always represent an l-value and never a generic
...
container for values.
Instead of having one evaluator function that returns a
generic Value, there is now an evaluator function for each
generalized type that simply returns a native type.
The compiler is more type-safe now because there are almost no
type conversions at evaluation time and it's impossible to
invoke a nil evaluator function during evaluation. This also
makes ideals and pointers really clean.
As an added bonus, expression evaluation should be faster
because it doesn't require heap allocation for every
intermediate value, type switches, or lots of conversions to
and from Value. It also involves fewer function calls.
R=rsc
APPROVED=rsc
DELTA=431 (280 added, 115 deleted, 36 changed)
OCL=31705
CL=31709
2009-07-15 17:56:17 -07:00
Rob Pike
3fc7cfd55f
improve server handling of errors now that Decoder grabs full message.
...
R=rsc
DELTA=23 (4 added, 7 deleted, 12 changed)
OCL=31701
CL=31703
2009-07-15 16:11:14 -07:00
Rob Pike
e76a335ada
make the low-level encoder and decoder private and have them access byte.Buffers rather
...
than io.Readers and io.Writers.
change the Encoder/Decoder protocol so that each message is preceded by its length in bytes.
R=rsc
DELTA=468 (119 added, 23 deleted, 326 changed)
OCL=31700
CL=31702
2009-07-15 16:10:17 -07:00
Rob Pike
dc8c447689
post-submit tweaks to previous cl
...
R=rsc
DELTA=5 (4 added, 1 deleted, 0 changed)
OCL=31690
CL=31692
2009-07-15 12:38:50 -07:00
Austin Clements
9211a7d413
Beginnings of a Go interpreter. This implements basic and
...
pointer types, supports literals, identifiers, type-checking
most unary and binary operators, "compiling" a few unary and
binary operators, and assignment and declaration statements.
R=rsc
APPROVED=rsc
DELTA=1751 (1751 added, 0 deleted, 0 changed)
OCL=31309
CL=31691
2009-07-15 11:59:13 -07:00
Rob Pike
8071cdf724
handle errors better:
...
1) terminate outstanding calls on the client when we see EOF from server
2) allow data to drain on server before closing the connection
R=rsc
DELTA=41 (23 added, 4 deleted, 14 changed)
OCL=31687
CL=31689
2009-07-15 11:47:29 -07:00
Russ Cox
aa1e8064b2
change HTTP access for RPC.
...
1. use CONNECT instead of GET.
CONNECT has exactly the meaning
we want; most of the time people
connect to ip:port; we're connecting
to /_goRPC_
2. wait for a successful HTTP response
before assuming we are connected to
the RPC protocol. this allows better
error reporting and also keeps the
protocol alternating between speakers,
so that the buffering in the HTTP request
reader cannot accidentally eat some
RPC bytes too.
gotest sometimes hangs, but not in HTTP.
gotest -match=Unknown hangs every few runs
even in a clean client.
R=r
DELTA=117 (57 added, 44 deleted, 16 changed)
OCL=31656
CL=31685
2009-07-15 10:49:47 -07:00
Austin Clements
8b7951495c
Implement forking debugged processes.
...
R=rsc
APPROVED=rsc
DELTA=81 (53 added, 3 deleted, 25 changed)
OCL=31651
CL=31675
2009-07-15 10:17:56 -07:00
Robert Griesemer
3d486d0d26
- do not collect BUG comments w/o bug description
...
R=rsc
DELTA=17 (8 added, 0 deleted, 9 changed)
OCL=31670
CL=31674
2009-07-15 10:12:57 -07:00
Austin Clements
8d8245623f
Add a dummy WaitStatus.TrapCause for Darwin to unbreak the build.
...
R=gri
APPROVED=gri
DELTA=5 (5 added, 0 deleted, 0 changed)
OCL=31673
CL=31673
2009-07-15 10:12:06 -07:00
Austin Clements
d0e29f2852
Pretty printer for os.Waitmsg
...
R=rsc
APPROVED=rsc
DELTA=49 (49 added, 0 deleted, 0 changed)
OCL=31568
CL=31671
2009-07-15 09:58:42 -07:00
Rob Pike
964b6cf352
add HTTP support
...
R=rsc
DELTA=159 (110 added, 29 deleted, 20 changed)
OCL=31646
CL=31652
2009-07-14 20:47:39 -07:00
Austin Clements
b6e6663946
Return ptrace event message when there's no error instead of
...
only when there's an error.
R=rsc
APPROVED=rsc
DELTA=3 (0 added, 2 deleted, 1 changed)
OCL=31650
CL=31650
2009-07-14 18:05:29 -07:00
Rob Pike
ba9d697336
allow user to override the Usage function
...
R=gri
DELTA=15 (6 added, 5 deleted, 4 changed)
OCL=31649
CL=31649
2009-07-14 17:44:20 -07:00
Robert Griesemer
eb815c0fa2
fixed typo
...
TBR=r
OCL=31647
CL=31647
2009-07-14 17:08:09 -07:00
Robert Griesemer
4fb8f44ea7
- interface and comments cleanup
...
R=rsc
DELTA=33 (1 added, 3 deleted, 29 changed)
OCL=31620
CL=31642
2009-07-14 16:30:20 -07:00
Robert Griesemer
59ee0373fc
- removed TODO, minor adjustments
...
R=rsc
DELTA=16 (6 added, 1 deleted, 9 changed)
OCL=31638
CL=31641
2009-07-14 16:30:06 -07:00
Russ Cox
f752e909dc
darwin ptrace constants
...
R=austin
DELTA=42 (37 added, 5 deleted, 0 changed)
OCL=31618
CL=31633
2009-07-14 15:29:29 -07:00
Austin Clements
c105de748d
Implementation of process tracing using Linux's ptrace.
...
R=rsc
APPROVED=rsc
DELTA=1543 (1528 added, 0 deleted, 15 changed)
OCL=31570
CL=31630
2009-07-14 15:12:10 -07:00
Austin Clements
14bb806cb4
Support ptracing of fork'd children.
...
R=rsc
APPROVED=rsc
DELTA=26 (22 added, 1 deleted, 3 changed)
OCL=31613
CL=31629
2009-07-14 15:09:39 -07:00
Austin Clements
40f406afc4
Zero unused syscall arguments.
...
R=rsc
APPROVED=rsc
DELTA=12 (12 added, 0 deleted, 0 changed)
OCL=31619
CL=31621
2009-07-14 13:59:54 -07:00
Rob Pike
b07af158a4
improve rpc code. more robust. more tests.
...
R=rsc
DELTA=186 (133 added, 20 deleted, 33 changed)
OCL=31611
CL=31616
2009-07-14 13:23:14 -07:00
Austin Clements
bc2fda9c89
Regenerate Linux 386 syscall bindings to add ptrace.
...
R=rsc
APPROVED=rsc
DELTA=82 (80 added, 2 deleted, 0 changed)
OCL=31610
CL=31612
2009-07-14 11:59:19 -07:00
Austin Clements
9df528740a
Syscall wrappers for ptrace and supporting wait-related flags.
...
R=rsc
APPROVED=rsc
DELTA=311 (308 added, 3 deleted, 0 changed)
OCL=31569
CL=31606
2009-07-14 10:53:04 -07:00
Robert Griesemer
e48d8fe091
update remaining files to match new scanner/parser interface
...
and use shared error handling infrastructure
R=rsc
DELTA=109 (3 added, 86 deleted, 20 changed)
OCL=31600
CL=31605
2009-07-14 10:46:18 -07:00
Robert Griesemer
5945b25158
- adjust to new token.Position definition
...
R=rsc
DELTA=1 (0 added, 0 deleted, 1 changed)
OCL=31574
CL=31604
2009-07-14 10:45:57 -07:00
Robert Griesemer
2d58fa6f18
- use new scanner error handling code
...
R=rsc
DELTA=109 (0 added, 87 deleted, 22 changed)
OCL=31573
CL=31603
2009-07-14 10:45:43 -07:00
Robert Griesemer
a010d45caa
- adjust to new scanner interface (pass filename to Init)
...
- delete error handling code which is not needed anymore
R=rsc
DELTA=83 (0 added, 65 deleted, 18 changed)
OCL=31572
CL=31602
2009-07-14 10:45:22 -07:00
Robert Griesemer
14228f3898
- added Filename field to token.Position
...
- handle //line filename:line comments in scanner
- moved error handling code used by various scanner clients
to errors.go
- added extra tests
R=rsc
DELTA=385 (343 added, 18 deleted, 24 changed)
OCL=31551
CL=31601
2009-07-14 10:44:57 -07:00
Russ Cox
10e995fba8
dead code
...
R=r
DELTA=20 (0 added, 20 deleted, 0 changed)
OCL=31584
CL=31598
2009-07-14 09:28:42 -07:00
Russ Cox
be16caf872
step toward no function prototypes.
...
delay evaluation of most types (all but func)
from parse time to type check time.
R=ken
OCL=31585
CL=31585
2009-07-13 23:38:39 -07:00
Russ Cox
a6799963ef
update 6g to new REGARG convention.
...
silence gcc warning.
R=ken
OCL=31583
CL=31583
2009-07-13 23:30:30 -07:00
Russ Cox
e11447f7da
bug148.
...
R=ken
OCL=31582
CL=31582
2009-07-13 23:29:44 -07:00
Kai Backman
60d223a418
added missing pieces required by reflection
...
R=rsc
APPROVED=rsc
DELTA=61 (40 added, 18 deleted, 3 changed)
OCL=31502
CL=31580
2009-07-13 22:06:28 -07:00
Kai Backman
0e2cce70cb
tiny naming cleanup
...
R=rsc
APPROVED=rsc
DELTA=17 (0 added, 0 deleted, 17 changed)
OCL=31503
CL=31579
2009-07-13 22:04:24 -07:00
Kai Backman
7258bac6e8
fix bug in codegen when we modified move instruction instead
...
of text.
R=rsc
APPROVED=rsc
DELTA=3 (1 added, 2 deleted, 0 changed)
OCL=31575
CL=31575
2009-07-13 20:33:59 -07:00
Austin Clements
ffb4b0d7b7
Avoid clash between os.WRUSAGE and Linux's WALL flag.
...
R=rsc
APPROVED=rsc
DELTA=5 (4 added, 0 deleted, 1 changed)
OCL=31564
CL=31567
2009-07-13 19:28:00 -07:00
Russ Cox
9e2f2fcd2e
compilers were inconsistent about
...
whether no register argument was
REGARG == 0 or REGARG < 0.
use REGARG < 0 because arm needs 0 for R0.
R=ken
OCL=31562
CL=31566
2009-07-13 19:20:43 -07:00
Austin Clements
da1da8d07e
Add accessor for SIGTRAP cause in wait status
...
R=rsc
APPROVED=rsc
DELTA=7 (7 added, 0 deleted, 0 changed)
OCL=31563
CL=31565
2009-07-13 19:20:38 -07:00
Russ Cox
218c393029
add LockOSThread and UnlockOSThread to
...
runtime package for use by debugger,
which needs to make sure that all ptrace calls
about a given pid come from the same thread.
R=r
DELTA=175 (90 added, 63 deleted, 22 changed)
OCL=31546
CL=31558
2009-07-13 17:28:39 -07:00
Rob Pike
9126b75e35
rpc.
...
client library.
muxes on both ends.
R=rsc
DELTA=178 (132 added, 26 deleted, 20 changed)
OCL=31541
CL=31556
2009-07-13 16:52:57 -07:00
Russ Cox
29e93590b0
fix undefined function error.
...
before:
mainstart: undefined: main·init in mainstart
mainstart: branch out of range in mainstart
(95) CALL ,0(PC) [main·init]
mainstart: undefined: main·main in mainstart
mainstart: branch out of range in mainstart
(97) CALL ,0(PC) [main·main]
mainstart: doasm: notfound from=6f to=6f (95) CALL ,
mainstart: doasm: notfound from=6f to=6f (97) CALL ,
mainstart: doasm: notfound from=6f to=6f (95) CALL ,
mainstart: doasm: notfound from=6f to=6f (97) CALL ,
mainstart: doasm: notfound from=6f to=6f (95) CALL ,
mainstart: doasm: notfound from=6f to=6f (97) CALL ,
after:
mainstart: undefined: main·init in mainstart
mainstart: undefined: main·main in mainstart
R=r
DELTA=7 (1 added, 0 deleted, 6 changed)
OCL=31555
CL=31555
2009-07-13 16:48:09 -07:00
Russ Cox
8afc6008a8
add note about once and closures
...
R=r
DELTA=13 (13 added, 0 deleted, 0 changed)
OCL=31535
CL=31549
2009-07-13 15:54:41 -07:00
Robert Griesemer
32cd887574
- handle type forward declarations correctly
...
R=r
DELTA=8 (6 added, 0 deleted, 2 changed)
OCL=31537
CL=31537
2009-07-13 13:55:39 -07:00
Rob Pike
efb918b7db
the beginnings of an rpc service.
...
server side only; no client help yet (but it's easy).
no http yet.
service is synchronous.
all this will improve.
R=rsc
DELTA=403 (403 added, 0 deleted, 0 changed)
OCL=31522
CL=31536
2009-07-13 12:58:14 -07:00
Rob Pike
b2a66adc59
the name of the type was being sent twice. drop the outer instance.
...
R=rsc
DELTA=10 (5 added, 1 deleted, 4 changed)
OCL=31523
CL=31526
2009-07-13 11:41:02 -07:00
Robert Griesemer
7b7b83ba1b
ebnflint command
...
- basic verification of EBNF grammars
- tested with (and has testcase for) go_spec.html
R=rsc
DELTA=150 (148 added, 0 deleted, 2 changed)
OCL=31481
CL=31517
2009-07-13 10:26:58 -07:00
Robert Griesemer
ef4347f19e
Basic EBNF package:
...
- parsing of EBNF grammars
- basic consistency checks
R=rsc
DELTA=695 (695 added, 0 deleted, 0 changed)
OCL=31479
CL=31516
2009-07-13 10:10:56 -07:00
Kai Backman
092d6290d0
fixed typo where output arguments where pushed on to R0
...
instead of SP.
R=rsc
APPROVED=rsc
DELTA=13 (3 added, 7 deleted, 3 changed)
OCL=31488
CL=31501
2009-07-12 22:12:33 -07:00
Kai Backman
7842b03f70
Fixed minor typo in asm file.
...
R=rsc
APPROVED=rsc
DELTA=1 (0 added, 0 deleted, 1 changed)
OCL=31487
CL=31500
2009-07-12 22:12:19 -07:00