Mercurial > hg > truffle
comparison src/share/vm/runtime/fieldDescriptor.cpp @ 12355:cefad50507d8
Merge with hs25-b53
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 11 Oct 2013 10:38:03 +0200 |
parents | 0f7ca53be929 b2e698d2276c |
children | 359f7e70ae7f |
comparison
equal
deleted
inserted
replaced
12058:ccb4f2af2319 | 12355:cefad50507d8 |
---|---|
92 | 92 |
93 oop fieldDescriptor::string_initial_value(TRAPS) const { | 93 oop fieldDescriptor::string_initial_value(TRAPS) const { |
94 return constants()->uncached_string_at(initial_value_index(), CHECK_0); | 94 return constants()->uncached_string_at(initial_value_index(), CHECK_0); |
95 } | 95 } |
96 | 96 |
97 void fieldDescriptor::initialize(InstanceKlass* ik, int index) { | 97 void fieldDescriptor::reinitialize(InstanceKlass* ik, int index) { |
98 _cp = ik->constants(); | 98 if (_cp.is_null() || field_holder() != ik) { |
99 _cp = constantPoolHandle(Thread::current(), ik->constants()); | |
100 // _cp should now reference ik's constant pool; i.e., ik is now field_holder. | |
101 assert(field_holder() == ik, "must be already initialized to this class"); | |
102 } | |
99 FieldInfo* f = ik->field(index); | 103 FieldInfo* f = ik->field(index); |
100 assert(!f->is_internal(), "regular Java fields only"); | 104 assert(!f->is_internal(), "regular Java fields only"); |
101 | 105 |
102 _access_flags = accessFlags_from(f->access_flags()); | 106 _access_flags = accessFlags_from(f->access_flags()); |
103 guarantee(f->name_index() != 0 && f->signature_index() != 0, "bad constant pool index for fieldDescriptor"); | 107 guarantee(f->name_index() != 0 && f->signature_index() != 0, "bad constant pool index for fieldDescriptor"); |
104 _index = index; | 108 _index = index; |
109 verify(); | |
105 } | 110 } |
106 | 111 |
107 #ifndef PRODUCT | 112 #ifndef PRODUCT |
113 | |
114 void fieldDescriptor::verify() const { | |
115 if (_cp.is_null()) { | |
116 assert(_index == badInt, "constructor must be called"); // see constructor | |
117 } else { | |
118 assert(_index >= 0, "good index"); | |
119 assert(_index < field_holder()->java_fields_count(), "oob"); | |
120 } | |
121 } | |
108 | 122 |
109 void fieldDescriptor::print_on(outputStream* st) const { | 123 void fieldDescriptor::print_on(outputStream* st) const { |
110 access_flags().print_on(st); | 124 access_flags().print_on(st); |
111 name()->print_value_on(st); | 125 name()->print_value_on(st); |
112 st->print(" "); | 126 st->print(" "); |