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

Method unbox

src/jvm/clojure/asm/commons/GeneratorAdapter.java:875–912  ·  view source on GitHub ↗

Generates the instructions to unbox the top stack value. This value is replaced by its unboxed equivalent on top of the stack. @param type the type of the top stack value.

(final Type type)

Source from the content-addressed store, hash-verified

873 * @param type the type of the top stack value.
874 */
875 public void unbox(final Type type) {
876 Type boxedType = NUMBER_TYPE;
877 Method unboxMethod;
878 switch (type.getSort()) {
879 case Type.VOID:
880 return;
881 case Type.CHAR:
882 boxedType = CHARACTER_TYPE;
883 unboxMethod = CHAR_VALUE;
884 break;
885 case Type.BOOLEAN:
886 boxedType = BOOLEAN_TYPE;
887 unboxMethod = BOOLEAN_VALUE;
888 break;
889 case Type.DOUBLE:
890 unboxMethod = DOUBLE_VALUE;
891 break;
892 case Type.FLOAT:
893 unboxMethod = FLOAT_VALUE;
894 break;
895 case Type.LONG:
896 unboxMethod = LONG_VALUE;
897 break;
898 case Type.INT:
899 case Type.SHORT:
900 case Type.BYTE:
901 unboxMethod = INT_VALUE;
902 break;
903 default:
904 unboxMethod = null;
905 }
906 if (unboxMethod == null) {
907 checkCast(type);
908 } else {
909 checkCast(boxedType);
910 invokeVirtual(boxedType, unboxMethod);
911 }
912 }
913
914 // -----------------------------------------------------------------------------------------------
915 // Instructions to jump to other instructions

Callers 1

emitBodyMethod · 0.80

Calls 3

checkCastMethod · 0.95
invokeVirtualMethod · 0.95
getSortMethod · 0.45

Tested by

no test coverage detected