示例#1
0
vframe* vframe::new_vframe(const frame* f, const RegisterMap* reg_map, JavaThread* thread) {
  // Interpreter frame
  if (f->is_interpreted_frame()) {
    return new interpretedVFrame(f, reg_map, thread);
  }  

#ifndef CORE
  // Compiled frame
  CodeBlob* cb = CodeCache::find_blob(f->pc());
  if (cb != NULL) {  
    if (cb->is_nmethod()) {      
      nmethod* nm = (nmethod*)cb;            
      // Compiled method (native stub or Java code)
      ScopeDesc* scope  = nm->scope_desc_at(f->pc(), reg_map->is_pc_at_call(f->id()));
      return new compiledVFrame(f, reg_map, thread, scope);  
    }

    if (f->is_glue_frame()) {
      // This is a conversion frame. Skip this frame and try again.      
      RegisterMap temp_map = *reg_map;
      frame s = f->sender(&temp_map);
      return new_vframe(&s, &temp_map, thread);
    }
  }
  // Deoptimized frame
  if (f->is_deoptimized_frame()) {
    return new deoptimizedVFrame(f, reg_map, thread);  
  }
#endif

  // External frame
  return new externalVFrame(f, reg_map, thread);
}
示例#2
0
vframe* vframe::new_vframe(const frame* f, const RegisterMap* reg_map, JavaThread* thread) {
  // Interpreter frame
  if (f->is_interpreted_frame()) {
    return new interpretedVFrame(f, reg_map, thread);
  }

  // Compiled frame
  CodeBlob* cb = f->cb();
  if (cb != NULL) {
    if (cb->is_nmethod()) {
      nmethod* nm = (nmethod*)cb;
      return new compiledVFrame(f, reg_map, thread, nm);
    }

    if (f->is_runtime_frame()) {
      // Skip this frame and try again.
      RegisterMap temp_map = *reg_map;
      frame s = f->sender(&temp_map);
      return new_vframe(&s, &temp_map, thread);
    }
  }

  // External frame
  return new externalVFrame(f, reg_map, thread);
}
示例#3
0
void frame::copy_to( char* sp,
                     char* caller,
                     char* pc,
                     bool adjust) {

  sparc_sp *new_sp = (sparc_sp*)sp;

  if (adjust) {
    // make sure all memoized blocks exist, then adjust their scope
    abstract_vframe* callee = NULL;
    OopOopTable* dummy = EMPTY;
    for ( abstract_vframe* vf = new_vframe(this);
          vf  &&  vf->fr == this;
          callee = vf,  vf = vf->sender()) {
      vf->createBlocks(callee, dummy);
    }
    frame* new_f = new_sp->as_callers_frame();
    ResourceMark rm; // for RegisterLocator
    adjust_blocks(block_scope_of_home_frame(), new_f, RegisterLocator::for_frame(new_f));
  }
  copy_oops(my_sp()->as_oops(), new_sp->as_oops(), frame_size());

  new_sp->set_link( (sparc_fp*) caller );
  new_sp->set_return_addr( pc );
}
示例#4
0
void frame::copy_to( char* sp,
                     char* caller,
                     char* pc,
                     bool adjust) {

  frame* new_f = (frame*)sp;
  if (SpendTimeForDebugging)
    warning("untested frame::copy_to:"); // need SIC to test this

  if (adjust) {
    // make sure all memoized blocks exist, then adjust their scope
    abstract_vframe* callee = NULL;
    OopOopTable* dummy = EMPTY;
    for ( abstract_vframe* vf = new_vframe(this);
          vf  &&  vf->fr == this;
          callee = vf,  vf = vf->sender()) {
      vf->createBlocks(callee, dummy);
    }
    ResourceMark rm; // for RegisterLocators
    adjust_blocks(block_scope_of_home_frame(), new_f, RegisterLocator::for_frame(new_f) );
  }
  copy_oops( (oop*)this, (oop*)new_f, frame_size());

  my_sp()->set_link( ((frame*)caller)->my_sp() );
  set_return_addr( pc );
}
示例#5
0
abstract_vframe* processOopClass::vframe_at(smi index, void *FH, Process*& p,
                                   frame*& last) {
  p = checkProcess(this);
  if (!p) {
    prim_failure(FH, NOPROCESSERROR);
    return NULL;
  }
  if (index < 0 || !p->inSelf()) {
    prim_failure(FH, BADINDEXERROR);
    return NULL;
  }
  FlushRegisterWindows();
  last = p->last_self_frame(false);
  abstract_vframe* vf = new_vframe(last);
  if (vf->is_prologue()) vf = vf->sender();
  bool hideFirst = p != vmProcess;
  int32 i = 0;
  for ( ;; ) {
    if (i == index) break;
    vf = vf->sender();
    i++;
    if (!vf) break;
  }
  if (!vf || (vf->is_first_self_vframe() && hideFirst)) {
    prim_failure(FH, BADINDEXERROR);
    return NULL;
  }
  return vf;
}
示例#6
0
char* sendDesc::sendMessage( frame* lookupFrame,
                             oop receiver,
                             oop perform_selector,
                             oop perform_delegatee,
                             oop arg1 ) {
  ShowLookupInMonitor sl;

  LookupType type= lookupType();

  oop sel = static_or_dynamic_selector(  perform_selector,  type);
  oop del = static_or_dynamic_delegatee( perform_delegatee, type);

  sendMessagePrologue( receiver, lookupFrame );

  if ( !Trace) {
    // try codeTable first (order of magnitude faster)
  
    char* r = fastCacheLookupAndBackpatch(type,
                                          receiver->map()->enclosing_mapOop(),
                                          sel,
                                          del);
    if (r) {
      if (SilentTrace) LOG_EVENT1("SendMessage: fast-found %#lx", r);
      return r;
    }
  }

  // have to do it the slow way
  ResourceMark m;
  FlushRegisterWindows(); // for vframe conversion below
  cacheProbingLookup L( receiver,
                        sel,
                        del,
                        MH_TBD,  // method holder
                        new_vframe(lookupFrame),
                        this,
                        NULL,    // DIDesc
                        false ); // don't want a debug version

  // should we have switched stacks sooner? (dmu) also in SendDIMessage
  
  nmethod* nm = switchToVMStack( SendMessage_cont, &L );
  if (SilentTrace) LOG_EVENT1("sendDesc::sendMessage: found %#lx", nm);

  return
    Interpret
    ? L.interpretResultForCompiledSender(arg1)
    : nm->verifiedEntryPoint();
}
示例#7
0
void compiled_vframe::print_code(fint curFrame) {
  
  lprintf("#%ld", (long) curFrame);
  if (!WizardMode) return;

  lprintf(" <%#lx%c@ %#lx%c%s # %ld",
         (long unsigned)fr,
         fr->return_addr() != fr->real_return_addr() ? '*' : ' ',
         (long unsigned)code,
         code->isInvalid() ? '!' : ' ',
         code->isDebug()
           ? "deb" : VMString[code->compiler()]->copy_null_terminated(),
         long(code->scopes->offsetTo(desc)));

  if (!ConversionInProgress && this->EQ(new_vframe(fr))) {
    // bottom vframe of this frame - show sendDesc
    int32* instp = (int32*)fr->real_return_addr();
    if (!isUnimp(instp)) {
      lprintf(", pc=%#lx", (fr->send_desc()));
    }
  }

  lprintf(">");
}
示例#8
0
abstract_vframe* blockOopClass::parentVFrame(frame* currentFrame, bool orNone) {
  frame* pf= parentFrame(currentFrame, orNone);
  return pf == NULL  ?  NULL  :  new_vframe(pf, desc());
}
示例#9
0
abstract_vframe* vframeOopClass::as_vframe() {
  assert(is_live()  ||  (lprintf("vframeOop 0x%x is dead\n", this), false),
         "not live");
  return new_vframe(fr(), descOffset());
}