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

Method putTarget

src/jvm/clojure/asm/TypeReference.java:402–435  ·  view source on GitHub ↗

Puts the given target_type and target_info JVMS structures into the given ByteVector. @param targetTypeAndInfo a target_type and a target_info structures encoded as in #targetTypeAndInfo. LOCAL_VARIABLE and RESOURCE_VARIABLE target types are not supported. @param output where the type r

(final int targetTypeAndInfo, final ByteVector output)

Source from the content-addressed store, hash-verified

400 * @param output where the type reference must be put.
401 */
402 static void putTarget(final int targetTypeAndInfo, final ByteVector output) {
403 switch (targetTypeAndInfo >>> 24) {
404 case CLASS_TYPE_PARAMETER:
405 case METHOD_TYPE_PARAMETER:
406 case METHOD_FORMAL_PARAMETER:
407 output.putShort(targetTypeAndInfo >>> 16);
408 break;
409 case FIELD:
410 case METHOD_RETURN:
411 case METHOD_RECEIVER:
412 output.putByte(targetTypeAndInfo >>> 24);
413 break;
414 case CAST:
415 case CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT:
416 case METHOD_INVOCATION_TYPE_ARGUMENT:
417 case CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT:
418 case METHOD_REFERENCE_TYPE_ARGUMENT:
419 output.putInt(targetTypeAndInfo);
420 break;
421 case CLASS_EXTENDS:
422 case CLASS_TYPE_PARAMETER_BOUND:
423 case METHOD_TYPE_PARAMETER_BOUND:
424 case THROWS:
425 case EXCEPTION_PARAMETER:
426 case INSTANCEOF:
427 case NEW:
428 case CONSTRUCTOR_REFERENCE:
429 case METHOD_REFERENCE:
430 output.put12(targetTypeAndInfo >>> 24, (targetTypeAndInfo & 0xFFFF00) >> 8);
431 break;
432 default:
433 throw new IllegalArgumentException();
434 }
435 }
436}

Callers 5

visitTypeAnnotationMethod · 0.95
visitTypeAnnotationMethod · 0.95
visitInsnAnnotationMethod · 0.95
visitTypeAnnotationMethod · 0.95

Calls 4

putShortMethod · 0.80
putByteMethod · 0.80
putIntMethod · 0.80
put12Method · 0.80

Tested by

no test coverage detected