mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-16 09:04:41 +02:00
8301498: Replace NULL with nullptr in cpu/x86
Reviewed-by: dholmes, kvn
This commit is contained in:
parent
ddf1e34c1a
commit
4154a980ca
54 changed files with 656 additions and 656 deletions
|
@ -214,7 +214,7 @@ void Assembler::init_attributes(void) {
|
|||
_legacy_mode_vl = (VM_Version::supports_avx512vl() == false);
|
||||
_legacy_mode_vlbw = (VM_Version::supports_avx512vlbw() == false);
|
||||
NOT_LP64(_is_managed = false;)
|
||||
_attributes = NULL;
|
||||
_attributes = nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
@ -264,7 +264,7 @@ void Assembler::emit_data(jint data, relocInfo::relocType rtype, int format) {
|
|||
|
||||
void Assembler::emit_data(jint data, RelocationHolder const& rspec, int format) {
|
||||
assert(imm_operand == 0, "default format must be immediate in this file");
|
||||
assert(inst_mark() != NULL, "must be inside InstructionMark");
|
||||
assert(inst_mark() != nullptr, "must be inside InstructionMark");
|
||||
if (rspec.type() != relocInfo::none) {
|
||||
#ifdef ASSERT
|
||||
check_relocation(rspec, format);
|
||||
|
@ -684,7 +684,7 @@ void Assembler::emit_operand_helper(int reg_enc, int base_enc, int index_enc,
|
|||
// disp was created by converting the target address minus the pc
|
||||
// at the start of the instruction. That needs more correction here.
|
||||
// intptr_t disp = target - next_ip;
|
||||
assert(inst_mark() != NULL, "must be inside InstructionMark");
|
||||
assert(inst_mark() != nullptr, "must be inside InstructionMark");
|
||||
address next_ip = pc() + sizeof(int32_t) + post_addr_length;
|
||||
int64_t adjusted = disp;
|
||||
// Do rip-rel adjustment for 64bit
|
||||
|
@ -1234,7 +1234,7 @@ address Assembler::locate_next_instruction(address inst) {
|
|||
#ifdef ASSERT
|
||||
void Assembler::check_relocation(RelocationHolder const& rspec, int format) {
|
||||
address inst = inst_mark();
|
||||
assert(inst != NULL && inst < pc(), "must point to beginning of instruction");
|
||||
assert(inst != nullptr && inst < pc(), "must point to beginning of instruction");
|
||||
address opnd;
|
||||
|
||||
Relocation* r = rspec.reloc();
|
||||
|
@ -1690,8 +1690,8 @@ void Assembler::call_literal(address entry, RelocationHolder const& rspec) {
|
|||
InstructionMark im(this);
|
||||
emit_int8((unsigned char)0xE8);
|
||||
intptr_t disp = entry - (pc() + sizeof(int32_t));
|
||||
// Entry is NULL in case of a scratch emit.
|
||||
assert(entry == NULL || is_simm32(disp), "disp=" INTPTR_FORMAT " must be 32bit offset (call2)", disp);
|
||||
// Entry is null in case of a scratch emit.
|
||||
assert(entry == nullptr || is_simm32(disp), "disp=" INTPTR_FORMAT " must be 32bit offset (call2)", disp);
|
||||
// Technically, should use call32_operand, but this format is
|
||||
// implied by the fact that we're emitting a call instruction.
|
||||
|
||||
|
@ -2404,7 +2404,7 @@ void Assembler::jcc(Condition cc, Label& L, bool maybe_short) {
|
|||
assert((0 <= cc) && (cc < 16), "illegal cc");
|
||||
if (L.is_bound()) {
|
||||
address dst = target(L);
|
||||
assert(dst != NULL, "jcc most probably wrong");
|
||||
assert(dst != nullptr, "jcc most probably wrong");
|
||||
|
||||
const int short_size = 2;
|
||||
const int long_size = 6;
|
||||
|
@ -2462,7 +2462,7 @@ void Assembler::jmp(Address adr) {
|
|||
void Assembler::jmp(Label& L, bool maybe_short) {
|
||||
if (L.is_bound()) {
|
||||
address entry = target(L);
|
||||
assert(entry != NULL, "jmp most probably wrong");
|
||||
assert(entry != nullptr, "jmp most probably wrong");
|
||||
InstructionMark im(this);
|
||||
const int short_size = 2;
|
||||
const int long_size = 5;
|
||||
|
@ -2493,7 +2493,7 @@ void Assembler::jmp(Register entry) {
|
|||
void Assembler::jmp_literal(address dest, RelocationHolder const& rspec) {
|
||||
InstructionMark im(this);
|
||||
emit_int8((unsigned char)0xE9);
|
||||
assert(dest != NULL, "must have a target");
|
||||
assert(dest != nullptr, "must have a target");
|
||||
intptr_t disp = dest - (pc() + sizeof(int32_t));
|
||||
assert(is_simm32(disp), "must be 32bit offset (jmp)");
|
||||
emit_data(disp, rspec, call32_operand);
|
||||
|
@ -2503,7 +2503,7 @@ void Assembler::jmpb_0(Label& L, const char* file, int line) {
|
|||
if (L.is_bound()) {
|
||||
const int short_size = 2;
|
||||
address entry = target(L);
|
||||
assert(entry != NULL, "jmp most probably wrong");
|
||||
assert(entry != nullptr, "jmp most probably wrong");
|
||||
#ifdef ASSERT
|
||||
intptr_t dist = (intptr_t)entry - ((intptr_t)pc() + short_size);
|
||||
intptr_t delta = short_branch_delta();
|
||||
|
@ -6341,7 +6341,7 @@ void Assembler::xbegin(Label& abort, relocInfo::relocType rtype) {
|
|||
relocate(rtype);
|
||||
if (abort.is_bound()) {
|
||||
address entry = target(abort);
|
||||
assert(entry != NULL, "abort entry NULL");
|
||||
assert(entry != nullptr, "abort entry null");
|
||||
intptr_t offset = entry - pc();
|
||||
emit_int16((unsigned char)0xC7, (unsigned char)0xF8);
|
||||
emit_int32(offset - 6); // 2 opcode + 4 address
|
||||
|
@ -12495,7 +12495,7 @@ void Assembler::emit_data64(jlong data,
|
|||
int format) {
|
||||
assert(imm_operand == 0, "default format must be immediate in this file");
|
||||
assert(imm_operand == format, "must be immediate");
|
||||
assert(inst_mark() != NULL, "must be inside InstructionMark");
|
||||
assert(inst_mark() != nullptr, "must be inside InstructionMark");
|
||||
// Do not use AbstractAssembler::relocate, which is not intended for
|
||||
// embedded words. Instead, relocate to the enclosing instruction.
|
||||
code_section()->relocate(inst_mark(), rspec, format);
|
||||
|
@ -13521,13 +13521,13 @@ void Assembler::popq(Register dst) {
|
|||
// and copying it out on subsequent invocations can thus be beneficial
|
||||
static bool precomputed = false;
|
||||
|
||||
static u_char* popa_code = NULL;
|
||||
static u_char* popa_code = nullptr;
|
||||
static int popa_len = 0;
|
||||
|
||||
static u_char* pusha_code = NULL;
|
||||
static u_char* pusha_code = nullptr;
|
||||
static int pusha_len = 0;
|
||||
|
||||
static u_char* vzup_code = NULL;
|
||||
static u_char* vzup_code = nullptr;
|
||||
static int vzup_len = 0;
|
||||
|
||||
void Assembler::precompute_instructions() {
|
||||
|
@ -13574,7 +13574,7 @@ void Assembler::precompute_instructions() {
|
|||
}
|
||||
|
||||
static void emit_copy(CodeSection* code_section, u_char* src, int src_len) {
|
||||
assert(src != NULL, "code to copy must have been pre-computed");
|
||||
assert(src != nullptr, "code to copy must have been pre-computed");
|
||||
assert(code_section->limit() - code_section->end() > src_len, "code buffer not large enough");
|
||||
address end = code_section->end();
|
||||
memcpy(end, src, src_len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue