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

Method registerLocal

src/jvm/clojure/lang/Compiler.java:7313–7322  ·  view source on GitHub ↗
(Symbol sym, Symbol tag, Expr init, boolean isArg)

Source from the content-addressed store, hash-verified

7311}
7312
7313private static LocalBinding registerLocal(Symbol sym, Symbol tag, Expr init, boolean isArg) {
7314 int num = getAndIncLocalNum();
7315 LocalBinding b = new LocalBinding(num, sym, tag, init, isArg, clearPathRoot());
7316 IPersistentMap localsMap = (IPersistentMap) LOCAL_ENV.deref();
7317 LOCAL_ENV.set(RT.assoc(localsMap, b.sym, b));
7318 ObjMethod method = (ObjMethod) METHOD.deref();
7319 method.locals = (IPersistentMap) RT.assoc(method.locals, b, b);
7320 method.indexlocals = (IPersistentMap) RT.assoc(method.indexlocals, num, b);
7321 return b;
7322}
7323
7324private static int getAndIncLocalNum(){
7325 int num = ((Number) NEXT_LOCAL_NUM.deref()).intValue();

Callers 5

parseMethod · 0.80
parseMethod · 0.80
parseMethod · 0.80
parseMethod · 0.80
parseMethod · 0.80

Calls 5

getAndIncLocalNumMethod · 0.95
clearPathRootMethod · 0.95
assocMethod · 0.95
derefMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected