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

Method addConstantMethodHandle

src/jvm/clojure/asm/SymbolTable.java:815–845  ·  view source on GitHub ↗

Adds a CONSTANT_MethodHandle_info to the constant pool of this symbol table. Does nothing if the constant pool already contains a similar item. @param referenceKind one of Opcodes#H_GETFIELD, Opcodes#H_GETSTATIC, Opcodes#H_PUTFIELD, Opcodes#H_PUTSTATIC, {@link Op

(
      final int referenceKind,
      final String owner,
      final String name,
      final String descriptor,
      final boolean isInterface)

Source from the content-addressed store, hash-verified

813 * @return a new or already existing Symbol with the given value.
814 */
815 Symbol addConstantMethodHandle(
816 final int referenceKind,
817 final String owner,
818 final String name,
819 final String descriptor,
820 final boolean isInterface) {
821 final int tag = Symbol.CONSTANT_METHOD_HANDLE_TAG;
822 // Note that we don't need to include isInterface in the hash computation, because it is
823 // redundant with owner (we can't have the same owner with different isInterface values).
824 int hashCode = hash(tag, owner, name, descriptor, referenceKind);
825 Entry entry = get(hashCode);
826 while (entry != null) {
827 if (entry.tag == tag
828 && entry.hashCode == hashCode
829 && entry.data == referenceKind
830 && entry.owner.equals(owner)
831 && entry.name.equals(name)
832 && entry.value.equals(descriptor)) {
833 return entry;
834 }
835 entry = entry.next;
836 }
837 if (referenceKind <= Opcodes.H_PUTSTATIC) {
838 constantPool.put112(tag, referenceKind, addConstantFieldref(owner, name, descriptor).index);
839 } else {
840 constantPool.put112(
841 tag, referenceKind, addConstantMethodref(owner, name, descriptor, isInterface).index);
842 }
843 return put(
844 new Entry(constantPoolCount++, tag, owner, name, descriptor, referenceKind, hashCode));
845 }
846
847 /**
848 * Adds a new CONSTANT_MethodHandle_info to the constant pool of this symbol table.

Callers 4

SymbolTableMethod · 0.95
addConstantMethod · 0.95
addBootstrapMethodMethod · 0.95
newHandleMethod · 0.80

Calls 8

hashMethod · 0.95
getMethod · 0.95
addConstantFieldrefMethod · 0.95
addConstantMethodrefMethod · 0.95
putMethod · 0.95
addMethod · 0.95
put112Method · 0.80
equalsMethod · 0.45

Tested by

no test coverage detected