summaryrefslogtreecommitdiff
path: root/usr/austin/eval/func.go
diff options
context:
space:
mode:
authorAustin Clements <aclements@csail.mit.edu>2009-07-28 14:37:06 -0700
committerAustin Clements <aclements@csail.mit.edu>2009-07-28 14:37:06 -0700
commit1d9855bd39cd04f70d17aa9bbf57245ef98c9d85 (patch)
treefd4c5541b8e38e8af07ff5f0cd9cb348f7c1031d /usr/austin/eval/func.go
parent7160983267c034dbe78e040a3b67f06e7cc9bdc2 (diff)
downloadgolang-1d9855bd39cd04f70d17aa9bbf57245ef98c9d85.tar.gz
Implement if, for (modulo ranges), break, continue, increment,
and decrement. blockCompilers now form a tree the mimics the nesting of scopes and provide convenient ways to enter and exit scopes. blockCompilers also track the break and continue PC for the current block. The statement testing interface now works in lists of statements, which simplifies a bunch of things. R=rsc APPROVED=rsc DELTA=401 (335 added, 44 deleted, 22 changed) OCL=32308 CL=32317
Diffstat (limited to 'usr/austin/eval/func.go')
-rw-r--r--usr/austin/eval/func.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr/austin/eval/func.go b/usr/austin/eval/func.go
index 29bc05b22..cc790452b 100644
--- a/usr/austin/eval/func.go
+++ b/usr/austin/eval/func.go
@@ -62,6 +62,10 @@ func (b *codeBuf) push(instr func(*vm)) {
b.instrs[n] = instr;
}
+func (b *codeBuf) nextPC() uint {
+ return uint(len(b.instrs));
+}
+
func (b *codeBuf) get() code {
// Freeze this buffer into an array of exactly the right size
a := make(code, len(b.instrs));