< prev index next >

src/hotspot/share/ci/ciField.hpp

Print this page

 27 
 28 #include "ci/ciClassList.hpp"
 29 #include "ci/ciConstant.hpp"
 30 #include "ci/ciFlags.hpp"
 31 #include "ci/ciInstance.hpp"
 32 #include "ci/ciUtilities.hpp"
 33 
 34 // ciField
 35 //
 36 // This class represents the result of a field lookup in the VM.
 37 // The lookup may not succeed, in which case the information in
 38 // the ciField will be incomplete.
 39 class ciField : public ArenaObj {
 40   CI_PACKAGE_ACCESS
 41   friend class ciEnv;
 42   friend class ciInstanceKlass;
 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   ciMethod*        _known_to_link_with_put;
 53   ciInstanceKlass* _known_to_link_with_get;
 54   ciConstant       _constant_value;
 55 
 56   ciType* compute_type();
 57   ciType* compute_type_impl();
 58 
 59   ciField(ciInstanceKlass* klass, int index, Bytecodes::Code bc);
 60   ciField(fieldDescriptor* fd);

 61 
 62   // shared constructor code
 63   void initialize_from(fieldDescriptor* fd);
 64 
 65 public:
 66   ciFlags flags() const { return _flags; }
 67 
 68   // Of which klass is this field a member?
 69   //
 70   // Usage note: the declared holder of a field is the class
 71   // referenced by name in the bytecodes.  The canonical holder
 72   // is the most general class which holds the field.  This
 73   // method returns the canonical holder.  The declared holder
 74   // can be accessed via a method in ciBytecodeStream.
 75   //
 76   // Ex.
 77   //     class A {
 78   //       public int f = 7;
 79   //     }
 80   //     class B extends A {

152   // Check for link time errors.  Accessing a field from a
153   // certain method via a certain bytecode may or may not be legal.
154   // This call checks to see if an exception may be raised by
155   // an access of this field.
156   //
157   // Usage note: if the same field is accessed multiple times
158   // in the same compilation, will_link will need to be checked
159   // at each point of access.
160   bool will_link(ciMethod* accessing_method,
161                  Bytecodes::Code bc);
162 
163   // Java access flags
164   bool is_public               () const { return flags().is_public(); }
165   bool is_private              () const { return flags().is_private(); }
166   bool is_protected            () const { return flags().is_protected(); }
167   bool is_static               () const { return flags().is_static(); }
168   bool is_final                () const { return flags().is_final(); }
169   bool is_stable               () const { return flags().is_stable(); }
170   bool is_volatile             () const { return flags().is_volatile(); }
171   bool is_transient            () const { return flags().is_transient(); }





172   // The field is modified outside of instance initializer methods
173   // (or class/initializer methods if the field is static).
174   bool has_initialized_final_update() const { return flags().has_initialized_final_update(); }
175 
176   bool is_call_site_target();
177 
178   bool is_autobox_cache();
179 
180   // Debugging output
181   void print();
182   void print_name_on(outputStream* st);
183 };
184 
185 #endif // SHARE_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 #include "ci/ciUtilities.hpp"
 33 
 34 // ciField
 35 //
 36 // This class represents the result of a field lookup in the VM.
 37 // The lookup may not succeed, in which case the information in
 38 // the ciField will be incomplete.
 39 class ciField : public ArenaObj {
 40   CI_PACKAGE_ACCESS
 41   friend class ciEnv;
 42   friend class ciInstanceKlass;
 43 
 44 private:
 45   ciFlags          _flags;
 46   ciInstanceKlass* _holder;
 47   ciInstanceKlass* _original_holder; // For fields nested in flat fields
 48   ciSymbol*        _name;
 49   ciSymbol*        _signature;
 50   ciType*          _type;
 51   int              _offset;
 52   bool             _is_constant;
 53   bool             _is_flat;
 54   bool             _is_null_free;
 55   int              _null_marker_offset;
 56   ciMethod*        _known_to_link_with_put;
 57   ciInstanceKlass* _known_to_link_with_get;
 58   ciConstant       _constant_value;
 59 
 60   ciType* compute_type();
 61   ciType* compute_type_impl();
 62 
 63   ciField(ciInstanceKlass* klass, int index, Bytecodes::Code bc);
 64   ciField(fieldDescriptor* fd);
 65   ciField(ciField* field, ciInstanceKlass* holder, int offset, bool is_final);
 66 
 67   // shared constructor code
 68   void initialize_from(fieldDescriptor* fd);
 69 
 70 public:
 71   ciFlags flags() const { return _flags; }
 72 
 73   // Of which klass is this field a member?
 74   //
 75   // Usage note: the declared holder of a field is the class
 76   // referenced by name in the bytecodes.  The canonical holder
 77   // is the most general class which holds the field.  This
 78   // method returns the canonical holder.  The declared holder
 79   // can be accessed via a method in ciBytecodeStream.
 80   //
 81   // Ex.
 82   //     class A {
 83   //       public int f = 7;
 84   //     }
 85   //     class B extends A {

157   // Check for link time errors.  Accessing a field from a
158   // certain method via a certain bytecode may or may not be legal.
159   // This call checks to see if an exception may be raised by
160   // an access of this field.
161   //
162   // Usage note: if the same field is accessed multiple times
163   // in the same compilation, will_link will need to be checked
164   // at each point of access.
165   bool will_link(ciMethod* accessing_method,
166                  Bytecodes::Code bc);
167 
168   // Java access flags
169   bool is_public               () const { return flags().is_public(); }
170   bool is_private              () const { return flags().is_private(); }
171   bool is_protected            () const { return flags().is_protected(); }
172   bool is_static               () const { return flags().is_static(); }
173   bool is_final                () const { return flags().is_final(); }
174   bool is_stable               () const { return flags().is_stable(); }
175   bool is_volatile             () const { return flags().is_volatile(); }
176   bool is_transient            () const { return flags().is_transient(); }
177   bool is_strict               () const { return flags().is_strict(); }
178   bool is_flat                 () const { return _is_flat; }
179   bool is_null_free            () const { return _is_null_free; }
180   int null_marker_offset       () const { return _null_marker_offset; }
181 
182   // The field is modified outside of instance initializer methods
183   // (or class/initializer methods if the field is static).
184   bool has_initialized_final_update() const { return flags().has_initialized_final_update(); }
185 
186   bool is_call_site_target();
187 
188   bool is_autobox_cache();
189 
190   // Debugging output
191   void print();
192   void print_name_on(outputStream* st);
193 };
194 
195 #endif // SHARE_CI_CIFIELD_HPP
< prev index next >