コード例 #1
0
ファイル: assembler.cpp プロジェクト: stkaushal/jdk8_tl
// Inform CodeBuffer that incoming code and relocation will be for stubs
address AbstractAssembler::start_a_const(int required_space, int required_align) {
  CodeBuffer*  cb = code();
  CodeSection* cs = cb->consts();
  assert(_code_section == cb->insts() || _code_section == cb->stubs(), "not in insts/stubs?");
  address end = cs->end();
  int pad = -(intptr_t)end & (required_align-1);
  if (cs->maybe_expand_to_ensure_remaining(pad + required_space)) {
    if (cb->blob() == NULL)  return NULL;
    end = cs->end();  // refresh pointer
  }
  if (pad > 0) {
    while (--pad >= 0) { *end++ = 0; }
    cs->set_end(end);
  }
  set_code_section(cs);
  return end;
}
コード例 #2
0
AbstractAssembler::AbstractAssembler(CodeBuffer* code) {
  if (code == NULL)  return;
  CodeSection* cs = code->insts();
  cs->clear_mark();   // new assembler kills old mark
  _code_section = cs;
  _code_begin  = cs->start();
  _code_limit  = cs->limit();
  _code_pos    = cs->end();
  _oop_recorder= code->oop_recorder();
  if (_code_begin == NULL)  {
    vm_exit_out_of_memory1(0, "CodeCache: no room for %s", code->name());
  }
}