comparison src/share/vm/runtime/fieldDescriptor.hpp @ 4137:04b9a2566eec

Merge with hsx23/hotspot.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 17 Dec 2011 21:40:27 +0100
parents ff6a991c6e3c e6b1331a51d2
children 82af018d61db
comparison
equal deleted inserted replaced
3737:9dc19b7d89a3 4137:04b9a2566eec
38 // rather than the actual info). 38 // rather than the actual info).
39 39
40 class fieldDescriptor VALUE_OBJ_CLASS_SPEC { 40 class fieldDescriptor VALUE_OBJ_CLASS_SPEC {
41 private: 41 private:
42 AccessFlags _access_flags; 42 AccessFlags _access_flags;
43 int _name_index; 43 int _index; // the field index
44 int _signature_index;
45 int _initial_value_index;
46 int _offset;
47 int _generic_signature_index;
48 int _index; // index into fields() array
49 constantPoolHandle _cp; 44 constantPoolHandle _cp;
50 45
46 // update the access_flags for the field in the klass
47 void update_klass_field_access_flag() {
48 instanceKlass* ik = instanceKlass::cast(field_holder());
49 ik->field(index())->set_access_flags(_access_flags.as_short());
50 }
51
52 FieldInfo* field() const {
53 instanceKlass* ik = instanceKlass::cast(field_holder());
54 return ik->field(_index);
55 }
56
51 public: 57 public:
52 int name_index() const { return _name_index; } 58 Symbol* name() const {
53 int signature_index() const { return _signature_index; } 59 return field()->name(_cp);
54 Symbol* name() const { return _cp->symbol_at(_name_index); } 60 }
55 Symbol* signature() const { return _cp->symbol_at(_signature_index); } 61 Symbol* signature() const {
62 return field()->signature(_cp);
63 }
56 klassOop field_holder() const { return _cp->pool_holder(); } 64 klassOop field_holder() const { return _cp->pool_holder(); }
57 constantPoolOop constants() const { return _cp(); } 65 constantPoolOop constants() const { return _cp(); }
58 AccessFlags access_flags() const { return _access_flags; } 66 AccessFlags access_flags() const { return _access_flags; }
59 oop loader() const; 67 oop loader() const;
60 // Offset (in words) of field from start of instanceOop / klassOop 68 // Offset (in words) of field from start of instanceOop / klassOop
61 int offset() const { return _offset; } 69 int offset() const { return field()->offset(); }
62 Symbol* generic_signature() const { return (_generic_signature_index > 0 ? _cp->symbol_at(_generic_signature_index) : (Symbol*)NULL); } 70 Symbol* generic_signature() const { return field()->generic_signature(_cp); }
63 int index() const { return _index; } 71 int index() const { return _index; }
64 typeArrayOop annotations() const; 72 typeArrayOop annotations() const;
65 73
66 // Initial field value 74 // Initial field value
67 bool has_initial_value() const { return _initial_value_index != 0; } 75 bool has_initial_value() const { return field()->initval_index() != 0; }
76 int initial_value_index() const { return field()->initval_index(); }
68 constantTag initial_value_tag() const; // The tag will return true on one of is_int(), is_long(), is_single(), is_double() 77 constantTag initial_value_tag() const; // The tag will return true on one of is_int(), is_long(), is_single(), is_double()
69 jint int_initial_value() const; 78 jint int_initial_value() const;
70 jlong long_initial_value() const; 79 jlong long_initial_value() const;
71 jfloat float_initial_value() const; 80 jfloat float_initial_value() const;
72 jdouble double_initial_value() const; 81 jdouble double_initial_value() const;
74 83
75 // Field signature type 84 // Field signature type
76 BasicType field_type() const { return FieldType::basic_type(signature()); } 85 BasicType field_type() const { return FieldType::basic_type(signature()); }
77 86
78 // Access flags 87 // Access flags
79 bool is_public() const { return _access_flags.is_public(); } 88 bool is_public() const { return access_flags().is_public(); }
80 bool is_private() const { return _access_flags.is_private(); } 89 bool is_private() const { return access_flags().is_private(); }
81 bool is_protected() const { return _access_flags.is_protected(); } 90 bool is_protected() const { return access_flags().is_protected(); }
82 bool is_package_private() const { return !is_public() && !is_private() && !is_protected(); } 91 bool is_package_private() const { return !is_public() && !is_private() && !is_protected(); }
83 92
84 bool is_static() const { return _access_flags.is_static(); } 93 bool is_static() const { return access_flags().is_static(); }
85 bool is_final() const { return _access_flags.is_final(); } 94 bool is_final() const { return access_flags().is_final(); }
86 bool is_volatile() const { return _access_flags.is_volatile(); } 95 bool is_volatile() const { return access_flags().is_volatile(); }
87 bool is_transient() const { return _access_flags.is_transient(); } 96 bool is_transient() const { return access_flags().is_transient(); }
88 97
89 bool is_synthetic() const { return _access_flags.is_synthetic(); } 98 bool is_synthetic() const { return access_flags().is_synthetic(); }
90 99
91 bool is_field_access_watched() const { return _access_flags.is_field_access_watched(); } 100 bool is_field_access_watched() const { return access_flags().is_field_access_watched(); }
92 bool is_field_modification_watched() const 101 bool is_field_modification_watched() const
93 { return _access_flags.is_field_modification_watched(); } 102 { return access_flags().is_field_modification_watched(); }
94 void set_is_field_access_watched(const bool value) 103
95 { _access_flags.set_is_field_access_watched(value); } 104 void set_is_field_access_watched(const bool value) {
96 void set_is_field_modification_watched(const bool value) 105 _access_flags.set_is_field_access_watched(value);
97 { _access_flags.set_is_field_modification_watched(value); } 106 update_klass_field_access_flag();
107 }
108
109 void set_is_field_modification_watched(const bool value) {
110 _access_flags.set_is_field_modification_watched(value);
111 update_klass_field_access_flag();
112 }
98 113
99 // Initialization 114 // Initialization
100 void initialize(klassOop k, int index); 115 void initialize(klassOop k, int index);
101 116
102 // Print 117 // Print