Implement the macro in terms of invokeWithArguments
This commit is contained in:
parent
9aa608a254
commit
6801c7735e
1 changed files with 9 additions and 3 deletions
|
|
@ -467,10 +467,16 @@
|
||||||
(find-symbol ~(name (:symbol args)))
|
(find-symbol ~(name (:symbol args)))
|
||||||
(method-type args-types# ret-type#)
|
(method-type args-types# ret-type#)
|
||||||
(function-descriptor args-types# ret-type#))
|
(function-descriptor args-types# ret-type#))
|
||||||
~(:name args) (fn [& args#]
|
~(:name args) (fn [~@arg-syms]
|
||||||
(with-open [~scope (stack-scope)]
|
(with-open [~scope (stack-scope)]
|
||||||
(let [[~@arg-syms] (map #(serialize ))]
|
(let [args# (map #(serialize %1 %2 ~scope)
|
||||||
(.invoke downcall# ~@arg-syms))))
|
[~@arg-syms]
|
||||||
|
args-types#)]
|
||||||
|
;; TODO(Joshua): Rewrite this to use jgpc42/insn
|
||||||
|
;; to generate bytecode for a proper invoke for
|
||||||
|
;; an instant performance boost
|
||||||
|
(deserialize (.invokeWithArguments downcall# (object-array args#))
|
||||||
|
ret-type#))))
|
||||||
fun# ~(if (:fn-tail args)
|
fun# ~(if (:fn-tail args)
|
||||||
`(fn ~(-> args :fn-tail :arglist)
|
`(fn ~(-> args :fn-tail :arglist)
|
||||||
~@(-> args :fn-tail :body))
|
~@(-> args :fn-tail :body))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue