src/share/vm/ci/ciField.hpp

Print this page


   1 /*
   2  * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 








  25 // ciField
  26 //
  27 // This class represents the result of a field lookup in the VM.
  28 // The lookup may not succeed, in which case the information in
  29 // the ciField will be incomplete.
  30 class ciField : public ResourceObj {
  31   CI_PACKAGE_ACCESS
  32   friend class ciEnv;
  33   friend class ciInstanceKlass;
  34   friend class NonStaticFieldFiller;
  35 
  36 private:
  37   ciFlags          _flags;
  38   ciInstanceKlass* _holder;
  39   ciSymbol*        _name;
  40   ciSymbol*        _signature;
  41   ciType*          _type;
  42   int              _offset;
  43   bool             _is_constant;
  44   ciInstanceKlass* _known_to_link_with;


 157   //
 158   // Usage note: if the same field is accessed multiple times
 159   // in the same compilation, will_link will need to be checked
 160   // at each point of access.
 161   bool will_link(ciInstanceKlass* accessing_klass,
 162                  Bytecodes::Code bc);
 163 
 164   // Java access flags
 165   bool is_public      () { return flags().is_public(); }
 166   bool is_private     () { return flags().is_private(); }
 167   bool is_protected   () { return flags().is_protected(); }
 168   bool is_static      () { return flags().is_static(); }
 169   bool is_final       () { return flags().is_final(); }
 170   bool is_volatile    () { return flags().is_volatile(); }
 171   bool is_transient   () { return flags().is_transient(); }
 172 
 173   // Debugging output
 174   void print();
 175   void print_name_on(outputStream* st);
 176 };


   1 /*
   2  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_CI_CIFIELD_HPP
  26 #define SHARE_VM_CI_CIFIELD_HPP
  27 
  28 #include "ci/ciClassList.hpp"
  29 #include "ci/ciConstant.hpp"
  30 #include "ci/ciFlags.hpp"
  31 #include "ci/ciInstance.hpp"
  32 
  33 // ciField
  34 //
  35 // This class represents the result of a field lookup in the VM.
  36 // The lookup may not succeed, in which case the information in
  37 // the ciField will be incomplete.
  38 class ciField : public ResourceObj {
  39   CI_PACKAGE_ACCESS
  40   friend class ciEnv;
  41   friend class ciInstanceKlass;
  42   friend class NonStaticFieldFiller;
  43 
  44 private:
  45   ciFlags          _flags;
  46   ciInstanceKlass* _holder;
  47   ciSymbol*        _name;
  48   ciSymbol*        _signature;
  49   ciType*          _type;
  50   int              _offset;
  51   bool             _is_constant;
  52   ciInstanceKlass* _known_to_link_with;


 165   //
 166   // Usage note: if the same field is accessed multiple times
 167   // in the same compilation, will_link will need to be checked
 168   // at each point of access.
 169   bool will_link(ciInstanceKlass* accessing_klass,
 170                  Bytecodes::Code bc);
 171 
 172   // Java access flags
 173   bool is_public      () { return flags().is_public(); }
 174   bool is_private     () { return flags().is_private(); }
 175   bool is_protected   () { return flags().is_protected(); }
 176   bool is_static      () { return flags().is_static(); }
 177   bool is_final       () { return flags().is_final(); }
 178   bool is_volatile    () { return flags().is_volatile(); }
 179   bool is_transient   () { return flags().is_transient(); }
 180 
 181   // Debugging output
 182   void print();
 183   void print_name_on(outputStream* st);
 184 };
 185 
 186 #endif // SHARE_VM_CI_CIFIELD_HPP