void LIR_OopMapGenerator::generate() {
  // Initialize by iterating down the method's signature and marking
  // oop locals in the state

  assert((int) oop_map()->size() == frame_map()->num_local_names(), "just checking");
  oop_map()->clear();
  ciSignature* sig = ir()->method()->signature();
  int idx = 0;
  // Handle receiver for non-static methods
  if (!ir()->method()->is_static()) {
    mark(frame_map()->name_for_argument(idx));
    ++idx;
  }
  for (int i = 0; i < sig->count(); i++) {
    ciType* type = sig->type_at(i);
    if (!type->is_primitive_type()) {
      mark(frame_map()->name_for_argument(idx));
    }
    idx += type->size();
  }

  // The start block contains a Base instruction, which causes the LIR
  // for ref-uninit conflicts to be generated. We need to handle this
  // block specially so we don't traverse its "osr_entry" successor,
  // because we don't know how to set up the state appropriately for
  // that entry point.
  _base = ir()->start()->end()->as_Base();

  // Always start iterating at the start (even for OSR compiles)
  merge_state(ir()->start());
  
  BlockBegin* block = work_list_dequeue();
  while (block != NULL) {
    oop_map()->set_from(*block->lir_oop_map());
    iterate_one(block);
    block = work_list_dequeue();
  }
}