< prev index next >

src/hotspot/share/oops/stackChunkOop.inline.hpp

Print this page

151 inline void stackChunkOopDesc::set_flag(uint8_t flag, bool value) {
152   uint32_t flags = this->flags();
153   set_flags((uint8_t)(value ? flags |= flag : flags &= ~flag));
154 }
155 inline void stackChunkOopDesc::clear_flags() {
156   set_flags(0);
157 }
158 
159 inline bool stackChunkOopDesc::has_mixed_frames() const { return is_flag(FLAG_HAS_INTERPRETED_FRAMES); }
160 inline void stackChunkOopDesc::set_has_mixed_frames(bool value) {
161   assert((flags() & ~(FLAG_HAS_INTERPRETED_FRAMES | FLAG_PREEMPTED)) == 0, "other flags should not be set");
162   set_flag(FLAG_HAS_INTERPRETED_FRAMES, value);
163 }
164 
165 inline bool stackChunkOopDesc::preempted() const { return is_flag(FLAG_PREEMPTED); }
166 inline void stackChunkOopDesc::set_preempted(bool value) {
167   assert(preempted() != value, "");
168   set_flag(FLAG_PREEMPTED, value);
169 }
170 












171 inline bool stackChunkOopDesc::has_lockstack() const         { return is_flag(FLAG_HAS_LOCKSTACK); }
172 inline void stackChunkOopDesc::set_has_lockstack(bool value) { set_flag(FLAG_HAS_LOCKSTACK, value); }
173 
174 inline bool stackChunkOopDesc::is_gc_mode() const                  { return is_flag(FLAG_GC_MODE); }
175 inline bool stackChunkOopDesc::is_gc_mode_acquire() const          { return is_flag_acquire(FLAG_GC_MODE); }
176 inline void stackChunkOopDesc::set_gc_mode(bool value)             { set_flag(FLAG_GC_MODE, value); }
177 
178 inline bool stackChunkOopDesc::has_bitmap() const                  { return is_flag(FLAG_HAS_BITMAP); }
179 inline void stackChunkOopDesc::set_has_bitmap(bool value)          { set_flag(FLAG_HAS_BITMAP, value); }
180 
181 inline bool stackChunkOopDesc::has_thaw_slowpath_condition() const { return flags() != 0; }
182 
183 inline bool stackChunkOopDesc::requires_barriers() {
184   return Universe::heap()->requires_barriers(this);
185 }
186 
187 template <stackChunkOopDesc::BarrierType barrier, ChunkFrames frame_kind, typename RegisterMapT>
188 void stackChunkOopDesc::do_barriers(const StackChunkFrameStream<frame_kind>& f, const RegisterMapT* map) {
189   if (frame_kind == ChunkFrames::Mixed) {
190     // we could freeze deopted frames in slow mode.

193   do_barriers0<barrier>(f, map);
194 }
195 
196 template <typename OopT, class StackChunkLockStackClosureType>
197 inline void stackChunkOopDesc::iterate_lockstack(StackChunkLockStackClosureType* closure) {
198   int cnt = lockstack_size();
199   intptr_t* lockstart_addr = start_address();
200   for (int i = 0; i < cnt; i++) {
201     closure->do_oop((OopT*)&lockstart_addr[i]);
202   }
203 }
204 
205 template <class StackChunkFrameClosureType>
206 inline void stackChunkOopDesc::iterate_stack(StackChunkFrameClosureType* closure) {
207   has_mixed_frames() ? iterate_stack<ChunkFrames::Mixed>(closure)
208                      : iterate_stack<ChunkFrames::CompiledOnly>(closure);
209 }
210 
211 template <ChunkFrames frame_kind, class StackChunkFrameClosureType>
212 inline void stackChunkOopDesc::iterate_stack(StackChunkFrameClosureType* closure) {
213   const SmallRegisterMap* map = SmallRegisterMap::instance();
214   assert(!map->in_cont(), "");
215 
216   StackChunkFrameStream<frame_kind> f(this);
217   bool should_continue = true;
218 
219   if (f.is_stub()) {
220     RegisterMap full_map(nullptr,
221                          RegisterMap::UpdateMap::include,
222                          RegisterMap::ProcessFrames::skip,
223                          RegisterMap::WalkContinuation::include);
224     full_map.set_include_argument_oops(false);
225     closure->do_frame(f, map);
226 
227     f.next(&full_map);
228     assert(!f.is_done(), "");
229     assert(f.is_compiled(), "");
230 
231     should_continue = closure->do_frame(f, &full_map);
232     f.next(map);



233   }
234   assert(!f.is_stub(), "");
235 
236   for(; should_continue && !f.is_done(); f.next(map)) {
237     if (frame_kind == ChunkFrames::Mixed) {
238       // in slow mode we might freeze deoptimized frames
239       f.handle_deopted();
240     }
241     should_continue = closure->do_frame(f, map);
242   }
243 }
244 
245 inline frame stackChunkOopDesc::relativize(frame fr)   const { relativize_frame(fr);   return fr; }
246 inline frame stackChunkOopDesc::derelativize(frame fr) const { derelativize_frame(fr); return fr; }
247 
248 inline void* stackChunkOopDesc::gc_data() const {
249   int stack_sz = stack_size();
250   assert(stack_sz != 0, "stack should not be empty");
251 
252   // The gc data is located after the stack.

151 inline void stackChunkOopDesc::set_flag(uint8_t flag, bool value) {
152   uint32_t flags = this->flags();
153   set_flags((uint8_t)(value ? flags |= flag : flags &= ~flag));
154 }
155 inline void stackChunkOopDesc::clear_flags() {
156   set_flags(0);
157 }
158 
159 inline bool stackChunkOopDesc::has_mixed_frames() const { return is_flag(FLAG_HAS_INTERPRETED_FRAMES); }
160 inline void stackChunkOopDesc::set_has_mixed_frames(bool value) {
161   assert((flags() & ~(FLAG_HAS_INTERPRETED_FRAMES | FLAG_PREEMPTED)) == 0, "other flags should not be set");
162   set_flag(FLAG_HAS_INTERPRETED_FRAMES, value);
163 }
164 
165 inline bool stackChunkOopDesc::preempted() const { return is_flag(FLAG_PREEMPTED); }
166 inline void stackChunkOopDesc::set_preempted(bool value) {
167   assert(preempted() != value, "");
168   set_flag(FLAG_PREEMPTED, value);
169 }
170 
171 inline bool stackChunkOopDesc::at_klass_init() const { return jdk_internal_vm_StackChunk::atKlassInit(as_oop()); }
172 inline void stackChunkOopDesc::set_at_klass_init(bool value) {
173   assert(at_klass_init() != value, "");
174   jdk_internal_vm_StackChunk::set_atKlassInit(this, value);
175 }
176 
177 inline bool stackChunkOopDesc::has_args_at_top() const { return jdk_internal_vm_StackChunk::hasArgsAtTop(as_oop()); }
178 inline void stackChunkOopDesc::set_has_args_at_top(bool value) {
179   assert(has_args_at_top() != value, "");
180   jdk_internal_vm_StackChunk::set_hasArgsAtTop(this, value);
181 }
182 
183 inline bool stackChunkOopDesc::has_lockstack() const         { return is_flag(FLAG_HAS_LOCKSTACK); }
184 inline void stackChunkOopDesc::set_has_lockstack(bool value) { set_flag(FLAG_HAS_LOCKSTACK, value); }
185 
186 inline bool stackChunkOopDesc::is_gc_mode() const                  { return is_flag(FLAG_GC_MODE); }
187 inline bool stackChunkOopDesc::is_gc_mode_acquire() const          { return is_flag_acquire(FLAG_GC_MODE); }
188 inline void stackChunkOopDesc::set_gc_mode(bool value)             { set_flag(FLAG_GC_MODE, value); }
189 
190 inline bool stackChunkOopDesc::has_bitmap() const                  { return is_flag(FLAG_HAS_BITMAP); }
191 inline void stackChunkOopDesc::set_has_bitmap(bool value)          { set_flag(FLAG_HAS_BITMAP, value); }
192 
193 inline bool stackChunkOopDesc::has_thaw_slowpath_condition() const { return flags() != 0; }
194 
195 inline bool stackChunkOopDesc::requires_barriers() {
196   return Universe::heap()->requires_barriers(this);
197 }
198 
199 template <stackChunkOopDesc::BarrierType barrier, ChunkFrames frame_kind, typename RegisterMapT>
200 void stackChunkOopDesc::do_barriers(const StackChunkFrameStream<frame_kind>& f, const RegisterMapT* map) {
201   if (frame_kind == ChunkFrames::Mixed) {
202     // we could freeze deopted frames in slow mode.

205   do_barriers0<barrier>(f, map);
206 }
207 
208 template <typename OopT, class StackChunkLockStackClosureType>
209 inline void stackChunkOopDesc::iterate_lockstack(StackChunkLockStackClosureType* closure) {
210   int cnt = lockstack_size();
211   intptr_t* lockstart_addr = start_address();
212   for (int i = 0; i < cnt; i++) {
213     closure->do_oop((OopT*)&lockstart_addr[i]);
214   }
215 }
216 
217 template <class StackChunkFrameClosureType>
218 inline void stackChunkOopDesc::iterate_stack(StackChunkFrameClosureType* closure) {
219   has_mixed_frames() ? iterate_stack<ChunkFrames::Mixed>(closure)
220                      : iterate_stack<ChunkFrames::CompiledOnly>(closure);
221 }
222 
223 template <ChunkFrames frame_kind, class StackChunkFrameClosureType>
224 inline void stackChunkOopDesc::iterate_stack(StackChunkFrameClosureType* closure) {
225   const auto* map = SmallRegisterMap::instance_no_args();
226   assert(!map->in_cont(), "");
227 
228   StackChunkFrameStream<frame_kind> f(this);
229   bool should_continue = true;
230 
231   if (f.is_stub()) {
232     RegisterMap full_map(nullptr,
233                          RegisterMap::UpdateMap::include,
234                          RegisterMap::ProcessFrames::skip,
235                          RegisterMap::WalkContinuation::include);
236     full_map.set_include_argument_oops(false);
237     closure->do_frame(f, map);
238 
239     f.next(&full_map);
240     assert(!f.is_done(), "");
241     assert(f.is_compiled(), "");
242 
243     should_continue = closure->do_frame(f, &full_map);
244     f.next(map);
245   } else if (frame_kind == ChunkFrames::Mixed && f.is_interpreted() && has_args_at_top()) {
246     should_continue = closure->do_frame(f, SmallRegisterMap::instance_with_args());
247     f.next(map);
248   }
249   assert(!f.is_stub(), "");
250 
251   for(; should_continue && !f.is_done(); f.next(map)) {
252     if (frame_kind == ChunkFrames::Mixed) {
253       // in slow mode we might freeze deoptimized frames
254       f.handle_deopted();
255     }
256     should_continue = closure->do_frame(f, map);
257   }
258 }
259 
260 inline frame stackChunkOopDesc::relativize(frame fr)   const { relativize_frame(fr);   return fr; }
261 inline frame stackChunkOopDesc::derelativize(frame fr) const { derelativize_frame(fr); return fr; }
262 
263 inline void* stackChunkOopDesc::gc_data() const {
264   int stack_sz = stack_size();
265   assert(stack_sz != 0, "stack should not be empty");
266 
267   // The gc data is located after the stack.
< prev index next >