コード例 #1
0
void LIR_Assembler::emit_exception_entries(ExceptionInfoList* info_list) {
    for (int i = 0; i < info_list->length(); i++) {
        XHandlers* handlers = info_list->at(i)->exception_handlers();

        for (int j = 0; j < handlers->length(); j++) {
            XHandler* handler = handlers->handler_at(j);
            assert(handler->lir_op_id() != -1, "handler not processed by LinearScan");
            assert(handler->entry_code() == NULL ||
                   handler->entry_code()->instructions_list()->last()->code() == lir_branch ||
                   handler->entry_code()->instructions_list()->last()->code() == lir_delay_slot, "last operation must be branch");

            if (handler->entry_pco() == -1) {
                // entry code not emitted yet
                if (handler->entry_code() != NULL && handler->entry_code()->instructions_list()->length() > 1) {
                    handler->set_entry_pco(code_offset());
                    if (CommentedAssembly) {
                        _masm->block_comment("Exception adapter block");
                    }
                    emit_lir_list(handler->entry_code());
                } else {
                    handler->set_entry_pco(handler->entry_block()->exception_handler_pco());
                }

                assert(handler->entry_pco() != -1, "must be set now");
            }
        }
    }
}
コード例 #2
0
void LIR_Assembler::emit_exception_entries(ExceptionInfoList* info_list) {
  // tell these to the MacroAssembler 

  for (int i = 0; i < info_list->length(); i++) {
    XHandlers* handlers = info_list->at(i)->exception_handlers();

    for (int j = 0; j < handlers->length(); j++) {
      XHandler* handler = handlers->handler_at(j);
      assert(handler->lir_op_id() != -1, "handler not processed by LinearScan");
      assert(handler->entry_code() == NULL ||
handler->entry_code()->instructions_list()->last()->code()==lir_branch,"last operation must be branch");

      if (!handler->entry_lbl()) {
        // entry code not emitted yet
        if (handler->entry_code() != NULL && handler->entry_code()->instructions_list()->length() > 1) {
          handler->set_entry_lbl(new Label(_masm)); // bind label here
          _masm->block_comment("Exception adapter block");
          emit_lir_list(handler->entry_code());
        } else {
handler->set_entry_lbl(handler->entry_block()->label());
        }
      }
    }
  }
}