Refactor VM evaluation to use macro
The `eval` and `eval_observed` methods in the `VM` struct were very similar, with the primary difference being the call to the `VMObserver` trait. This commit refactors these methods into a single macro, `dispatch_eval!`, which reduces code duplication and improves maintainability. The `Value::TailCallRequest` variant was also updated to use `Box` for its contents, which helps keep the `Value` enum size consistent. Finally, the benchmarks in the `examples` directory have been updated to reflect minor performance changes resulting from these code modifications.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
;; Closure Scope Test
|
||||
;; Benchmark: 9.0us
|
||||
;; Benchmark: 9.4us
|
||||
;; Output: 15
|
||||
(do
|
||||
(def make-adder (fn [x]
|
||||
|
||||
Reference in New Issue
Block a user