@@ -308,10 +308,13 @@ void OopMapSet::all_do(const frame *fr, const RegisterMap *reg_map,
308
308
309
309
// handle derived pointers first (otherwise base pointer may be
310
310
// changed before derived pointer offset has been collected)
311
- OopMapValue omv;
312
311
{
313
- OopMapStream oms (map);
314
- if (!oms.is_done ()) {
312
+ for (OopMapStream oms (map); !oms.is_done (); oms.next ()) {
313
+ OopMapValue omv = oms.current ();
314
+ if (omv.type () != OopMapValue::derived_oop_value) {
315
+ continue ;
316
+ }
317
+
315
318
#ifndef TIERED
316
319
COMPILER1_PRESENT (ShouldNotReachHere ();)
317
320
#if INCLUDE_JVMCI
@@ -320,31 +323,26 @@ void OopMapSet::all_do(const frame *fr, const RegisterMap *reg_map,
320
323
}
321
324
#endif
322
325
#endif // !TIERED
323
- do {
324
- omv = oms.current ();
325
- if (omv.type () == OopMapValue::derived_oop_value) {
326
- oop* loc = fr->oopmapreg_to_location (omv.reg (),reg_map);
327
- guarantee (loc != NULL , " missing saved register" );
328
- oop *derived_loc = loc;
329
- oop *base_loc = fr->oopmapreg_to_location (omv.content_reg (), reg_map);
330
- // Ignore NULL oops and decoded NULL narrow oops which
331
- // equal to CompressedOops::base() when a narrow oop
332
- // implicit null check is used in compiled code.
333
- // The narrow_oop_base could be NULL or be the address
334
- // of the page below heap depending on compressed oops mode.
335
- if (base_loc != NULL && *base_loc != NULL && !CompressedOops::is_base (*base_loc)) {
336
- derived_oop_fn (base_loc, derived_loc);
337
- }
338
- }
339
- oms.next ();
340
- } while (!oms.is_done ());
326
+ oop* loc = fr->oopmapreg_to_location (omv.reg (),reg_map);
327
+ guarantee (loc != NULL , " missing saved register" );
328
+ oop *derived_loc = loc;
329
+ oop *base_loc = fr->oopmapreg_to_location (omv.content_reg (), reg_map);
330
+ // Ignore NULL oops and decoded NULL narrow oops which
331
+ // equal to CompressedOops::base() when a narrow oop
332
+ // implicit null check is used in compiled code.
333
+ // The narrow_oop_base could be NULL or be the address
334
+ // of the page below heap depending on compressed oops mode.
335
+ if (base_loc != NULL && *base_loc != NULL && !CompressedOops::is_base (*base_loc)) {
336
+ derived_oop_fn (base_loc, derived_loc);
337
+ }
338
+ oms.next ();
341
339
}
342
340
}
343
341
344
342
{
345
343
// We want coop and oop oop_types
346
344
for (OopMapStream oms (map); !oms.is_done (); oms.next ()) {
347
- omv = oms.current ();
345
+ OopMapValue omv = oms.current ();
348
346
oop* loc = fr->oopmapreg_to_location (omv.reg (),reg_map);
349
347
// It should be an error if no location can be found for a
350
348
// register mentioned as contained an oop of some kind. Maybe
0 commit comments