// 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; }
inline void AbstractAssembler::sync() { CodeSection* cs = code_section(); guarantee(cs->start() == _code_begin, "must not shift code buffer"); cs->set_end(_code_pos); }