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

Method addConstantNameAndType

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

Adds a CONSTANT_NameAndType_info to the constant pool of this symbol table. Does nothing if the constant pool already contains a similar item. @param name a field or method name. @param descriptor a field or method descriptor. @return a new or already existing Symbol with the given value.

(final String name, final String descriptor)

Source from the content-addressed store, hash-verified

738 * @return a new or already existing Symbol with the given value.
739 */
740 int addConstantNameAndType(final String name, final String descriptor) {
741 final int tag = Symbol.CONSTANT_NAME_AND_TYPE_TAG;
742 int hashCode = hash(tag, name, descriptor);
743 Entry entry = get(hashCode);
744 while (entry != null) {
745 if (entry.tag == tag
746 && entry.hashCode == hashCode
747 && entry.name.equals(name)
748 && entry.value.equals(descriptor)) {
749 return entry.index;
750 }
751 entry = entry.next;
752 }
753 constantPool.put122(tag, addConstantUtf8(name), addConstantUtf8(descriptor));
754 return put(new Entry(constantPoolCount++, tag, name, descriptor, hashCode)).index;
755 }
756
757 /**
758 * Adds a new CONSTANT_NameAndType_info to the constant pool of this symbol table.

Callers 5

SymbolTableMethod · 0.95
visitOuterClassMethod · 0.80
newNameTypeMethod · 0.80

Calls 7

hashMethod · 0.95
getMethod · 0.95
addConstantUtf8Method · 0.95
putMethod · 0.95
addMethod · 0.95
put122Method · 0.80
equalsMethod · 0.45

Tested by

no test coverage detected