< prev index next >

src/hotspot/cpu/x86/abstractInterpreter_x86.cpp

Print this page




  57 void AbstractInterpreter::layout_activation(Method* method,
  58                                             int tempcount,
  59                                             int popframe_extra_args,
  60                                             int moncount,
  61                                             int caller_actual_parameters,
  62                                             int callee_param_count,
  63                                             int callee_locals,
  64                                             frame* caller,
  65                                             frame* interpreter_frame,
  66                                             bool is_top_frame,
  67                                             bool is_bottom_frame) {
  68   // The frame interpreter_frame is guaranteed to be the right size,
  69   // as determined by a previous call to the size_activation() method.
  70   // It is also guaranteed to be walkable even though it is in a
  71   // skeletal state
  72 
  73   int max_locals = method->max_locals() * Interpreter::stackElementWords;
  74   int extra_locals = (method->max_locals() - method->size_of_parameters()) *
  75     Interpreter::stackElementWords;
  76 
  77 #ifdef ASSERT
  78   assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable");
  79 #endif
  80 
  81   interpreter_frame->interpreter_frame_set_method(method);
  82   // NOTE the difference in using sender_sp and
  83   // interpreter_frame_sender_sp interpreter_frame_sender_sp is
  84   // the original sp of the caller (the unextended_sp) and
  85   // sender_sp is fp+8/16 (32bit/64bit) XXX
  86   intptr_t* locals = interpreter_frame->sender_sp() + max_locals - 1;
  87 
  88 #ifdef ASSERT
  89   if (caller->is_interpreted_frame()) {





  90     assert(locals < caller->fp() + frame::interpreter_frame_initial_sp_offset, "bad placement");
  91   }
  92 #endif
  93 
  94   interpreter_frame->interpreter_frame_set_locals(locals);
  95   BasicObjectLock* montop = interpreter_frame->interpreter_frame_monitor_begin();
  96   BasicObjectLock* monbot = montop - moncount;
  97   interpreter_frame->interpreter_frame_set_monitor_end(monbot);
  98 
  99   // Set last_sp
 100   intptr_t*  esp = (intptr_t*) monbot -
 101     tempcount*Interpreter::stackElementWords -
 102     popframe_extra_args;
 103   interpreter_frame->interpreter_frame_set_last_sp(esp);
 104 
 105   // All frames but the initial (oldest) interpreter frame we fill in have
 106   // a value for sender_sp that allows walking the stack but isn't
 107   // truly correct. Correct the value here.
 108   if (extra_locals != 0 &&
 109       interpreter_frame->sender_sp() ==




  57 void AbstractInterpreter::layout_activation(Method* method,
  58                                             int tempcount,
  59                                             int popframe_extra_args,
  60                                             int moncount,
  61                                             int caller_actual_parameters,
  62                                             int callee_param_count,
  63                                             int callee_locals,
  64                                             frame* caller,
  65                                             frame* interpreter_frame,
  66                                             bool is_top_frame,
  67                                             bool is_bottom_frame) {
  68   // The frame interpreter_frame is guaranteed to be the right size,
  69   // as determined by a previous call to the size_activation() method.
  70   // It is also guaranteed to be walkable even though it is in a
  71   // skeletal state
  72 
  73   int max_locals = method->max_locals() * Interpreter::stackElementWords;
  74   int extra_locals = (method->max_locals() - method->size_of_parameters()) *
  75     Interpreter::stackElementWords;
  76 

  77   assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable");

  78 
  79   interpreter_frame->interpreter_frame_set_method(method);
  80   // NOTE the difference in using sender_sp and
  81   // interpreter_frame_sender_sp interpreter_frame_sender_sp is
  82   // the original sp of the caller (the unextended_sp) and
  83   // sender_sp is fp+8/16 (32bit/64bit) XXX
  84   intptr_t* locals = interpreter_frame->sender_sp() + max_locals - 1;
  85 
  86 #ifdef ASSERT
  87   if (caller->is_interpreted_frame()) {
  88     if (locals >= caller->fp() + frame::interpreter_frame_initial_sp_offset) {
  89       tty->print("method: "); method->print_on(tty);
  90       tty->print("caller: "); caller->print_on(tty);
  91       tty->print_cr("sender_sp: " INTPTR_FORMAT " locals: " INTPTR_FORMAT " max_locals: %d caller.fp: " INTPTR_FORMAT " caller.initial_sp: " INTPTR_FORMAT, p2i(interpreter_frame->sender_sp()), p2i(locals), max_locals, p2i(caller->fp()), p2i(caller->fp() + frame::interpreter_frame_initial_sp_offset));
  92     }
  93     assert(locals < caller->fp() + frame::interpreter_frame_initial_sp_offset, "bad placement");
  94   }
  95 #endif
  96 
  97   interpreter_frame->interpreter_frame_set_locals(locals);
  98   BasicObjectLock* montop = interpreter_frame->interpreter_frame_monitor_begin();
  99   BasicObjectLock* monbot = montop - moncount;
 100   interpreter_frame->interpreter_frame_set_monitor_end(monbot);
 101 
 102   // Set last_sp
 103   intptr_t*  esp = (intptr_t*) monbot -
 104     tempcount*Interpreter::stackElementWords -
 105     popframe_extra_args;
 106   interpreter_frame->interpreter_frame_set_last_sp(esp);
 107 
 108   // All frames but the initial (oldest) interpreter frame we fill in have
 109   // a value for sender_sp that allows walking the stack but isn't
 110   // truly correct. Correct the value here.
 111   if (extra_locals != 0 &&
 112       interpreter_frame->sender_sp() ==


< prev index next >