diff options
| author | Rich Hickey <richhickey@gmail.com> | 2008-12-29 05:55:16 +0000 |
|---|---|---|
| committer | Rich Hickey <richhickey@gmail.com> | 2008-12-29 05:55:16 +0000 |
| commit | e6fed020c75318cd3afa110d3213efaed2bf6988 (patch) | |
| tree | 7a6c431db0b7c7f2efcdac46e7f73058f37a837f /src/clj | |
| parent | 8fb9bddb590c10431ccff3e9383ba651f8b9663b (diff) | |
added back checkCasts before invokeInterface calls
Diffstat (limited to 'src/clj')
| -rw-r--r-- | src/clj/clojure/core_proxy.clj | 2 | ||||
| -rw-r--r-- | src/clj/clojure/genclass.clj | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/clj/clojure/core_proxy.clj b/src/clj/clojure/core_proxy.clj index 8a777347..b1e4c4cb 100644 --- a/src/clj/clojure/core_proxy.clj +++ b/src/clj/clojure/core_proxy.clj @@ -62,6 +62,7 @@ (. gen (dup)) (. gen (ifNull else-label)) ;if found + (.checkCast gen ifn-type) (. gen (loadThis)) ;box args (dotimes [i (count ptypes)] @@ -125,6 +126,7 @@ (. gen (loadThis)) (. gen (dup)) (. gen (getField ctype fmap imap-type)) + (.checkCast gen (totype clojure.lang.IPersistentCollection)) (. gen (loadArgs)) (. gen (invokeInterface (totype clojure.lang.IPersistentCollection) (. Method (getMethod "clojure.lang.IPersistentCollection cons(Object)")))) diff --git a/src/clj/clojure/genclass.clj b/src/clj/clojure/genclass.clj index e293fe0e..968e2d4b 100644 --- a/src/clj/clojure/genclass.clj +++ b/src/clj/clojure/genclass.clj @@ -181,6 +181,7 @@ (when is-overload (. gen (mark found-label))) ;if found + (.checkCast gen ifn-type) (when-not as-static (. gen (loadThis))) ;box args @@ -274,6 +275,7 @@ (emit-get-var gen init-name) (. gen dup) (. gen ifNull no-init-label) + (.checkCast gen ifn-type) ;box init args (dotimes [i (count pclasses)] (. gen (loadArg i)) @@ -386,6 +388,7 @@ (emit-get-var gen main-name) (. gen dup) (. gen ifNull no-main-label) + (.checkCast gen ifn-type) (. gen loadArgs) (. gen (invokeStatic rt-type (. Method (getMethod "clojure.lang.ISeq seq(Object)")))) (. gen (invokeInterface ifn-type (new Method "applyTo" obj-type |
