src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Field.java
changeset 50929 ef57cfcd22ff
parent 47216 71c04702a3d5
equal deleted inserted replaced
50928:0e7e4b28c0d9 50929:ef57cfcd22ff
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    45     this.fieldIndex = fieldIndex;
    45     this.fieldIndex = fieldIndex;
    46 
    46 
    47     offset               = holder.getFieldOffset(fieldIndex);
    47     offset               = holder.getFieldOffset(fieldIndex);
    48     genericSignature     = holder.getFieldGenericSignature(fieldIndex);
    48     genericSignature     = holder.getFieldGenericSignature(fieldIndex);
    49 
    49 
    50     Symbol name          = holder.getFieldName(fieldIndex);
    50     name                 = holder.getFieldName(fieldIndex);
    51     id          = new NamedFieldIdentifier(name.asString());
    51     id          = new NamedFieldIdentifier(name.asString());
    52 
    52 
    53     signature            = holder.getFieldSignature(fieldIndex);
    53     signature            = holder.getFieldSignature(fieldIndex);
    54     fieldType   = new FieldType(signature);
    54     fieldType   = new FieldType(signature);
    55 
    55 
    56     short access         = holder.getFieldAccessFlags(fieldIndex);
    56     short access         = holder.getFieldAccessFlags(fieldIndex);
    57     accessFlags = new AccessFlags(access);
    57     accessFlags = new AccessFlags(access);
    58   }
    58   }
    59 
    59 
       
    60   private Symbol          name;
    60   private long            offset;
    61   private long            offset;
    61   private FieldIdentifier id;
    62   private FieldIdentifier id;
    62   private boolean         isVMField;
    63   private boolean         isVMField;
    63   // Java fields only
    64   // Java fields only
    64   private InstanceKlass   holder;
    65   private InstanceKlass   holder;
    71   /** Returns the byte offset of the field within the object or klass */
    72   /** Returns the byte offset of the field within the object or klass */
    72   public long getOffset() { return offset; }
    73   public long getOffset() { return offset; }
    73 
    74 
    74   /** Returns the identifier of the field */
    75   /** Returns the identifier of the field */
    75   public FieldIdentifier getID() { return id; }
    76   public FieldIdentifier getID() { return id; }
       
    77 
       
    78   public Symbol getName() { return name; }
    76 
    79 
    77   /** Indicates whether this is a VM field */
    80   /** Indicates whether this is a VM field */
    78   public boolean isVMField() { return isVMField; }
    81   public boolean isVMField() { return isVMField; }
    79 
    82 
    80   /** Indicates whether this is a named field */
    83   /** Indicates whether this is a named field */