Beispiel #1
0
		internal short AddInterfaceMethodRef(string className, string methodName, string methodType)
		{
			short ntIndex = AddNameAndType(methodName, methodType);
			short classIndex = AddClass(className);
			Ensure(5);
			itsPool[itsTop++] = CONSTANT_InterfaceMethodref;
			itsTop = ClassFileWriter.PutInt16(classIndex, itsPool, itsTop);
			itsTop = ClassFileWriter.PutInt16(ntIndex, itsPool, itsTop);
			FieldOrMethodRef r = new FieldOrMethodRef(className, methodName, methodType);
			SetConstantData(itsTopIndex, r);
			itsPoolTypes.Put(itsTopIndex, CONSTANT_InterfaceMethodref);
			return (short)(itsTopIndex++);
		}
Beispiel #2
0
		internal short AddMethodRef(string className, string methodName, string methodType)
		{
			FieldOrMethodRef @ref = new FieldOrMethodRef(className, methodName, methodType);
			int theIndex = itsMethodRefHash.Get(@ref, -1);
			if (theIndex == -1)
			{
				short ntIndex = AddNameAndType(methodName, methodType);
				short classIndex = AddClass(className);
				Ensure(5);
				itsPool[itsTop++] = CONSTANT_Methodref;
				itsTop = ClassFileWriter.PutInt16(classIndex, itsPool, itsTop);
				itsTop = ClassFileWriter.PutInt16(ntIndex, itsPool, itsTop);
				theIndex = itsTopIndex++;
				itsMethodRefHash.Put(@ref, theIndex);
			}
			SetConstantData(theIndex, @ref);
			itsPoolTypes.Put(theIndex, CONSTANT_Methodref);
			return (short)theIndex;
		}