summaryrefslogtreecommitdiff
path: root/usr/austin/eval/func.go
diff options
context:
space:
mode:
Diffstat (limited to 'usr/austin/eval/func.go')
-rw-r--r--usr/austin/eval/func.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/usr/austin/eval/func.go b/usr/austin/eval/func.go
index d13fbbed4..3bf52871d 100644
--- a/usr/austin/eval/func.go
+++ b/usr/austin/eval/func.go
@@ -4,11 +4,14 @@
package eval
+import "os"
+
/*
* Virtual machine
*/
type Thread struct {
+ abort chan os.Error;
pc uint;
// The execution frame of this function. This remains the
// same throughout a function invocation.
@@ -18,13 +21,15 @@ type Thread struct {
type code []func(*Thread)
func (i code) exec(t *Thread) {
- v := Thread{0, t.f}; // TODO: reuse t
+ opc := t.pc;
+ t.pc = 0;
l := uint(len(i));
- for v.pc < l {
- pc := v.pc;
- v.pc++;
- i[pc](&v);
+ for t.pc < l {
+ pc := t.pc;
+ t.pc++;
+ i[pc](t);
}
+ t.pc = opc;
}
/*