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

Method emit

src/jvm/clojure/lang/Compiler.java:5605–5632  ·  view source on GitHub ↗
(C context, ObjExpr objx, GeneratorAdapter gen)

Source from the content-addressed store, hash-verified

5603 }
5604
5605 public void emit(C context, ObjExpr objx, GeneratorAdapter gen){
5606 //emitting a Fn means constructing an instance, feeding closed-overs from enclosing scope, if any
5607 //objx arg is enclosing objx, not this
5608// getCompiledClass();
5609 if(isDeftype())
5610 {
5611 gen.visitInsn(Opcodes.ACONST_NULL);
5612 }
5613 else
5614 {
5615 gen.newInstance(objtype);
5616 gen.dup();
5617 if(supportsMeta())
5618 gen.visitInsn(Opcodes.ACONST_NULL);
5619 for(ISeq s = RT.seq(closesExprs); s != null; s = s.next())
5620 {
5621 LocalBindingExpr lbe = (LocalBindingExpr) s.first();
5622 LocalBinding lb = lbe.b;
5623 if(lb.getPrimitiveType() != null)
5624 objx.emitUnboxedLocal(gen, lb);
5625 else
5626 objx.emitLocal(gen, lb, lbe.shouldClear);
5627 }
5628 gen.invokeConstructor(objtype, new Method("<init>", Type.VOID_TYPE, ctorTypes()));
5629 }
5630 if(context == C.STATEMENT)
5631 gen.pop();
5632 }
5633
5634 public boolean hasJavaClass() {
5635 return true;

Callers

nothing calls this directly

Calls 14

isDeftypeMethod · 0.95
supportsMetaMethod · 0.95
seqMethod · 0.95
nextMethod · 0.95
firstMethod · 0.95
getPrimitiveTypeMethod · 0.95
ctorTypesMethod · 0.95
newInstanceMethod · 0.80
dupMethod · 0.80
emitUnboxedLocalMethod · 0.80
emitLocalMethod · 0.80
popMethod · 0.65

Tested by

no test coverage detected