Beispiel #1
0
void CodeGen::fixupFrame(RegisterState* s) {
  // window size adjustment
  assert(haveStackFrame, "should have stack frame");
  assert(is_end_of_enter(prologueAddr), "enter?");  

  // must include permanents and stack: local slots, blocks and stack
  _number_of_memory_locals                = s->stackDepth;  

  fint    min_space_to_reserve = s->stackDepth + s->argDepth + s->rcvrDepth + num_extra_locals_for_runtime;
  fint    min_space_from_incoming_rcvr_to_outgoing_rcvr = min_space_to_reserve + ircvr_offset /*pc, ebp*/;
  fint actual_space_from_incoming_rcvr_to_outgoing_rcvr = roundTo(min_space_from_incoming_rcvr_to_outgoing_rcvr, frame_word_alignment);
  fint actual_space_to_reserve = min_space_to_reserve 
                               + actual_space_from_incoming_rcvr_to_outgoing_rcvr
                                  - min_space_from_incoming_rcvr_to_outgoing_rcvr;
  frameSize = actual_space_from_incoming_rcvr_to_outgoing_rcvr;
  assert((frameSize & (frame_word_alignment - 1))  == 0, "alignment");
  set_space_reserved_by_enter_instruction(prologueAddr, actual_space_to_reserve);
  
  if (number_of_memory_locals()  >  sizeof(RegisterString) * BitsPerByte) {
    // must clear extra stack locations:
    Label patches(a.printing);
    a.saveExcursion( callPatchAddr );
    a.jmp(&patches);
    DefinedLabel return_from_patches(a.printing);
    assert(a.addr() == endCallPatchAddr, "???");
    a.endExcursion();
    
    a.Comment("zero locations not in mask()");
    patches.define();
    for ( fint i = sizeof(RegisterString) * BitsPerByte;  i < number_of_memory_locals();  ++i) {
      Location r;  int32 d;  OperandType t;
      reg_disp_type_of_loc(&r, &d, &t, StackLocation_for_index(i));
      a.movl(0, NumberOperand, r, d, t);
    }
    a.jmp(&return_from_patches);
  }
}
Beispiel #2
0
int32 SICompiler::stackTempCount() {
  return number_of_memory_locals()
       + max_no_of_outgoing_args_and_rcvr();
}
Beispiel #3
0
void nmethod::print_platform_specific_data() {
  ++Indent;
  lprintf( "number_of_memory_locals               = %d\n", number_of_memory_locals() );
  --Indent;
}
Beispiel #4
0
int32 SICompiler::stackTempCount() {
  return number_of_saved_nonvolatile_registers()
       + number_of_memory_locals()
       + max_no_of_outgoing_args_and_rcvr();
}