コード例 #1
0
ファイル: a2dht.c プロジェクト: DanielAeolusLaude/mame
/**
 * @brief initialize the display horizontal task
 *
 * @param task task number
 */
void alto2_cpu_device::init_dht(int task)
{
	set_f1(task, f1_block,          &alto2_cpu_device::f1_early_dht_block, 0);
	set_f2(task, f2_dht_evenfield,  0, &alto2_cpu_device::f2_late_evenfield);
	set_f2(task, f2_dht_setmode,    0, &alto2_cpu_device::f2_late_dht_setmode);
	m_active_callback[task] = &alto2_cpu_device::activate_dht;
}
コード例 #2
0
ファイル: a2curt.c プロジェクト: DanielAeolusLaude/mame
/** @brief initialize the cursor task F1 and F2 functions */
void alto2_cpu_device::init_curt(int task)
{
	set_f1(task, f1_block,              &alto2_cpu_device::f1_early_curt_block, 0);
	set_f2(task, f2_curt_load_xpreg,    0, &alto2_cpu_device::f2_late_load_xpreg);
	set_f2(task, f2_curt_load_csr,      0, &alto2_cpu_device::f2_late_load_csr);
	m_active_callback[task] = &alto2_cpu_device::activate_curt;
}
コード例 #3
0
ファイル: a2ksec.cpp プロジェクト: Ashura-X/mame
//! disk sector task slot initialization
void alto2_cpu_device::init_ksec(int task)
{
	set_bs(task, bs_ksec_read_kstat,    &alto2_cpu_device::bs_early_read_kstat, nullptr);
	set_bs(task, bs_ksec_read_kdata,    &alto2_cpu_device::bs_early_read_kdata, nullptr);

	set_f1(task, f1_block,              &alto2_cpu_device::f1_early_ksec_block, nullptr);

	set_f1(task, f1_task_10,            nullptr, nullptr);
	set_f1(task, f1_ksec_strobe,        nullptr, &alto2_cpu_device::f1_late_strobe);
	set_f1(task, f1_ksec_load_kstat,    nullptr, &alto2_cpu_device::f1_late_load_kstat);
	set_f1(task, f1_ksec_increcno,      nullptr, &alto2_cpu_device::f1_late_increcno);
	set_f1(task, f1_ksec_clrstat,       nullptr, &alto2_cpu_device::f1_late_clrstat);
	set_f1(task, f1_ksec_load_kcom,     nullptr, &alto2_cpu_device::f1_late_load_kcom);
	set_f1(task, f1_ksec_load_kadr,     nullptr, &alto2_cpu_device::f1_late_load_kadr);
	set_f1(task, f1_ksec_load_kdata,    nullptr, &alto2_cpu_device::f1_late_load_kdata);

	set_f2(task, f2_ksec_init,          nullptr, &alto2_cpu_device::f2_late_init);
	set_f2(task, f2_ksec_rwc,           nullptr, &alto2_cpu_device::f2_late_rwc);
	set_f2(task, f2_ksec_recno,         nullptr, &alto2_cpu_device::f2_late_recno);
	set_f2(task, f2_ksec_xfrdat,        nullptr, &alto2_cpu_device::f2_late_xfrdat);
	set_f2(task, f2_ksec_swrnrdy,       nullptr, &alto2_cpu_device::f2_late_swrnrdy);
	set_f2(task, f2_ksec_nfer,          nullptr, &alto2_cpu_device::f2_late_nfer);
	set_f2(task, f2_ksec_strobon,       nullptr, &alto2_cpu_device::f2_late_strobon);
	set_f2(task, f2_task_17,            nullptr, nullptr);

	m_task_wakeup |= 1 << task;
}
コード例 #4
0
void ConstantPoolCacheEntry::set_interface_call(methodHandle method, int index) {
  klassOop interf = method->method_holder();
  assert(instanceKlass::cast(interf)->is_interface(), "must be an interface");
  set_f1(interf);
  set_f2(index);
  set_flags(as_flags(as_TosState(method->result_type()), method->is_final_method(), false, false, false, true) | method()->size_of_parameters());
  set_bytecode_1(Bytecodes::_invokeinterface);  
}
コード例 #5
0
void ConstantPoolCacheEntry::set_interface_call(methodHandle method, int index) {
  assert(!is_secondary_entry(), "");
  klassOop interf = method->method_holder();
  assert(instanceKlass::cast(interf)->is_interface(), "must be an interface");
  assert(!method->is_final_method(), "interfaces do not have final methods; cannot link to one here");
  set_f1(interf);
  set_f2(index);
  set_method_flags(as_TosState(method->result_type()),
                   0,  // no option bits
                   method()->size_of_parameters());
  set_bytecode_1(Bytecodes::_invokeinterface);
}
コード例 #6
0
void ConstantPoolCacheEntry::set_itable_call(Bytecodes::Code invoke_code, methodHandle method, int index) {
  assert(method->method_holder()->verify_itable_index(index), "");
  assert(invoke_code == Bytecodes::_invokeinterface, "");
  InstanceKlass* interf = method->method_holder();
  assert(interf->is_interface(), "must be an interface");
  assert(!method->is_final_method(), "interfaces do not have final methods; cannot link to one here");
  set_f1(interf);
  set_f2(index);
  set_method_flags(as_TosState(method->result_type()),
                   0,  // no option bits
                   method()->size_of_parameters());
  set_bytecode_1(Bytecodes::_invokeinterface);
}
コード例 #7
0
// Note that concurrent update of both bytecodes can leave one of them
// reset to zero.  This is harmless; the interpreter will simply re-resolve
// the damaged entry.  More seriously, the memory synchronization is needed
// to flush other fields (f1, f2) completely to memory before the bytecodes
// are updated, lest other processors see a non-zero bytecode but zero f1/f2.
void ConstantPoolCacheEntry::set_field(Bytecodes::Code get_code, 
                                       Bytecodes::Code put_code,
                                       KlassHandle field_holder, 
                                       int field_index, 
                                       int field_offset, 
                                       TosState field_type, 
                                       bool is_final,
                                       bool is_volatile) {
  set_f1(field_holder());
  set_f2(field_offset);
  assert(field_index <= 0xFFFF, "field index does not fit in low flag bits");
  set_flags(as_flags(field_type, is_final, false, is_volatile, false, false) | (field_index & 0xFFFF));
  set_bytecode_1(get_code);
  set_bytecode_2(put_code);
  verify(tty);
}
コード例 #8
0
// Note that concurrent update of both bytecodes can leave one of them
// reset to zero.  This is harmless; the interpreter will simply re-resolve
// the damaged entry.  More seriously, the memory synchronization is needed
// to flush other fields (f1, f2) completely to memory before the bytecodes
// are updated, lest other processors see a non-zero bytecode but zero f1/f2.
void ConstantPoolCacheEntry::set_field(Bytecodes::Code get_code,
                                       Bytecodes::Code put_code,
                                       KlassHandle field_holder,
                                       int field_index,
                                       int field_offset,
                                       TosState field_type,
                                       bool is_final,
                                       bool is_volatile) {
  set_f1(field_holder()->java_mirror());
  set_f2(field_offset);
  assert((field_index & field_index_mask) == field_index,
         "field index does not fit in low flag bits");
  set_field_flags(field_type,
                  ((is_volatile ? 1 : 0) << is_volatile_shift) |
                  ((is_final    ? 1 : 0) << is_final_shift),
                  field_index);
  set_bytecode_1(get_code);
  set_bytecode_2(put_code);
  NOT_PRODUCT(verify(tty));
}
コード例 #9
0
void ConstantPoolCacheEntry::set_method(Bytecodes::Code invoke_code,
                                        methodHandle method,
                                        int vtable_index) {

  assert(method->interpreter_entry() != NULL, "should have been set at this point");
  assert(!method->is_old_version(),  "attempt to write old method to cpCache");
  bool change_to_virtual = (invoke_code == Bytecodes::_invokeinterface);

  int byte_no = -1;
  bool needs_vfinal_flag = false;
  switch (invoke_code) {
    case Bytecodes::_invokevirtual:
    case Bytecodes::_invokeinterface: {
        if (Klass::can_be_statically_bound(method())) {
          set_f2((intptr_t)method());
	  needs_vfinal_flag = true;
        } else {
          set_f2(vtable_index);
        }
        byte_no = 2;
        break;
    }
    case Bytecodes::_invokespecial:
      // Preserve the value of the vfinal flag on invokevirtual bytecode
      // which may be shared with this constant pool cache entry.
      needs_vfinal_flag = is_resolved(Bytecodes::_invokevirtual) && is_vfinal();
      // fall through
    case Bytecodes::_invokestatic:
      set_f1(method());
      byte_no = 1;
      break;
    default:
      ShouldNotReachHere();
      break;
  }

  set_flags(as_flags(as_TosState(method->result_type()),
                     method->is_final_method(), 
                     needs_vfinal_flag, 
                     false, 
                     change_to_virtual,
                     true)|
            method()->size_of_parameters());

  // Note:  byte_no also appears in TemplateTable::resolve.
  if (byte_no == 1) {
    set_bytecode_1(invoke_code);
  } else if (byte_no == 2)  {
    if (change_to_virtual) {
      // NOTE: THIS IS A HACK - BE VERY CAREFUL!!!
      //
      // Workaround for the case where we encounter an invokeinterface, but we
      // should really have an _invokevirtual since the resolved method is a 
      // virtual method in java.lang.Object. This is a corner case in the spec
      // but is presumably legal. javac does not generate this code.
      //
      // We set bytecode_1() to _invokeinterface, because that is the
      // bytecode # used by the interpreter to see if it is resolved.
      // We set bytecode_2() to _invokevirtual.
      // See also interpreterRuntime.cpp. (8/25/2000)
      set_bytecode_1(invoke_code);
      set_bytecode_2(Bytecodes::_invokevirtual);
    } else {
      set_bytecode_2(invoke_code);
    }
  } else {
    ShouldNotReachHere();
  }
  verify(tty);
}
コード例 #10
0
ファイル: a2dwt.c プロジェクト: DanielAeolusLaude/mame
void alto2_cpu_device::init_dwt(int task)
{
	set_f1(task, f1_block,          &alto2_cpu_device::f1_early_dwt_block, 0);
	set_f2(task, f2_dwt_load_ddr,   0, &alto2_cpu_device::f2_late_dwt_load_ddr);
}
コード例 #11
0
 void set_f2_as_vfinal_method(Method* f2) {
   assert(is_vfinal(), "flags must be set");
   set_f2((intx)f2);
 }
コード例 #12
0
void ConstantPoolCacheEntry::set_direct_or_vtable_call(Bytecodes::Code invoke_code,
                                                       methodHandle method,
                                                       int vtable_index) {
  bool is_vtable_call = (vtable_index >= 0);  // FIXME: split this method on this boolean
  assert(method->interpreter_entry() != NULL, "should have been set at this point");
  assert(!method->is_obsolete(),  "attempt to write obsolete method to cpCache");

  int byte_no = -1;
  bool change_to_virtual = false;

  switch (invoke_code) {
    case Bytecodes::_invokeinterface:
      // We get here from InterpreterRuntime::resolve_invoke when an invokeinterface
      // instruction somehow links to a non-interface method (in Object).
      // In that case, the method has no itable index and must be invoked as a virtual.
      // Set a flag to keep track of this corner case.
      change_to_virtual = true;

      // ...and fall through as if we were handling invokevirtual:
    case Bytecodes::_invokevirtual:
      {
        if (!is_vtable_call) {
          assert(method->can_be_statically_bound(), "");
          // set_f2_as_vfinal_method checks if is_vfinal flag is true.
          set_method_flags(as_TosState(method->result_type()),
                           (                             1      << is_vfinal_shift) |
                           ((method->is_final_method() ? 1 : 0) << is_final_shift)  |
                           ((change_to_virtual         ? 1 : 0) << is_forced_virtual_shift),
                           method()->size_of_parameters());
          set_f2_as_vfinal_method(method());
        } else {
          assert(!method->can_be_statically_bound(), "");
          assert(vtable_index >= 0, "valid index");
          assert(!method->is_final_method(), "sanity");
          set_method_flags(as_TosState(method->result_type()),
                           ((change_to_virtual ? 1 : 0) << is_forced_virtual_shift),
                           method()->size_of_parameters());
          set_f2(vtable_index);
        }
        byte_no = 2;
        break;
      }

    case Bytecodes::_invokespecial:
    case Bytecodes::_invokestatic:
      assert(!is_vtable_call, "");
      // Note:  Read and preserve the value of the is_vfinal flag on any
      // invokevirtual bytecode shared with this constant pool cache entry.
      // It is cheap and safe to consult is_vfinal() at all times.
      // Once is_vfinal is set, it must stay that way, lest we get a dangling oop.
      set_method_flags(as_TosState(method->result_type()),
                       ((is_vfinal()               ? 1 : 0) << is_vfinal_shift) |
                       ((method->is_final_method() ? 1 : 0) << is_final_shift),
                       method()->size_of_parameters());
      set_f1(method());
      byte_no = 1;
      break;
    default:
      ShouldNotReachHere();
      break;
  }

  // Note:  byte_no also appears in TemplateTable::resolve.
  if (byte_no == 1) {
    assert(invoke_code != Bytecodes::_invokevirtual &&
           invoke_code != Bytecodes::_invokeinterface, "");
    set_bytecode_1(invoke_code);
  } else if (byte_no == 2)  {
    if (change_to_virtual) {
      assert(invoke_code == Bytecodes::_invokeinterface, "");
      // NOTE: THIS IS A HACK - BE VERY CAREFUL!!!
      //
      // Workaround for the case where we encounter an invokeinterface, but we
      // should really have an _invokevirtual since the resolved method is a
      // virtual method in java.lang.Object. This is a corner case in the spec
      // but is presumably legal. javac does not generate this code.
      //
      // We set bytecode_1() to _invokeinterface, because that is the
      // bytecode # used by the interpreter to see if it is resolved.
      // We set bytecode_2() to _invokevirtual.
      // See also interpreterRuntime.cpp. (8/25/2000)
      // Only set resolved for the invokeinterface case if method is public.
      // Otherwise, the method needs to be reresolved with caller for each
      // interface call.
      if (method->is_public()) set_bytecode_1(invoke_code);
    } else {
      assert(invoke_code == Bytecodes::_invokevirtual, "");
    }
    // set up for invokevirtual, even if linking for invokeinterface also:
    set_bytecode_2(Bytecodes::_invokevirtual);
  } else {
    ShouldNotReachHere();
  }
  NOT_PRODUCT(verify(tty));
}