hotspot/src/share/vm/c1/c1_LinearScan.cpp
changeset 10517 f92c9ff3a15f
parent 8921 14bfe81f2a9d
child 10732 6a893b38ee30
equal deleted inserted replaced
10516:2797e487c09f 10517:f92c9ff3a15f
  2402 
  2402 
  2403       // caller-save registers must not be included into oop-maps at calls
  2403       // caller-save registers must not be included into oop-maps at calls
  2404       assert(!is_call_site || assigned_reg >= nof_regs || !is_caller_save(assigned_reg), "interval is in a caller-save register at a call -> register will be overwritten");
  2404       assert(!is_call_site || assigned_reg >= nof_regs || !is_caller_save(assigned_reg), "interval is in a caller-save register at a call -> register will be overwritten");
  2405 
  2405 
  2406       VMReg name = vm_reg_for_interval(interval);
  2406       VMReg name = vm_reg_for_interval(interval);
  2407       map->set_oop(name);
  2407       set_oop(map, name);
  2408 
  2408 
  2409       // Spill optimization: when the stack value is guaranteed to be always correct,
  2409       // Spill optimization: when the stack value is guaranteed to be always correct,
  2410       // then it must be added to the oop map even if the interval is currently in a register
  2410       // then it must be added to the oop map even if the interval is currently in a register
  2411       if (interval->always_in_memory() &&
  2411       if (interval->always_in_memory() &&
  2412           op->id() > interval->spill_definition_pos() &&
  2412           op->id() > interval->spill_definition_pos() &&
  2413           interval->assigned_reg() != interval->canonical_spill_slot()) {
  2413           interval->assigned_reg() != interval->canonical_spill_slot()) {
  2414         assert(interval->spill_definition_pos() > 0, "position not set correctly");
  2414         assert(interval->spill_definition_pos() > 0, "position not set correctly");
  2415         assert(interval->canonical_spill_slot() >= LinearScan::nof_regs, "no spill slot assigned");
  2415         assert(interval->canonical_spill_slot() >= LinearScan::nof_regs, "no spill slot assigned");
  2416         assert(interval->assigned_reg() < LinearScan::nof_regs, "interval is on stack, so stack slot is registered twice");
  2416         assert(interval->assigned_reg() < LinearScan::nof_regs, "interval is on stack, so stack slot is registered twice");
  2417 
  2417 
  2418         map->set_oop(frame_map()->slot_regname(interval->canonical_spill_slot() - LinearScan::nof_regs));
  2418         set_oop(map, frame_map()->slot_regname(interval->canonical_spill_slot() - LinearScan::nof_regs));
  2419       }
  2419       }
  2420     }
  2420     }
  2421   }
  2421   }
  2422 
  2422 
  2423   // add oops from lock stack
  2423   // add oops from lock stack
  2424   assert(info->stack() != NULL, "CodeEmitInfo must always have a stack");
  2424   assert(info->stack() != NULL, "CodeEmitInfo must always have a stack");
  2425   int locks_count = info->stack()->total_locks_size();
  2425   int locks_count = info->stack()->total_locks_size();
  2426   for (int i = 0; i < locks_count; i++) {
  2426   for (int i = 0; i < locks_count; i++) {
  2427     map->set_oop(frame_map()->monitor_object_regname(i));
  2427     set_oop(map, frame_map()->monitor_object_regname(i));
  2428   }
  2428   }
  2429 
  2429 
  2430   return map;
  2430   return map;
  2431 }
  2431 }
  2432 
  2432