Skip to content

Commit

Permalink
Filter out invokePrim() stack frames
Browse files Browse the repository at this point in the history
  • Loading branch information
hlship committed Jan 7, 2016
1 parent 5834bd6 commit af94f03
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Improved docstrings for ANSI font constants and functions.

Added support for invokePrim() stack frames.
These are hidden as with Clojure 1.8 invokeStatic() frames.

Source files with extension `.cljc` (introduced in Clojure 1.7) are now recognized as Clojure code.

**Incompatible change:** write-binary now expects an optional map (not a varargs of keys and values)
Expand Down
6 changes: 3 additions & 3 deletions src/io/aviso/exception.clj
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
;; In a degenerate case, a protocol method could be called "invoke" or "doInvoke"; we're ignoring
;; that possibility here and assuming it's the IFn.invoke(), doInvoke() or
;; the invokeStatic method introduced with direct linking in Clojure 1.8.
all-ids (if (#{"invoke" "doInvoke" "invokeStatic"} method-name)
all-ids (if (#{"invoke" "doInvoke" "invokeStatic" "invokePrim"} method-name)
function-ids
(-> function-ids vec (conj method-name)))]
;; The assumption is that no real namespace or function name will contain underscores (the underscores
Expand Down Expand Up @@ -225,7 +225,7 @@

(defn- remove-direct-link-frames
"With Clojure 1.8, in code (such as clojure.core) that is direct linked,
you'll often see an invokeStatic() frame invoked from an invoke() frame
you'll often see an invokeStatic() and/or invokePrim() frame invoked from an invoke() frame
of the same class (the class being a compiled function). That ends up looking
like a two-frame repeat, which is not accurate.
Expand All @@ -243,7 +243,7 @@
(:is-clojure? this-frame)
(= (:class prev-frame) (:class this-frame))
(= "invokeStatic" (:method prev-frame))
(= "invoke" (:method this-frame)))
(contains? #{"invoke" "invokePrim"} (:method this-frame)))
(recur filtered this-frame rest)
(recur (conj! filtered this-frame)
this-frame
Expand Down

0 comments on commit af94f03

Please sign in to comment.