Add docstrings to private functions and data
This commit is contained in:
parent
704c8710c5
commit
af3c1357d6
1 changed files with 7 additions and 0 deletions
|
|
@ -693,6 +693,7 @@
|
||||||
(java-layout type)))
|
(java-layout type)))
|
||||||
|
|
||||||
(def ^:private unbox-fn-for-type
|
(def ^:private unbox-fn-for-type
|
||||||
|
"Map from type name to the name of its unboxing function."
|
||||||
{::byte "byteValue"
|
{::byte "byteValue"
|
||||||
::short "shortValue"
|
::short "shortValue"
|
||||||
::int "intValue"
|
::int "intValue"
|
||||||
|
|
@ -719,6 +720,8 @@
|
||||||
[]))))
|
[]))))
|
||||||
|
|
||||||
(defn- downcall-class
|
(defn- downcall-class
|
||||||
|
"Class definition for an implementation of [[IFn]] which calls a closed over
|
||||||
|
method handle without reflection, unboxing primitives when needed."
|
||||||
[args ret]
|
[args ret]
|
||||||
{:flags #{:public :final}
|
{:flags #{:public :final}
|
||||||
:super clojure.lang.AFunction
|
:super clojure.lang.AFunction
|
||||||
|
|
@ -849,6 +852,7 @@
|
||||||
;;; Function types
|
;;; Function types
|
||||||
|
|
||||||
(def ^:private return-for-type
|
(def ^:private return-for-type
|
||||||
|
"Map from type name to the return instruction for that type."
|
||||||
{::byte :breturn
|
{::byte :breturn
|
||||||
::short :sreturn
|
::short :sreturn
|
||||||
::int :ireturn
|
::int :ireturn
|
||||||
|
|
@ -860,6 +864,8 @@
|
||||||
::void :return})
|
::void :return})
|
||||||
|
|
||||||
(defn- upcall-class
|
(defn- upcall-class
|
||||||
|
"Constructs a class definition for a class with a single method, `upcall`, which
|
||||||
|
boxes any primitives passed to it and calls a closed over [[IFn]]."
|
||||||
[arg-types ret-type]
|
[arg-types ret-type]
|
||||||
{:flags #{:public :final}
|
{:flags #{:public :final}
|
||||||
:fields [{:name "upcall_ifn"
|
:fields [{:name "upcall_ifn"
|
||||||
|
|
@ -892,6 +898,7 @@
|
||||||
[(return-for-type ret-type :areturn)]]}]})
|
[(return-for-type ret-type :areturn)]]}]})
|
||||||
|
|
||||||
(defn- upcall
|
(defn- upcall
|
||||||
|
"Constructs an instance of [[upcall-class]], closing over `f`."
|
||||||
[f arg-types ret-type]
|
[f arg-types ret-type]
|
||||||
(insn/new-instance (upcall-class arg-types ret-type) ^IFn f))
|
(insn/new-instance (upcall-class arg-types ret-type) ^IFn f))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue