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

Method put

src/jvm/clojure/asm/Label.java:383–400  ·  view source on GitHub ↗

Puts a reference to this label in the bytecode of a method. If the bytecode offset of the label is known, the relative bytecode offset between the label and the instruction referencing it is computed and written directly. Otherwise, a null relative offset is written and a new forward reference is de

(
      final ByteVector code, final int sourceInsnBytecodeOffset, final boolean wideReference)

Source from the content-addressed store, hash-verified

381 * @param wideReference whether the reference must be stored in 4 bytes (instead of 2 bytes).
382 */
383 final void put(
384 final ByteVector code, final int sourceInsnBytecodeOffset, final boolean wideReference) {
385 if ((flags & FLAG_RESOLVED) == 0) {
386 if (wideReference) {
387 addForwardReference(sourceInsnBytecodeOffset, FORWARD_REFERENCE_TYPE_WIDE, code.length);
388 code.putInt(-1);
389 } else {
390 addForwardReference(sourceInsnBytecodeOffset, FORWARD_REFERENCE_TYPE_SHORT, code.length);
391 code.putShort(-1);
392 }
393 } else {
394 if (wideReference) {
395 code.putInt(bytecodeOffset - sourceInsnBytecodeOffset);
396 } else {
397 code.putShort(bytecodeOffset - sourceInsnBytecodeOffset);
398 }
399 }
400 }
401
402 /**
403 * Adds a forward reference to this label. This method must be called only for a true forward

Callers 4

visitJumpInsnMethod · 0.45
visitTableSwitchInsnMethod · 0.45
visitLookupSwitchInsnMethod · 0.45
MethodClass · 0.45

Calls 3

addForwardReferenceMethod · 0.95
putIntMethod · 0.80
putShortMethod · 0.80

Tested by

no test coverage detected