This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-10
Channels
- # aleph (3)
- # architecture (3)
- # bangalore-clj (5)
- # beginners (75)
- # boot (75)
- # cider (2)
- # cljs-dev (48)
- # cljsjs (3)
- # cljsrn (17)
- # clojure (125)
- # clojure-belgium (1)
- # clojure-boston (1)
- # clojure-italy (20)
- # clojure-losangeles (2)
- # clojure-spec (73)
- # clojure-uk (34)
- # clojurescript (127)
- # cursive (8)
- # data-science (5)
- # datascript (128)
- # datomic (5)
- # emacs (4)
- # events (3)
- # fulcro (1)
- # jobs (1)
- # jobs-discuss (4)
- # jobs-rus (9)
- # keechma (79)
- # lein-figwheel (2)
- # leiningen (2)
- # lumo (31)
- # om (1)
- # parinfer (61)
- # pedestal (1)
- # planck (1)
- # portkey (31)
- # re-frame (34)
- # reagent (53)
- # ring (3)
- # ring-swagger (13)
- # rum (1)
- # spacemacs (14)
- # testing (1)
- # yada (2)
together they are a join semi-lattice https://en.wikipedia.org/wiki/Semilattice
asm Analyzer takes a method and returns an array of Frames, one frame per instruction.
a Frame represents the (abstract) state of the VM at a given instruction: it contains abstract values for all locals and the stack
frames[0]
is initialized with an empty stack, and abstract arguments (created only from their type). Unitiliazed locals are abstracted to whatever Interpreter.newValue(null)
returns. This value is also used for padding of double-word values (longs and doubles).
when a jump occurs to a previously visited instruction then the new frame and the old frames are merged and subsequent frames will be recomputed.
the semilattice properties assures that progress is made, convergence involves the interpreter not creating ever āgreaterā abstract values.
Here are the kind of abstract values we try to represent: ⢠constants (strings, numbers, classes for a start) as their own value ⢠uninitialized ⢠instances with their types
looking at
@Override
public Value merge(final Value v, final Value w) {
// is this enough?
if (v.equals(w)) return v;
if (((UCValue) v).type == null && w.getSize() == 1) return w;
if (((UCValue) w).type == null && v.getSize() == 1) return v;
return UCValue.UNINITIALIZED_VALUE;
}
switched to Idea+Cursive for Java land browsing, seems that I have to renew Cursive license
Iām not even sure that in legal bytecode you could have that case (merging different sizes)
it makes no sense to say āat instruction #42, local #1 and #2 are one double or two object references.
the only case where it may happen is when an āunitializedā slot is merged with a double-word one
and this kind of merge should not happen (from my current understanding of the analyzer) with ānot initializedā values (cf access arrays)
so hmm, did the problematic behavior of merge surface only after these two commits? https://github.com/cgrand/portkey/commit/217acd4e6eae54ee995363861f362135b1e197b3 5b651877291c165e807a39e29133f1612473f30a
hmm, Kotlin uses also Interpreter https://github.com/jetbrains/kotlin/commit/c24e6b56985f86e857523f9bbce27395a3f33945