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

Method emitExprForInts

src/jvm/clojure/lang/Compiler.java:9497–9527  ·  view source on GitHub ↗
(ObjExpr objx, GeneratorAdapter gen, Type exprType, Label defaultLabel)

Source from the content-addressed store, hash-verified

9495 }
9496
9497 private void emitExprForInts(ObjExpr objx, GeneratorAdapter gen, Type exprType, Label defaultLabel){
9498 if (exprType == null)
9499 {
9500 if(RT.booleanCast(RT.WARN_ON_REFLECTION.deref()))
9501 {
9502 RT.errPrintWriter()
9503 .format("Performance warning, %s:%d:%d - case has int tests, but tested expression is not primitive.\n",
9504 SOURCE_PATH.deref(), line, column);
9505 }
9506 expr.emit(C.EXPRESSION, objx, gen);
9507 gen.instanceOf(NUMBER_TYPE);
9508 gen.ifZCmp(GeneratorAdapter.EQ, defaultLabel);
9509 expr.emit(C.EXPRESSION, objx, gen);
9510 gen.checkCast(NUMBER_TYPE);
9511 gen.invokeVirtual(NUMBER_TYPE, intValueMethod);
9512 emitShiftMask(gen);
9513 }
9514 else if (exprType == Type.LONG_TYPE
9515 || exprType == Type.INT_TYPE
9516 || exprType == Type.SHORT_TYPE
9517 || exprType == Type.BYTE_TYPE)
9518 {
9519 expr.emitUnboxed(C.EXPRESSION, objx, gen);
9520 gen.cast(exprType, Type.INT_TYPE);
9521 emitShiftMask(gen);
9522 }
9523 else
9524 {
9525 gen.goTo(defaultLabel);
9526 }
9527 }
9528
9529 private void emitThenForInts(ObjExpr objx, GeneratorAdapter gen, Type exprType, Expr test, Expr then, Label defaultLabel, boolean emitUnboxed){
9530 if (exprType == null)

Callers 1

doEmitMethod · 0.95

Calls 13

booleanCastMethod · 0.95
errPrintWriterMethod · 0.95
emitShiftMaskMethod · 0.95
formatMethod · 0.80
instanceOfMethod · 0.80
ifZCmpMethod · 0.80
checkCastMethod · 0.80
invokeVirtualMethod · 0.80
castMethod · 0.80
goToMethod · 0.80
derefMethod · 0.65
emitMethod · 0.65

Tested by

no test coverage detected