Ejemplo n.º 1
0
void proxyMap::print(oop obj) {
  if (obj->is_map()) {
    lprintf("proxy ");
  } else {
    if (proxyOop(obj)->is_live()) {
      lprintf("proxy(live) ");
    } else {
      lprintf("proxy(dead) ");
    }
    if (WizardMode) 
      lprintf("ptr = %#lx, type_seal = %#lx ",
              proxyOop(obj)->get_pointer(),
              proxyOop(obj)->get_type_seal());
  }
  slotsMap::print(obj);
}
Ejemplo n.º 2
0
void* objVectorOopClass::convertProxyArray(const void* seal) {
  oop*   src    = objs();
  oop*   end    = src + length();
  void** result = NEW_RESOURCE_ARRAY( void*, length());
  void** dst    = result;
  while (src < end) {
    oop s = *src++;
    proxyOop p = proxyOop(s);
    if ( !s->is_proxy()  
    ||   !p->is_live()  
    ||    p->get_type_seal() != seal)
      return NULL;

    *dst++ = proxyOop(s)->get_pointer();
  }
  return result;
}
Ejemplo n.º 3
0
extern "C" volatile void* handleCallBack(int index, int params) {
    DeltaProcess* proc = NULL;

    if (Universe::callBack_receiver()->is_nil()) {
        warning("callBack receiver is not set");
    }

    int low  = get_unsigned_bitfield(params,  0, 16);
    int high = get_unsigned_bitfield(params, 16, 16);

    if (DeltaProcess::active()->thread_id() != os::current_thread_id()) {
        // We'are now back in a asynchronous DLL call so give up the control
        // Fix this:
        //   remove warning when it has been tested
        proc = Processes::find_from_thread_id(os::current_thread_id());
        assert(proc, "process must be present");
        DLLs::exit_async_call(&proc);
    }

    DeltaProcess::active()->setIsCallback(true);

    oop res = Delta::call(Universe::callBack_receiver(),
                          Universe::callBack_selector(),
                          as_smiOop(index),
                          as_smiOop(high),
                          as_smiOop(low));

    assert(DeltaProcess::active()->thread_id() == os::current_thread_id(), "check for process torch");

    void* result;

    // convert return result

    if (have_nlr_through_C) {
        // Continues the NLR after at the next Delta frame
        BaseHandle* handle = DeltaProcess::active()->firstHandle();
        if (handle && ((char*) handle < (char*)DeltaProcess::active()->last_Delta_fp()))
            handle->pop();

        ErrorHandler::continue_nlr_in_delta();
    }

    if (res->is_smi()) {
        result = (void*) smiOop(res)->value();
    } else if (res->is_proxy()) {
        result = (void*) proxyOop(res)->get_pointer();
    } else {
        warning("Wrong return type for call back, returning NULL");
        result = NULL;
    }

    // Return value has to be converted before we transfer control to another
    // thread.

    if (proc) {
        // We'are now back in a asynchronous DLL call so give up the control
        proc->resetStepping();
        proc->transfer_and_continue();
    }

    // Call Delta level error routine
    return result;
}
Ejemplo n.º 4
0
void proxyMap::dummy_initialize(oop obj, oop filler){
  foreignMap::dummy_initialize(obj, filler);
  proxyOop(obj)->set_type_seal(NULL);
}