예제 #1
0
            public override bool Equals(JavaConstant _other)
            {
                var other = _other as JavaConstant.InvokeDynamic;

                return(bootstrapMethodIndex == other?.bootstrapMethodIndex &&
                       nameAndTypeIndex == other?.nameAndTypeIndex);
            }
예제 #2
0
            public override bool Equals(JavaConstant _other)
            {
                var other = _other as JavaConstant.MethodHandle;

                return(referenceKind == other?.referenceKind &&
                       referenceIndex == other?.referenceIndex);
            }
예제 #3
0
            public override bool Equals(JavaConstant _other)
            {
                var other = _other as JavaConstant.NameAndType;

                return(nameIndex == other?.nameIndex &&
                       descriptorIndex == other?.descriptorIndex);
            }
예제 #4
0
            public override bool Equals(JavaConstant _other)
            {
                var other = _other as JavaConstant.MemberRef;

                return(classIndex == other?.classIndex &&
                       nameAndTypeIndex == other?.nameAndTypeIndex);
            }
예제 #5
0
        public int Put(JavaConstant newConst, JavaException.Where Where)
        {
            var newConstType = newConst.GetType();
            int n            = pool.Count;

            for (int i = 1; i < n; i++)
            {
                var oldConst = pool[i];
                if (oldConst?.GetType() == newConstType && oldConst.Equals(newConst))
                {
                    return((ushort)i);
                }
            }

            if (!editable)
            {
                throw Where.Exception("new constants not allowed");
            }
            pool.Add(newConst);

            if (newConst is JavaConstant.Long || newConst is JavaConstant.Double)
            {
                pool.Add(null);     // section 4.4.5
            }
            return(n);
        }
예제 #6
0
            public override bool Equals(JavaConstant _other)
            {
                var other = _other as JavaConstant.Integer;

                return(value == other?.value);
            }
예제 #7
0
            public override bool Equals(JavaConstant _other)
            {
                var other = _other as JavaConstant.MethodType;

                return(descriptorIndex == other?.descriptorIndex);
            }
예제 #8
0
            public override bool Equals(JavaConstant _other)
            {
                var other = _other as JavaConstant.Utf8;

                return(str == other?.str);
            }
예제 #9
0
            public override bool Equals(JavaConstant _other)
            {
                var other = _other as JavaConstant.StringRef;

                return(stringIndex == other?.stringIndex);
            }