コード例 #1
0
ファイル: ToyVMObject.cs プロジェクト: jdewald/toyvm
 public void setFieldValue(ConstantPoolInfo_FieldRef field,Object val)
 {
     if (log.IsDebugEnabled) log.DebugFormat("SET{0}:{1} = {2}",this.heapRef,field,val);
     fieldValues[field.getNameAndType().getRefName()] = val;
 }
コード例 #2
0
ファイル: ToyVMObject.cs プロジェクト: jdewald/toyvm
 public Object getFieldValue(ConstantPoolInfo_FieldRef field)
 {
     string fieldName = field.getNameAndType().getRefName();
     return getFieldValue(fieldName,field.getFieldType());
 }
コード例 #3
0
        public static ConstantPoolInfo readConstantPoolEntry(MSBBinaryReaderWrapper reader)
        {
            byte tag = reader.ReadByte();

            ConstantPoolInfo info = null;
            switch (tag)
            {
                case TYPE_CLASS:
                {
                    info = new ConstantPoolInfo_Class(tag);
                    break;
                }
                case TYPE_METHOD_REF:
                {
                    info = new ConstantPoolInfo_MethodRef(tag);
                    break;
                }
            case TYPE_INTERFACE_METHOD_REF:
            {
                info = new ConstantPoolInfo_InterfaceMethodRef(tag);
                break;
            }
                case TYPE_FIELD_REF:
                {
                    info = new ConstantPoolInfo_FieldRef(tag);
                    break;
                }
                case TYPE_STRING:
                {
                    info = new ConstantPoolInfo_String(tag);
                    break;
                }
                case TYPE_UTF8:
                {
                    info = new ConstantPoolInfo_UTF8(tag);
                    break;
                }
                case TYPE_NAME_AND_TYPE:
                {
                    info = new ConstantPoolInfo_NameAndType(tag);
                    break;
                }
            case TYPE_INTEGER:
            {
                info = new ConstantPoolInfo_Integer(tag);
                break;
            }
            case TYPE_FLOAT:
            {
                info = new ConstantPoolInfo_Float(tag);
                break;
            }
            case TYPE_DOUBLE:
            {
                info = new ConstantPoolInfo_Double(tag);
                break;
            }
            case TYPE_LONG:
            {
                info = new ConstantPoolInfo_Long(tag);
                break;
            }

            default:
                {
                    throw new UnknownConstantPoolTypeException(String.Format("Do not know how to parse {0}",tag));
                }

            }

            info.parse(reader);

            return info;
        }