fixed inadvertant reflection in protocol paths, replace object-array in jvm impl with faster impl
This commit is contained in:
parent
dd07769a42
commit
41f42e20a1
9 changed files with 32 additions and 9 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
||||||
0.9.0
|
0.9.1-SNAPSHOT
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@
|
||||||
[org.clojure/clojurescript "0.0-3211"]
|
[org.clojure/clojurescript "0.0-3211"]
|
||||||
]
|
]
|
||||||
:jvm-opts ["-XX:-OmitStackTraceInFastThrow"] ; this prevents JVM from doing optimizations which can remove stack traces from NPE and other exceptions
|
:jvm-opts ["-XX:-OmitStackTraceInFastThrow"] ; this prevents JVM from doing optimizations which can remove stack traces from NPE and other exceptions
|
||||||
:source-paths ["src"]
|
:source-paths ["src/clj"]
|
||||||
|
:java-source-paths ["src/java"]
|
||||||
:test-paths ["test", "target/test-classes"]
|
:test-paths ["test", "target/test-classes"]
|
||||||
:jar-exclusions [#"\.cljx"]
|
:jar-exclusions [#"\.cljx"]
|
||||||
:auto-clean false
|
:auto-clean false
|
||||||
|
|
@ -13,10 +14,10 @@
|
||||||
[[org.clojure/test.check "0.7.0"]]
|
[[org.clojure/test.check "0.7.0"]]
|
||||||
:plugins
|
:plugins
|
||||||
[[com.keminglabs/cljx "0.6.0"]]
|
[[com.keminglabs/cljx "0.6.0"]]
|
||||||
:cljx {:builds [{:source-paths ["src"]
|
:cljx {:builds [{:source-paths ["src/clj"]
|
||||||
:output-path "target/classes"
|
:output-path "target/classes"
|
||||||
:rules :clj}
|
:rules :clj}
|
||||||
{:source-paths ["src"]
|
{:source-paths ["src/clj"]
|
||||||
:output-path "target/classes"
|
:output-path "target/classes"
|
||||||
:rules :cljs}
|
:rules :cljs}
|
||||||
{:source-paths ["test"]
|
{:source-paths ["test"]
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
:let [args (vec (gensyms i))
|
:let [args (vec (gensyms i))
|
||||||
setters (for [j (range i)] `(aset ~a ~j ~(get args j)))]]
|
setters (for [j (range i)] `(aset ~a ~j ~(get args j)))]]
|
||||||
`(~invoke-name [this# ~@args]
|
`(~invoke-name [this# ~@args]
|
||||||
(let [~a (object-array ~i)]
|
(let [~a (com.rpl.specter.impl/fast-object-array ~i)]
|
||||||
~@setters
|
~@setters
|
||||||
(com.rpl.specter.impl/bind-params* this# ~a 0)
|
(com.rpl.specter.impl/bind-params* this# ~a 0)
|
||||||
)))]
|
)))]
|
||||||
|
|
@ -12,6 +12,8 @@
|
||||||
[clojure.string :as s]
|
[clojure.string :as s]
|
||||||
#+clj [com.rpl.specter.defhelpers :as dh]
|
#+clj [com.rpl.specter.defhelpers :as dh]
|
||||||
)
|
)
|
||||||
|
#+clj
|
||||||
|
(:import [com.rpl.specter Util])
|
||||||
)
|
)
|
||||||
|
|
||||||
(defn spy [e]
|
(defn spy [e]
|
||||||
|
|
@ -79,6 +81,15 @@
|
||||||
|
|
||||||
(declare bind-params*)
|
(declare bind-params*)
|
||||||
|
|
||||||
|
#+clj
|
||||||
|
(defmacro fast-object-array [i]
|
||||||
|
`(com.rpl.specter.Util/makeObjectArray ~i))
|
||||||
|
|
||||||
|
#+cljs
|
||||||
|
(defn fast-object-array [i]
|
||||||
|
(object-array i))
|
||||||
|
|
||||||
|
|
||||||
#+clj
|
#+clj
|
||||||
(dh/define-ParamsNeededPath
|
(dh/define-ParamsNeededPath
|
||||||
clojure.lang.IFn
|
clojure.lang.IFn
|
||||||
|
|
@ -555,16 +566,20 @@
|
||||||
structure))
|
structure))
|
||||||
|
|
||||||
(defn compiled-selector [^com.rpl.specter.impl.CompiledPath path]
|
(defn compiled-selector [^com.rpl.specter.impl.CompiledPath path]
|
||||||
(-> path .-transform-fns .-selector))
|
(let [^com.rpl.specter.impl.TransformFunctions tfns (.-transform-fns path)]
|
||||||
|
(.-selector tfns)))
|
||||||
|
|
||||||
(defn compiled-transformer [^com.rpl.specter.impl.CompiledPath path]
|
(defn compiled-transformer [^com.rpl.specter.impl.CompiledPath path]
|
||||||
(-> path .-transform-fns .-transformer))
|
(let [^com.rpl.specter.impl.TransformFunctions tfns (.-transform-fns path)]
|
||||||
|
(.-transformer tfns)))
|
||||||
|
|
||||||
(defn params-needed-selector [^com.rpl.specter.impl.ParamsNeededPath path]
|
(defn params-needed-selector [^com.rpl.specter.impl.ParamsNeededPath path]
|
||||||
(-> path .-transform-fns .-selector))
|
(let [^com.rpl.specter.impl.TransformFunctions tfns (.-transform-fns path)]
|
||||||
|
(.-selector tfns)))
|
||||||
|
|
||||||
(defn params-needed-transformer [^com.rpl.specter.impl.ParamsNeededPath path]
|
(defn params-needed-transformer [^com.rpl.specter.impl.ParamsNeededPath path]
|
||||||
(-> path .-transform-fns .-transformer))
|
(let [^com.rpl.specter.impl.TransformFunctions tfns (.-transform-fns path)]
|
||||||
|
(.-transformer tfns)))
|
||||||
|
|
||||||
#+clj
|
#+clj
|
||||||
(defn extend-protocolpath* [protpath-prot extensions]
|
(defn extend-protocolpath* [protpath-prot extensions]
|
||||||
7
src/java/com/rpl/specter/Util.java
Normal file
7
src/java/com/rpl/specter/Util.java
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.rpl.specter;
|
||||||
|
|
||||||
|
public class Util {
|
||||||
|
public static Object[] makeObjectArray(int size) {
|
||||||
|
return new Object[size];
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue