diff --git a/arc.pir b/arc.pir index 05b92ab..6a99abd 100644 --- a/arc.pir +++ b/arc.pir @@ -19,6 +19,12 @@ .local int is_pir is_pir = 0 + ## save start up time + $N0 = time + $P0 = new 'ArcNum' + $P0 = $N0 + set_hll_global '$startup-time', $P0 + load_bytecode 'ac/boot.pbc' load_bytecode 'ac/comp.pbc' load_bytecode 'ac/qq.pbc' @@ -36,7 +42,7 @@ ## default value for *** $P1 = get_hll_global 'nil' set_hll_global '***', $P1 - #push_eh run_error + push_eh run_error loop: unless iter goto end $S0 = shift iter @@ -66,7 +72,7 @@ run_error: eval_mode: $P0 = getstdin loop2: - #push_eh error # never give up + push_eh error # never give up $S0 = $P0.'readline_interactive'( 'arc> ' ) $P2 = _compile_and_eval($S0) ##print ' -> ' diff --git a/builtins.pir b/builtins.pir index d026907..caaf05b 100644 --- a/builtins.pir +++ b/builtins.pir @@ -428,9 +428,14 @@ end: .sub 'ccc' .param pmc f - interpinfo $P0, .INTERPINFO_CURRENT_CONT - - .tailcall f($P0) + $P0 = new 'Continuation' + set_addr $P0, continue + $P0 = f($P0) +continue: +# .local pmc res +# .get_results (res) +# .return (res) + .return ($P0) .end .sub 'pr' @@ -984,7 +989,13 @@ handle_err: ## only stubs .sub 'msec' - .return (0) + $N0 = time + $P0 = get_hll_global '$startup-time' + $N1 = $P0 + $N0 = $N0 - $N1 + $N0 = $N0*1000000 + $I0 = $N0 + .return ($I0) .end .sub 'current-process-milliseconds'