MCPcopy Index your code
hub / github.com/clojure/clojure / registerConstant

Method registerConstant

src/jvm/clojure/lang/Compiler.java:7778–7789  ·  view source on GitHub ↗
(Object o)

Source from the content-addressed store, hash-verified

7776}
7777
7778private static int registerConstant(Object o){
7779 if(!CONSTANTS.isBound())
7780 return -1;
7781 PersistentVector v = (PersistentVector) CONSTANTS.deref();
7782 IdentityHashMap<Object,Integer> ids = (IdentityHashMap<Object,Integer>) CONSTANT_IDS.deref();
7783 Integer i = ids.get(o);
7784 if(i != null)
7785 return i;
7786 CONSTANTS.set(RT.conj(v, o));
7787 ids.put(o, v.count());
7788 return v.count();
7789}
7790
7791private static KeywordExpr registerKeyword(Keyword keyword){
7792 if(!KEYWORDS.isBound())

Callers 4

registerKeywordMethod · 0.95
registerVarMethod · 0.95
NumberExprMethod · 0.80
ConstantExprMethod · 0.80

Calls 7

conjMethod · 0.95
countMethod · 0.95
derefMethod · 0.65
getMethod · 0.65
isBoundMethod · 0.45
setMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected