8300244: Replace NULL with nullptr in share/interpreter/

Reviewed-by: coleenp, dholmes
This commit is contained in:
Johan Sjölen 2023-01-25 10:31:51 +00:00
parent 71107f4648
commit a5d8e12872
25 changed files with 553 additions and 553 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -83,12 +83,12 @@ void AbstractInterpreter::print() {
//------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------
// Implementation of interpreter // Implementation of interpreter
StubQueue* AbstractInterpreter::_code = NULL; StubQueue* AbstractInterpreter::_code = nullptr;
bool AbstractInterpreter::_notice_safepoints = false; bool AbstractInterpreter::_notice_safepoints = false;
address AbstractInterpreter::_rethrow_exception_entry = NULL; address AbstractInterpreter::_rethrow_exception_entry = nullptr;
address AbstractInterpreter::_native_entry_begin = NULL; address AbstractInterpreter::_native_entry_begin = nullptr;
address AbstractInterpreter::_native_entry_end = NULL; address AbstractInterpreter::_native_entry_end = nullptr;
address AbstractInterpreter::_slow_signature_handler; address AbstractInterpreter::_slow_signature_handler;
address AbstractInterpreter::_entry_table [AbstractInterpreter::number_of_method_entries]; address AbstractInterpreter::_entry_table [AbstractInterpreter::number_of_method_entries];
address AbstractInterpreter::_native_abi_to_tosca [AbstractInterpreter::number_of_result_handlers]; address AbstractInterpreter::_native_abi_to_tosca [AbstractInterpreter::number_of_result_handlers];
@ -97,7 +97,7 @@ address AbstractInterpreter::_native_abi_to_tosca [AbstractInterpreter::nu
// Generation of complete interpreter // Generation of complete interpreter
AbstractInterpreterGenerator::AbstractInterpreterGenerator() { AbstractInterpreterGenerator::AbstractInterpreterGenerator() {
_masm = NULL; _masm = nullptr;
} }
@ -231,7 +231,7 @@ bool AbstractInterpreter::is_not_reached(const methodHandle& method, int bci) {
int method_index = invoke_bc.get_index_u2_cpcache(code); int method_index = invoke_bc.get_index_u2_cpcache(code);
constantPoolHandle cp(Thread::current(), cpool); constantPoolHandle cp(Thread::current(), cpool);
Method* resolved_method = ConstantPool::method_at_if_loaded(cp, method_index); Method* resolved_method = ConstantPool::method_at_if_loaded(cp, method_index);
return (resolved_method == NULL); return (resolved_method == nullptr);
} }
default: ShouldNotReachHere(); default: ShouldNotReachHere();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -168,8 +168,8 @@ class AbstractInterpreter: AllStatic {
// Runtime support // Runtime support
// length = invoke bytecode length (to advance to next bytecode) // length = invoke bytecode length (to advance to next bytecode)
static address deopt_entry(TosState state, int length) { ShouldNotReachHere(); return NULL; } static address deopt_entry(TosState state, int length) { ShouldNotReachHere(); return nullptr; }
static address return_entry(TosState state, int length, Bytecodes::Code code) { ShouldNotReachHere(); return NULL; } static address return_entry(TosState state, int length, Bytecodes::Code code) { ShouldNotReachHere(); return nullptr; }
static address rethrow_exception_entry() { return _rethrow_exception_entry; } static address rethrow_exception_entry() { return _rethrow_exception_entry; }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -188,9 +188,9 @@ void BootstrapInfo::resolve_args(TRAPS) {
objArrayOop args_oop = oopFactory::new_objArray(vmClasses::Object_klass(), _argc, CHECK); objArrayOop args_oop = oopFactory::new_objArray(vmClasses::Object_klass(), _argc, CHECK);
objArrayHandle args(THREAD, args_oop); objArrayHandle args(THREAD, args_oop);
_pool->copy_bootstrap_arguments_at(_bss_index, 0, _argc, args, 0, true, Handle(), CHECK); _pool->copy_bootstrap_arguments_at(_bss_index, 0, _argc, args, 0, true, Handle(), CHECK);
oop arg_oop = ((_argc == 1) ? args->obj_at(0) : (oop)NULL); oop arg_oop = ((_argc == 1) ? args->obj_at(0) : (oop)nullptr);
// try to discard the singleton array // try to discard the singleton array
if (arg_oop != NULL && !arg_oop->is_array()) { if (arg_oop != nullptr && !arg_oop->is_array()) {
// JVM treats arrays and nulls specially in this position, // JVM treats arrays and nulls specially in this position,
// but other things are just single arguments // but other things are just single arguments
_arg_values = Handle(THREAD, arg_oop); _arg_values = Handle(THREAD, arg_oop);
@ -233,7 +233,7 @@ void BootstrapInfo::print_msg_on(outputStream* st, const char* msg) {
os::snprintf_checked(what, sizeof(what), "indy#%d", decode_indy_index()); os::snprintf_checked(what, sizeof(what), "indy#%d", decode_indy_index());
else else
os::snprintf_checked(what, sizeof(what), "condy"); os::snprintf_checked(what, sizeof(what), "condy");
bool have_msg = (msg != NULL && strlen(msg) > 0); bool have_msg = (msg != nullptr && strlen(msg) > 0);
st->print_cr("%s%sBootstrap in %s %s@CP[%d] %s:%s%s BSMS[%d] BSM@CP[%d]%s argc=%d%s", st->print_cr("%s%sBootstrap in %s %s@CP[%d] %s:%s%s BSMS[%d] BSM@CP[%d]%s argc=%d%s",
(have_msg ? msg : ""), (have_msg ? " " : ""), (have_msg ? msg : ""), (have_msg ? " " : ""),
caller()->name()->as_C_string(), caller()->name()->as_C_string(),
@ -276,7 +276,7 @@ void BootstrapInfo::print_msg_on(outputStream* st, const char* msg) {
int lines = 0; int lines = 0;
for (int i = 0; i < _argc; i++) { for (int i = 0; i < _argc; i++) {
oop x = static_args->obj_at(i); oop x = static_args->obj_at(i);
if (x != NULL) { if (x != nullptr) {
if (++lines > 6) { if (++lines > 6) {
st->print_cr(" resolved arg[%d]: ...", i); st->print_cr(" resolved arg[%d]: ...", i);
break; break;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -114,7 +114,7 @@ class BootstrapInfo : public StackObj {
} }
void print() { print_msg_on(tty); } void print() { print_msg_on(tty); }
void print_msg_on(outputStream* st, const char* msg = NULL); void print_msg_on(outputStream* st, const char* msg = nullptr);
}; };
#endif // SHARE_INTERPRETER_BOOTSTRAPINFO_HPP #endif // SHARE_INTERPRETER_BOOTSTRAPINFO_HPP

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -120,7 +120,7 @@ int Bytecode_tableswitch::dest_offset_at(int i) const {
void Bytecode_invoke::verify() const { void Bytecode_invoke::verify() const {
assert(is_valid(), "check invoke"); assert(is_valid(), "check invoke");
assert(cpcache() != NULL, "do not call this from verifier or rewriter"); assert(cpcache() != nullptr, "do not call this from verifier or rewriter");
} }
int Bytecode_invoke::size_of_parameters() const { int Bytecode_invoke::size_of_parameters() const {
@ -208,7 +208,7 @@ BasicType Bytecode_loadconstant::result_type() const {
} }
oop Bytecode_loadconstant::resolve_constant(TRAPS) const { oop Bytecode_loadconstant::resolve_constant(TRAPS) const {
assert(_method != NULL, "must supply method to resolve constant"); assert(_method != nullptr, "must supply method to resolve constant");
int index = raw_index(); int index = raw_index();
ConstantPool* constants = _method->constants(); ConstantPool* constants = _method->constants();
if (has_cache_index()) { if (has_cache_index()) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -56,10 +56,10 @@ class Bytecode: public StackObj {
public: public:
Bytecode(Method* method, address bcp): _bcp(bcp), _code(Bytecodes::code_at(method, addr_at(0))) { Bytecode(Method* method, address bcp): _bcp(bcp), _code(Bytecodes::code_at(method, addr_at(0))) {
assert(method != NULL, "this form requires a valid Method*"); assert(method != nullptr, "this form requires a valid Method*");
} }
// Defined in ciStreams.hpp // Defined in ciStreams.hpp
inline Bytecode(const ciBytecodeStream* stream, address bcp = NULL); inline Bytecode(const ciBytecodeStream* stream, address bcp = nullptr);
// Attributes // Attributes
address bcp() const { return _bcp; } address bcp() const { return _bcp; }
@ -323,7 +323,7 @@ class Bytecode_loadconstant: public Bytecode {
Bytecode_loadconstant(const methodHandle& method, int bci): Bytecode(method(), method->bcp_from(bci)), _method(method()) { verify(); } Bytecode_loadconstant(const methodHandle& method, int bci): Bytecode(method(), method->bcp_from(bci)), _method(method()) { verify(); }
void verify() const { void verify() const {
assert(_method != NULL, "must supply method"); assert(_method != nullptr, "must supply method");
Bytecodes::Code stdc = Bytecodes::java_code(code()); Bytecodes::Code stdc = Bytecodes::java_code(code());
assert(stdc == Bytecodes::_ldc || assert(stdc == Bytecodes::_ldc ||
stdc == Bytecodes::_ldc_w || stdc == Bytecodes::_ldc_w ||

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -201,8 +201,8 @@ void print_symbol(Symbol* sym, outputStream* st) {
} }
void print_oop(oop value, outputStream* st) { void print_oop(oop value, outputStream* st) {
if (value == NULL) { if (value == nullptr) {
st->print_cr(" NULL"); st->print_cr(" null");
} else if (java_lang_String::is_instance(value)) { } else if (java_lang_String::is_instance(value)) {
char buf[40]; char buf[40];
int len = java_lang_String::utf8_length(value); int len = java_lang_String::utf8_length(value);
@ -256,7 +256,7 @@ bool BytecodePrinter::check_cp_cache_index(int i, int& cp_index, outputStream* s
ConstantPoolCache* cache = constants->cache(); ConstantPoolCache* cache = constants->cache();
// If rewriter hasn't run, the index is the cp_index // If rewriter hasn't run, the index is the cp_index
if (cache == NULL) { if (cache == nullptr) {
cp_index = i; cp_index = i;
return true; return true;
} }
@ -503,7 +503,7 @@ void BytecodePrinter::print_attributes(int bci, outputStream* st) {
case Bytecodes::_newarray: { case Bytecodes::_newarray: {
BasicType atype = (BasicType)get_index_u1(); BasicType atype = (BasicType)get_index_u1();
const char* str = type2name(atype); const char* str = type2name(atype);
if (str == NULL || is_reference_type(atype)) { if (str == nullptr || is_reference_type(atype)) {
assert(false, "Unidentified basic type"); assert(false, "Unidentified basic type");
} }
st->print_cr(" %s", str); st->print_cr(" %s", str);
@ -649,9 +649,9 @@ void BytecodePrinter::print_attributes(int bci, outputStream* st) {
void BytecodePrinter::bytecode_epilog(int bci, outputStream* st) { void BytecodePrinter::bytecode_epilog(int bci, outputStream* st) {
MethodData* mdo = method()->method_data(); MethodData* mdo = method()->method_data();
if (mdo != NULL) { if (mdo != nullptr) {
ProfileData* data = mdo->bci_to_data(bci); ProfileData* data = mdo->bci_to_data(bci);
if (data != NULL) { if (data != nullptr) {
st->print(" %d", mdo->dp_to_di(data->dp())); st->print(" %d", mdo->dp_to_di(data->dp()));
st->fill_to(6); st->fill_to(6);
data->print_data_on(st, mdo); data->print_data_on(st, mdo);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019 SAP SE. All rights reserved. * Copyright (c) 2019 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
@ -193,7 +193,7 @@ class ExceptionMessageBuilder : public StackObj {
int do_instruction(int bci); int do_instruction(int bci);
bool print_NPE_cause0(outputStream *os, int bci, int slot, int max_detail, bool print_NPE_cause0(outputStream *os, int bci, int slot, int max_detail,
bool inner_expr = false, const char *prefix = NULL); bool inner_expr = false, const char *prefix = nullptr);
public: public:
@ -469,7 +469,7 @@ ExceptionMessageBuilder::ExceptionMessageBuilder(Method* method, int bci) :
_stacks = new GrowableArray<SimulatedOperandStack*> (len + 1); _stacks = new GrowableArray<SimulatedOperandStack*> (len + 1);
for (int i = 0; i <= len; ++i) { for (int i = 0; i <= len; ++i) {
_stacks->push(NULL); _stacks->push(nullptr);
} }
// Initialize stack a bci 0. // Initialize stack a bci 0.
@ -481,7 +481,7 @@ ExceptionMessageBuilder::ExceptionMessageBuilder(Method* method, int bci) :
for (int i = 0; i < const_method->exception_table_length(); ++i) { for (int i = 0; i < const_method->exception_table_length(); ++i) {
u2 index = et[i].handler_pc; u2 index = et[i].handler_pc;
if (_stacks->at(index) == NULL) { if (_stacks->at(index) == nullptr) {
_stacks->at_put(index, new SimulatedOperandStack()); _stacks->at_put(index, new SimulatedOperandStack());
_stacks->at(index)->push(index, T_OBJECT); _stacks->at(index)->push(index, T_OBJECT);
} }
@ -499,7 +499,7 @@ ExceptionMessageBuilder::ExceptionMessageBuilder(Method* method, int bci) :
i += do_instruction(i); i += do_instruction(i);
// If we want the data only for a certain bci, we can possibly end early. // If we want the data only for a certain bci, we can possibly end early.
if ((bci == i) && (_stacks->at(i) != NULL)) { if ((bci == i) && (_stacks->at(i) != nullptr)) {
_all_processed = true; _all_processed = true;
break; break;
} }
@ -512,7 +512,7 @@ ExceptionMessageBuilder::ExceptionMessageBuilder(Method* method, int bci) :
} }
ExceptionMessageBuilder::~ExceptionMessageBuilder() { ExceptionMessageBuilder::~ExceptionMessageBuilder() {
if (_stacks != NULL) { if (_stacks != nullptr) {
for (int i = 0; i < _stacks->length(); ++i) { for (int i = 0; i < _stacks->length(); ++i) {
delete _stacks->at(i); delete _stacks->at(i);
} }
@ -522,7 +522,7 @@ ExceptionMessageBuilder::~ExceptionMessageBuilder() {
void ExceptionMessageBuilder::merge(int bci, SimulatedOperandStack* stack) { void ExceptionMessageBuilder::merge(int bci, SimulatedOperandStack* stack) {
assert(stack != _stacks->at(bci), "Cannot merge itself"); assert(stack != _stacks->at(bci), "Cannot merge itself");
if (_stacks->at(bci) != NULL) { if (_stacks->at(bci) != nullptr) {
stack->merge(*_stacks->at(bci)); stack->merge(*_stacks->at(bci));
} else { } else {
// Got a new stack, so count the entries. // Got a new stack, so count the entries.
@ -542,7 +542,7 @@ int ExceptionMessageBuilder::do_instruction(int bci) {
int len = Bytecodes::java_length_at(_method, code_base + bci); int len = Bytecodes::java_length_at(_method, code_base + bci);
// If we have no stack for this bci, we cannot process the bytecode now. // If we have no stack for this bci, we cannot process the bytecode now.
if (_stacks->at(bci) == NULL) { if (_stacks->at(bci) == nullptr) {
_all_processed = false; _all_processed = false;
return len; return len;
} }
@ -1066,7 +1066,7 @@ int ExceptionMessageBuilder::do_instruction(int bci) {
// Put new stack to the next instruction, if we might reach it from // Put new stack to the next instruction, if we might reach it from
// this bci. // this bci.
if (!flow_ended) { if (!flow_ended) {
if (_stacks->at(bci + len) == NULL) { if (_stacks->at(bci + len) == nullptr) {
_added_one = true; _added_one = true;
} }
merge(bci + len, stack); merge(bci + len, stack);
@ -1074,7 +1074,7 @@ int ExceptionMessageBuilder::do_instruction(int bci) {
// Put the stack to the branch target too. // Put the stack to the branch target too.
if (dest_bci != -1) { if (dest_bci != -1) {
if (_stacks->at(dest_bci) == NULL) { if (_stacks->at(dest_bci) == nullptr) {
_added_one = true; _added_one = true;
} }
merge(dest_bci, stack); merge(dest_bci, stack);
@ -1082,7 +1082,7 @@ int ExceptionMessageBuilder::do_instruction(int bci) {
// If we have more than one branch target, process these too. // If we have more than one branch target, process these too.
for (int64_t i = 0; i < dests.length(); ++i) { for (int64_t i = 0; i < dests.length(); ++i) {
if (_stacks->at(dests.at(i)) == NULL) { if (_stacks->at(dests.at(i)) == nullptr) {
_added_one = true; _added_one = true;
} }
merge(dests.at(i), stack); merge(dests.at(i), stack);
@ -1200,7 +1200,7 @@ bool ExceptionMessageBuilder::print_NPE_cause0(outputStream* os, int bci, int sl
return false; return false;
} }
if (_stacks->at(bci) == NULL) { if (_stacks->at(bci) == nullptr) {
return false; return false;
} }
@ -1228,7 +1228,7 @@ bool ExceptionMessageBuilder::print_NPE_cause0(outputStream* os, int bci, int sl
} }
if (max_detail == _max_cause_detail && if (max_detail == _max_cause_detail &&
prefix != NULL && prefix != nullptr &&
code != Bytecodes::_invokevirtual && code != Bytecodes::_invokevirtual &&
code != Bytecodes::_invokespecial && code != Bytecodes::_invokespecial &&
code != Bytecodes::_invokestatic && code != Bytecodes::_invokestatic &&

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -72,7 +72,7 @@ Bytecodes::Code Bytecodes::code_at(Method* method, int bci) {
} }
Bytecodes::Code Bytecodes::non_breakpoint_code_at(const Method* method, address bcp) { Bytecodes::Code Bytecodes::non_breakpoint_code_at(const Method* method, address bcp) {
assert(method != NULL, "must have the method for breakpoint conversion"); assert(method != nullptr, "must have the method for breakpoint conversion");
assert(method->contains(bcp), "must be valid bcp in method"); assert(method->contains(bcp), "must be valid bcp in method");
return method->orig_bytecode_at(method->bci_from(bcp)); return method->orig_bytecode_at(method->bci_from(bcp));
} }
@ -80,13 +80,13 @@ Bytecodes::Code Bytecodes::non_breakpoint_code_at(const Method* method, address
int Bytecodes::special_length_at(Bytecodes::Code code, address bcp, address end) { int Bytecodes::special_length_at(Bytecodes::Code code, address bcp, address end) {
switch (code) { switch (code) {
case _wide: case _wide:
if (end != NULL && bcp + 1 >= end) { if (end != nullptr && bcp + 1 >= end) {
return -1; // don't read past end of code buffer return -1; // don't read past end of code buffer
} }
return wide_length_for(cast(*(bcp + 1))); return wide_length_for(cast(*(bcp + 1)));
case _tableswitch: case _tableswitch:
{ address aligned_bcp = align_up(bcp + 1, jintSize); { address aligned_bcp = align_up(bcp + 1, jintSize);
if (end != NULL && aligned_bcp + 3*jintSize >= end) { if (end != nullptr && aligned_bcp + 3*jintSize >= end) {
return -1; // don't read past end of code buffer return -1; // don't read past end of code buffer
} }
jlong lo = (jint)Bytes::get_Java_u4(aligned_bcp + 1*jintSize); jlong lo = (jint)Bytes::get_Java_u4(aligned_bcp + 1*jintSize);
@ -101,7 +101,7 @@ int Bytecodes::special_length_at(Bytecodes::Code code, address bcp, address end)
case _fast_binaryswitch: // fall through case _fast_binaryswitch: // fall through
case _fast_linearswitch: case _fast_linearswitch:
{ address aligned_bcp = align_up(bcp + 1, jintSize); { address aligned_bcp = align_up(bcp + 1, jintSize);
if (end != NULL && aligned_bcp + 2*jintSize >= end) { if (end != nullptr && aligned_bcp + 2*jintSize >= end) {
return -1; // don't read past end of code buffer return -1; // don't read past end of code buffer
} }
jlong npairs = (jint)Bytes::get_Java_u4(aligned_bcp + jintSize); jlong npairs = (jint)Bytes::get_Java_u4(aligned_bcp + jintSize);
@ -145,9 +145,9 @@ void Bytecodes::def(Code code, const char* name, const char* format, const char*
void Bytecodes::def(Code code, const char* name, const char* format, const char* wide_format, BasicType result_type, int depth, bool can_trap, Code java_code) { void Bytecodes::def(Code code, const char* name, const char* format, const char* wide_format, BasicType result_type, int depth, bool can_trap, Code java_code) {
assert(wide_format == NULL || format != NULL, "short form must exist if there's a wide form"); assert(wide_format == nullptr || format != nullptr, "short form must exist if there's a wide form");
int len = (format != NULL ? (int) strlen(format) : 0); int len = (format != nullptr ? (int) strlen(format) : 0);
int wlen = (wide_format != NULL ? (int) strlen(wide_format) : 0); int wlen = (wide_format != nullptr ? (int) strlen(wide_format) : 0);
_name [code] = name; _name [code] = name;
_result_type [code] = result_type; _result_type [code] = result_type;
_depth [code] = depth; _depth [code] = depth;
@ -158,8 +158,8 @@ void Bytecodes::def(Code code, const char* name, const char* format, const char*
if (java_code != code) bc_flags |= _bc_can_rewrite; if (java_code != code) bc_flags |= _bc_can_rewrite;
_flags[(u1)code+0*(1<<BitsPerByte)] = compute_flags(format, bc_flags); _flags[(u1)code+0*(1<<BitsPerByte)] = compute_flags(format, bc_flags);
_flags[(u1)code+1*(1<<BitsPerByte)] = compute_flags(wide_format, bc_flags); _flags[(u1)code+1*(1<<BitsPerByte)] = compute_flags(wide_format, bc_flags);
assert(is_defined(code) == (format != NULL), ""); assert(is_defined(code) == (format != nullptr), "");
assert(wide_is_defined(code) == (wide_format != NULL), ""); assert(wide_is_defined(code) == (wide_format != nullptr), "");
assert(length_for(code) == len, ""); assert(length_for(code) == len, "");
assert(wide_length_for(code) == wlen, ""); assert(wide_length_for(code) == wlen, "");
} }
@ -184,7 +184,7 @@ void Bytecodes::def(Code code, const char* name, const char* format, const char*
// Note: For bytecodes with variable length, the format string is the empty string. // Note: For bytecodes with variable length, the format string is the empty string.
int Bytecodes::compute_flags(const char* format, int more_flags) { int Bytecodes::compute_flags(const char* format, int more_flags) {
if (format == NULL) return 0; // not even more_flags if (format == nullptr) return 0; // not even more_flags
int flags = more_flags; int flags = more_flags;
const char* fp = format; const char* fp = format;
switch (*fp) { switch (*fp) {
@ -263,7 +263,7 @@ void Bytecodes::initialize() {
// (such as {}) so we can do additional consistency checks and init- // (such as {}) so we can do additional consistency checks and init-
// code is independent of actual bytecode numbering. // code is independent of actual bytecode numbering.
// //
// Note 1: NULL for the format string means the bytecode doesn't exist // Note 1: nullptr for the format string means the bytecode doesn't exist
// in that form. // in that form.
// //
// Note 2: The result type is T_ILLEGAL for bytecodes where the top of stack // Note 2: The result type is T_ILLEGAL for bytecodes where the top of stack
@ -271,261 +271,261 @@ void Bytecodes::initialize() {
// Java bytecodes // Java bytecodes
// bytecode bytecode name format wide f. result tp stk traps // bytecode bytecode name format wide f. result tp stk traps
def(_nop , "nop" , "b" , NULL , T_VOID , 0, false); def(_nop , "nop" , "b" , nullptr , T_VOID , 0, false);
def(_aconst_null , "aconst_null" , "b" , NULL , T_OBJECT , 1, false); def(_aconst_null , "aconst_null" , "b" , nullptr , T_OBJECT , 1, false);
def(_iconst_m1 , "iconst_m1" , "b" , NULL , T_INT , 1, false); def(_iconst_m1 , "iconst_m1" , "b" , nullptr , T_INT , 1, false);
def(_iconst_0 , "iconst_0" , "b" , NULL , T_INT , 1, false); def(_iconst_0 , "iconst_0" , "b" , nullptr , T_INT , 1, false);
def(_iconst_1 , "iconst_1" , "b" , NULL , T_INT , 1, false); def(_iconst_1 , "iconst_1" , "b" , nullptr , T_INT , 1, false);
def(_iconst_2 , "iconst_2" , "b" , NULL , T_INT , 1, false); def(_iconst_2 , "iconst_2" , "b" , nullptr , T_INT , 1, false);
def(_iconst_3 , "iconst_3" , "b" , NULL , T_INT , 1, false); def(_iconst_3 , "iconst_3" , "b" , nullptr , T_INT , 1, false);
def(_iconst_4 , "iconst_4" , "b" , NULL , T_INT , 1, false); def(_iconst_4 , "iconst_4" , "b" , nullptr , T_INT , 1, false);
def(_iconst_5 , "iconst_5" , "b" , NULL , T_INT , 1, false); def(_iconst_5 , "iconst_5" , "b" , nullptr , T_INT , 1, false);
def(_lconst_0 , "lconst_0" , "b" , NULL , T_LONG , 2, false); def(_lconst_0 , "lconst_0" , "b" , nullptr , T_LONG , 2, false);
def(_lconst_1 , "lconst_1" , "b" , NULL , T_LONG , 2, false); def(_lconst_1 , "lconst_1" , "b" , nullptr , T_LONG , 2, false);
def(_fconst_0 , "fconst_0" , "b" , NULL , T_FLOAT , 1, false); def(_fconst_0 , "fconst_0" , "b" , nullptr , T_FLOAT , 1, false);
def(_fconst_1 , "fconst_1" , "b" , NULL , T_FLOAT , 1, false); def(_fconst_1 , "fconst_1" , "b" , nullptr , T_FLOAT , 1, false);
def(_fconst_2 , "fconst_2" , "b" , NULL , T_FLOAT , 1, false); def(_fconst_2 , "fconst_2" , "b" , nullptr , T_FLOAT , 1, false);
def(_dconst_0 , "dconst_0" , "b" , NULL , T_DOUBLE , 2, false); def(_dconst_0 , "dconst_0" , "b" , nullptr , T_DOUBLE , 2, false);
def(_dconst_1 , "dconst_1" , "b" , NULL , T_DOUBLE , 2, false); def(_dconst_1 , "dconst_1" , "b" , nullptr , T_DOUBLE , 2, false);
def(_bipush , "bipush" , "bc" , NULL , T_INT , 1, false); def(_bipush , "bipush" , "bc" , nullptr , T_INT , 1, false);
def(_sipush , "sipush" , "bcc" , NULL , T_INT , 1, false); def(_sipush , "sipush" , "bcc" , nullptr , T_INT , 1, false);
def(_ldc , "ldc" , "bk" , NULL , T_ILLEGAL, 1, true ); def(_ldc , "ldc" , "bk" , nullptr , T_ILLEGAL, 1, true );
def(_ldc_w , "ldc_w" , "bkk" , NULL , T_ILLEGAL, 1, true ); def(_ldc_w , "ldc_w" , "bkk" , nullptr , T_ILLEGAL, 1, true );
def(_ldc2_w , "ldc2_w" , "bkk" , NULL , T_ILLEGAL, 2, true ); def(_ldc2_w , "ldc2_w" , "bkk" , nullptr , T_ILLEGAL, 2, true );
def(_iload , "iload" , "bi" , "wbii" , T_INT , 1, false); def(_iload , "iload" , "bi" , "wbii" , T_INT , 1, false);
def(_lload , "lload" , "bi" , "wbii" , T_LONG , 2, false); def(_lload , "lload" , "bi" , "wbii" , T_LONG , 2, false);
def(_fload , "fload" , "bi" , "wbii" , T_FLOAT , 1, false); def(_fload , "fload" , "bi" , "wbii" , T_FLOAT , 1, false);
def(_dload , "dload" , "bi" , "wbii" , T_DOUBLE , 2, false); def(_dload , "dload" , "bi" , "wbii" , T_DOUBLE , 2, false);
def(_aload , "aload" , "bi" , "wbii" , T_OBJECT , 1, false); def(_aload , "aload" , "bi" , "wbii" , T_OBJECT , 1, false);
def(_iload_0 , "iload_0" , "b" , NULL , T_INT , 1, false); def(_iload_0 , "iload_0" , "b" , nullptr , T_INT , 1, false);
def(_iload_1 , "iload_1" , "b" , NULL , T_INT , 1, false); def(_iload_1 , "iload_1" , "b" , nullptr , T_INT , 1, false);
def(_iload_2 , "iload_2" , "b" , NULL , T_INT , 1, false); def(_iload_2 , "iload_2" , "b" , nullptr , T_INT , 1, false);
def(_iload_3 , "iload_3" , "b" , NULL , T_INT , 1, false); def(_iload_3 , "iload_3" , "b" , nullptr , T_INT , 1, false);
def(_lload_0 , "lload_0" , "b" , NULL , T_LONG , 2, false); def(_lload_0 , "lload_0" , "b" , nullptr , T_LONG , 2, false);
def(_lload_1 , "lload_1" , "b" , NULL , T_LONG , 2, false); def(_lload_1 , "lload_1" , "b" , nullptr , T_LONG , 2, false);
def(_lload_2 , "lload_2" , "b" , NULL , T_LONG , 2, false); def(_lload_2 , "lload_2" , "b" , nullptr , T_LONG , 2, false);
def(_lload_3 , "lload_3" , "b" , NULL , T_LONG , 2, false); def(_lload_3 , "lload_3" , "b" , nullptr , T_LONG , 2, false);
def(_fload_0 , "fload_0" , "b" , NULL , T_FLOAT , 1, false); def(_fload_0 , "fload_0" , "b" , nullptr , T_FLOAT , 1, false);
def(_fload_1 , "fload_1" , "b" , NULL , T_FLOAT , 1, false); def(_fload_1 , "fload_1" , "b" , nullptr , T_FLOAT , 1, false);
def(_fload_2 , "fload_2" , "b" , NULL , T_FLOAT , 1, false); def(_fload_2 , "fload_2" , "b" , nullptr , T_FLOAT , 1, false);
def(_fload_3 , "fload_3" , "b" , NULL , T_FLOAT , 1, false); def(_fload_3 , "fload_3" , "b" , nullptr , T_FLOAT , 1, false);
def(_dload_0 , "dload_0" , "b" , NULL , T_DOUBLE , 2, false); def(_dload_0 , "dload_0" , "b" , nullptr , T_DOUBLE , 2, false);
def(_dload_1 , "dload_1" , "b" , NULL , T_DOUBLE , 2, false); def(_dload_1 , "dload_1" , "b" , nullptr , T_DOUBLE , 2, false);
def(_dload_2 , "dload_2" , "b" , NULL , T_DOUBLE , 2, false); def(_dload_2 , "dload_2" , "b" , nullptr , T_DOUBLE , 2, false);
def(_dload_3 , "dload_3" , "b" , NULL , T_DOUBLE , 2, false); def(_dload_3 , "dload_3" , "b" , nullptr , T_DOUBLE , 2, false);
def(_aload_0 , "aload_0" , "b" , NULL , T_OBJECT , 1, true ); // rewriting in interpreter def(_aload_0 , "aload_0" , "b" , nullptr , T_OBJECT , 1, true ); // rewriting in interpreter
def(_aload_1 , "aload_1" , "b" , NULL , T_OBJECT , 1, false); def(_aload_1 , "aload_1" , "b" , nullptr , T_OBJECT , 1, false);
def(_aload_2 , "aload_2" , "b" , NULL , T_OBJECT , 1, false); def(_aload_2 , "aload_2" , "b" , nullptr , T_OBJECT , 1, false);
def(_aload_3 , "aload_3" , "b" , NULL , T_OBJECT , 1, false); def(_aload_3 , "aload_3" , "b" , nullptr , T_OBJECT , 1, false);
def(_iaload , "iaload" , "b" , NULL , T_INT , -1, true ); def(_iaload , "iaload" , "b" , nullptr , T_INT , -1, true );
def(_laload , "laload" , "b" , NULL , T_LONG , 0, true ); def(_laload , "laload" , "b" , nullptr , T_LONG , 0, true );
def(_faload , "faload" , "b" , NULL , T_FLOAT , -1, true ); def(_faload , "faload" , "b" , nullptr , T_FLOAT , -1, true );
def(_daload , "daload" , "b" , NULL , T_DOUBLE , 0, true ); def(_daload , "daload" , "b" , nullptr , T_DOUBLE , 0, true );
def(_aaload , "aaload" , "b" , NULL , T_OBJECT , -1, true ); def(_aaload , "aaload" , "b" , nullptr , T_OBJECT , -1, true );
def(_baload , "baload" , "b" , NULL , T_INT , -1, true ); def(_baload , "baload" , "b" , nullptr , T_INT , -1, true );
def(_caload , "caload" , "b" , NULL , T_INT , -1, true ); def(_caload , "caload" , "b" , nullptr , T_INT , -1, true );
def(_saload , "saload" , "b" , NULL , T_INT , -1, true ); def(_saload , "saload" , "b" , nullptr , T_INT , -1, true );
def(_istore , "istore" , "bi" , "wbii" , T_VOID , -1, false); def(_istore , "istore" , "bi" , "wbii" , T_VOID , -1, false);
def(_lstore , "lstore" , "bi" , "wbii" , T_VOID , -2, false); def(_lstore , "lstore" , "bi" , "wbii" , T_VOID , -2, false);
def(_fstore , "fstore" , "bi" , "wbii" , T_VOID , -1, false); def(_fstore , "fstore" , "bi" , "wbii" , T_VOID , -1, false);
def(_dstore , "dstore" , "bi" , "wbii" , T_VOID , -2, false); def(_dstore , "dstore" , "bi" , "wbii" , T_VOID , -2, false);
def(_astore , "astore" , "bi" , "wbii" , T_VOID , -1, false); def(_astore , "astore" , "bi" , "wbii" , T_VOID , -1, false);
def(_istore_0 , "istore_0" , "b" , NULL , T_VOID , -1, false); def(_istore_0 , "istore_0" , "b" , nullptr , T_VOID , -1, false);
def(_istore_1 , "istore_1" , "b" , NULL , T_VOID , -1, false); def(_istore_1 , "istore_1" , "b" , nullptr , T_VOID , -1, false);
def(_istore_2 , "istore_2" , "b" , NULL , T_VOID , -1, false); def(_istore_2 , "istore_2" , "b" , nullptr , T_VOID , -1, false);
def(_istore_3 , "istore_3" , "b" , NULL , T_VOID , -1, false); def(_istore_3 , "istore_3" , "b" , nullptr , T_VOID , -1, false);
def(_lstore_0 , "lstore_0" , "b" , NULL , T_VOID , -2, false); def(_lstore_0 , "lstore_0" , "b" , nullptr , T_VOID , -2, false);
def(_lstore_1 , "lstore_1" , "b" , NULL , T_VOID , -2, false); def(_lstore_1 , "lstore_1" , "b" , nullptr , T_VOID , -2, false);
def(_lstore_2 , "lstore_2" , "b" , NULL , T_VOID , -2, false); def(_lstore_2 , "lstore_2" , "b" , nullptr , T_VOID , -2, false);
def(_lstore_3 , "lstore_3" , "b" , NULL , T_VOID , -2, false); def(_lstore_3 , "lstore_3" , "b" , nullptr , T_VOID , -2, false);
def(_fstore_0 , "fstore_0" , "b" , NULL , T_VOID , -1, false); def(_fstore_0 , "fstore_0" , "b" , nullptr , T_VOID , -1, false);
def(_fstore_1 , "fstore_1" , "b" , NULL , T_VOID , -1, false); def(_fstore_1 , "fstore_1" , "b" , nullptr , T_VOID , -1, false);
def(_fstore_2 , "fstore_2" , "b" , NULL , T_VOID , -1, false); def(_fstore_2 , "fstore_2" , "b" , nullptr , T_VOID , -1, false);
def(_fstore_3 , "fstore_3" , "b" , NULL , T_VOID , -1, false); def(_fstore_3 , "fstore_3" , "b" , nullptr , T_VOID , -1, false);
def(_dstore_0 , "dstore_0" , "b" , NULL , T_VOID , -2, false); def(_dstore_0 , "dstore_0" , "b" , nullptr , T_VOID , -2, false);
def(_dstore_1 , "dstore_1" , "b" , NULL , T_VOID , -2, false); def(_dstore_1 , "dstore_1" , "b" , nullptr , T_VOID , -2, false);
def(_dstore_2 , "dstore_2" , "b" , NULL , T_VOID , -2, false); def(_dstore_2 , "dstore_2" , "b" , nullptr , T_VOID , -2, false);
def(_dstore_3 , "dstore_3" , "b" , NULL , T_VOID , -2, false); def(_dstore_3 , "dstore_3" , "b" , nullptr , T_VOID , -2, false);
def(_astore_0 , "astore_0" , "b" , NULL , T_VOID , -1, false); def(_astore_0 , "astore_0" , "b" , nullptr , T_VOID , -1, false);
def(_astore_1 , "astore_1" , "b" , NULL , T_VOID , -1, false); def(_astore_1 , "astore_1" , "b" , nullptr , T_VOID , -1, false);
def(_astore_2 , "astore_2" , "b" , NULL , T_VOID , -1, false); def(_astore_2 , "astore_2" , "b" , nullptr , T_VOID , -1, false);
def(_astore_3 , "astore_3" , "b" , NULL , T_VOID , -1, false); def(_astore_3 , "astore_3" , "b" , nullptr , T_VOID , -1, false);
def(_iastore , "iastore" , "b" , NULL , T_VOID , -3, true ); def(_iastore , "iastore" , "b" , nullptr , T_VOID , -3, true );
def(_lastore , "lastore" , "b" , NULL , T_VOID , -4, true ); def(_lastore , "lastore" , "b" , nullptr , T_VOID , -4, true );
def(_fastore , "fastore" , "b" , NULL , T_VOID , -3, true ); def(_fastore , "fastore" , "b" , nullptr , T_VOID , -3, true );
def(_dastore , "dastore" , "b" , NULL , T_VOID , -4, true ); def(_dastore , "dastore" , "b" , nullptr , T_VOID , -4, true );
def(_aastore , "aastore" , "b" , NULL , T_VOID , -3, true ); def(_aastore , "aastore" , "b" , nullptr , T_VOID , -3, true );
def(_bastore , "bastore" , "b" , NULL , T_VOID , -3, true ); def(_bastore , "bastore" , "b" , nullptr , T_VOID , -3, true );
def(_castore , "castore" , "b" , NULL , T_VOID , -3, true ); def(_castore , "castore" , "b" , nullptr , T_VOID , -3, true );
def(_sastore , "sastore" , "b" , NULL , T_VOID , -3, true ); def(_sastore , "sastore" , "b" , nullptr , T_VOID , -3, true );
def(_pop , "pop" , "b" , NULL , T_VOID , -1, false); def(_pop , "pop" , "b" , nullptr , T_VOID , -1, false);
def(_pop2 , "pop2" , "b" , NULL , T_VOID , -2, false); def(_pop2 , "pop2" , "b" , nullptr , T_VOID , -2, false);
def(_dup , "dup" , "b" , NULL , T_VOID , 1, false); def(_dup , "dup" , "b" , nullptr , T_VOID , 1, false);
def(_dup_x1 , "dup_x1" , "b" , NULL , T_VOID , 1, false); def(_dup_x1 , "dup_x1" , "b" , nullptr , T_VOID , 1, false);
def(_dup_x2 , "dup_x2" , "b" , NULL , T_VOID , 1, false); def(_dup_x2 , "dup_x2" , "b" , nullptr , T_VOID , 1, false);
def(_dup2 , "dup2" , "b" , NULL , T_VOID , 2, false); def(_dup2 , "dup2" , "b" , nullptr , T_VOID , 2, false);
def(_dup2_x1 , "dup2_x1" , "b" , NULL , T_VOID , 2, false); def(_dup2_x1 , "dup2_x1" , "b" , nullptr , T_VOID , 2, false);
def(_dup2_x2 , "dup2_x2" , "b" , NULL , T_VOID , 2, false); def(_dup2_x2 , "dup2_x2" , "b" , nullptr , T_VOID , 2, false);
def(_swap , "swap" , "b" , NULL , T_VOID , 0, false); def(_swap , "swap" , "b" , nullptr , T_VOID , 0, false);
def(_iadd , "iadd" , "b" , NULL , T_INT , -1, false); def(_iadd , "iadd" , "b" , nullptr , T_INT , -1, false);
def(_ladd , "ladd" , "b" , NULL , T_LONG , -2, false); def(_ladd , "ladd" , "b" , nullptr , T_LONG , -2, false);
def(_fadd , "fadd" , "b" , NULL , T_FLOAT , -1, false); def(_fadd , "fadd" , "b" , nullptr , T_FLOAT , -1, false);
def(_dadd , "dadd" , "b" , NULL , T_DOUBLE , -2, false); def(_dadd , "dadd" , "b" , nullptr , T_DOUBLE , -2, false);
def(_isub , "isub" , "b" , NULL , T_INT , -1, false); def(_isub , "isub" , "b" , nullptr , T_INT , -1, false);
def(_lsub , "lsub" , "b" , NULL , T_LONG , -2, false); def(_lsub , "lsub" , "b" , nullptr , T_LONG , -2, false);
def(_fsub , "fsub" , "b" , NULL , T_FLOAT , -1, false); def(_fsub , "fsub" , "b" , nullptr , T_FLOAT , -1, false);
def(_dsub , "dsub" , "b" , NULL , T_DOUBLE , -2, false); def(_dsub , "dsub" , "b" , nullptr , T_DOUBLE , -2, false);
def(_imul , "imul" , "b" , NULL , T_INT , -1, false); def(_imul , "imul" , "b" , nullptr , T_INT , -1, false);
def(_lmul , "lmul" , "b" , NULL , T_LONG , -2, false); def(_lmul , "lmul" , "b" , nullptr , T_LONG , -2, false);
def(_fmul , "fmul" , "b" , NULL , T_FLOAT , -1, false); def(_fmul , "fmul" , "b" , nullptr , T_FLOAT , -1, false);
def(_dmul , "dmul" , "b" , NULL , T_DOUBLE , -2, false); def(_dmul , "dmul" , "b" , nullptr , T_DOUBLE , -2, false);
def(_idiv , "idiv" , "b" , NULL , T_INT , -1, true ); def(_idiv , "idiv" , "b" , nullptr , T_INT , -1, true );
def(_ldiv , "ldiv" , "b" , NULL , T_LONG , -2, true ); def(_ldiv , "ldiv" , "b" , nullptr , T_LONG , -2, true );
def(_fdiv , "fdiv" , "b" , NULL , T_FLOAT , -1, false); def(_fdiv , "fdiv" , "b" , nullptr , T_FLOAT , -1, false);
def(_ddiv , "ddiv" , "b" , NULL , T_DOUBLE , -2, false); def(_ddiv , "ddiv" , "b" , nullptr , T_DOUBLE , -2, false);
def(_irem , "irem" , "b" , NULL , T_INT , -1, true ); def(_irem , "irem" , "b" , nullptr , T_INT , -1, true );
def(_lrem , "lrem" , "b" , NULL , T_LONG , -2, true ); def(_lrem , "lrem" , "b" , nullptr , T_LONG , -2, true );
def(_frem , "frem" , "b" , NULL , T_FLOAT , -1, false); def(_frem , "frem" , "b" , nullptr , T_FLOAT , -1, false);
def(_drem , "drem" , "b" , NULL , T_DOUBLE , -2, false); def(_drem , "drem" , "b" , nullptr , T_DOUBLE , -2, false);
def(_ineg , "ineg" , "b" , NULL , T_INT , 0, false); def(_ineg , "ineg" , "b" , nullptr , T_INT , 0, false);
def(_lneg , "lneg" , "b" , NULL , T_LONG , 0, false); def(_lneg , "lneg" , "b" , nullptr , T_LONG , 0, false);
def(_fneg , "fneg" , "b" , NULL , T_FLOAT , 0, false); def(_fneg , "fneg" , "b" , nullptr , T_FLOAT , 0, false);
def(_dneg , "dneg" , "b" , NULL , T_DOUBLE , 0, false); def(_dneg , "dneg" , "b" , nullptr , T_DOUBLE , 0, false);
def(_ishl , "ishl" , "b" , NULL , T_INT , -1, false); def(_ishl , "ishl" , "b" , nullptr , T_INT , -1, false);
def(_lshl , "lshl" , "b" , NULL , T_LONG , -1, false); def(_lshl , "lshl" , "b" , nullptr , T_LONG , -1, false);
def(_ishr , "ishr" , "b" , NULL , T_INT , -1, false); def(_ishr , "ishr" , "b" , nullptr , T_INT , -1, false);
def(_lshr , "lshr" , "b" , NULL , T_LONG , -1, false); def(_lshr , "lshr" , "b" , nullptr , T_LONG , -1, false);
def(_iushr , "iushr" , "b" , NULL , T_INT , -1, false); def(_iushr , "iushr" , "b" , nullptr , T_INT , -1, false);
def(_lushr , "lushr" , "b" , NULL , T_LONG , -1, false); def(_lushr , "lushr" , "b" , nullptr , T_LONG , -1, false);
def(_iand , "iand" , "b" , NULL , T_INT , -1, false); def(_iand , "iand" , "b" , nullptr , T_INT , -1, false);
def(_land , "land" , "b" , NULL , T_LONG , -2, false); def(_land , "land" , "b" , nullptr , T_LONG , -2, false);
def(_ior , "ior" , "b" , NULL , T_INT , -1, false); def(_ior , "ior" , "b" , nullptr , T_INT , -1, false);
def(_lor , "lor" , "b" , NULL , T_LONG , -2, false); def(_lor , "lor" , "b" , nullptr , T_LONG , -2, false);
def(_ixor , "ixor" , "b" , NULL , T_INT , -1, false); def(_ixor , "ixor" , "b" , nullptr , T_INT , -1, false);
def(_lxor , "lxor" , "b" , NULL , T_LONG , -2, false); def(_lxor , "lxor" , "b" , nullptr , T_LONG , -2, false);
def(_iinc , "iinc" , "bic" , "wbiicc", T_VOID , 0, false); def(_iinc , "iinc" , "bic" , "wbiicc", T_VOID , 0, false);
def(_i2l , "i2l" , "b" , NULL , T_LONG , 1, false); def(_i2l , "i2l" , "b" , nullptr , T_LONG , 1, false);
def(_i2f , "i2f" , "b" , NULL , T_FLOAT , 0, false); def(_i2f , "i2f" , "b" , nullptr , T_FLOAT , 0, false);
def(_i2d , "i2d" , "b" , NULL , T_DOUBLE , 1, false); def(_i2d , "i2d" , "b" , nullptr , T_DOUBLE , 1, false);
def(_l2i , "l2i" , "b" , NULL , T_INT , -1, false); def(_l2i , "l2i" , "b" , nullptr , T_INT , -1, false);
def(_l2f , "l2f" , "b" , NULL , T_FLOAT , -1, false); def(_l2f , "l2f" , "b" , nullptr , T_FLOAT , -1, false);
def(_l2d , "l2d" , "b" , NULL , T_DOUBLE , 0, false); def(_l2d , "l2d" , "b" , nullptr , T_DOUBLE , 0, false);
def(_f2i , "f2i" , "b" , NULL , T_INT , 0, false); def(_f2i , "f2i" , "b" , nullptr , T_INT , 0, false);
def(_f2l , "f2l" , "b" , NULL , T_LONG , 1, false); def(_f2l , "f2l" , "b" , nullptr , T_LONG , 1, false);
def(_f2d , "f2d" , "b" , NULL , T_DOUBLE , 1, false); def(_f2d , "f2d" , "b" , nullptr , T_DOUBLE , 1, false);
def(_d2i , "d2i" , "b" , NULL , T_INT , -1, false); def(_d2i , "d2i" , "b" , nullptr , T_INT , -1, false);
def(_d2l , "d2l" , "b" , NULL , T_LONG , 0, false); def(_d2l , "d2l" , "b" , nullptr , T_LONG , 0, false);
def(_d2f , "d2f" , "b" , NULL , T_FLOAT , -1, false); def(_d2f , "d2f" , "b" , nullptr , T_FLOAT , -1, false);
def(_i2b , "i2b" , "b" , NULL , T_BYTE , 0, false); def(_i2b , "i2b" , "b" , nullptr , T_BYTE , 0, false);
def(_i2c , "i2c" , "b" , NULL , T_CHAR , 0, false); def(_i2c , "i2c" , "b" , nullptr , T_CHAR , 0, false);
def(_i2s , "i2s" , "b" , NULL , T_SHORT , 0, false); def(_i2s , "i2s" , "b" , nullptr , T_SHORT , 0, false);
def(_lcmp , "lcmp" , "b" , NULL , T_VOID , -3, false); def(_lcmp , "lcmp" , "b" , nullptr , T_VOID , -3, false);
def(_fcmpl , "fcmpl" , "b" , NULL , T_VOID , -1, false); def(_fcmpl , "fcmpl" , "b" , nullptr , T_VOID , -1, false);
def(_fcmpg , "fcmpg" , "b" , NULL , T_VOID , -1, false); def(_fcmpg , "fcmpg" , "b" , nullptr , T_VOID , -1, false);
def(_dcmpl , "dcmpl" , "b" , NULL , T_VOID , -3, false); def(_dcmpl , "dcmpl" , "b" , nullptr , T_VOID , -3, false);
def(_dcmpg , "dcmpg" , "b" , NULL , T_VOID , -3, false); def(_dcmpg , "dcmpg" , "b" , nullptr , T_VOID , -3, false);
def(_ifeq , "ifeq" , "boo" , NULL , T_VOID , -1, false); def(_ifeq , "ifeq" , "boo" , nullptr , T_VOID , -1, false);
def(_ifne , "ifne" , "boo" , NULL , T_VOID , -1, false); def(_ifne , "ifne" , "boo" , nullptr , T_VOID , -1, false);
def(_iflt , "iflt" , "boo" , NULL , T_VOID , -1, false); def(_iflt , "iflt" , "boo" , nullptr , T_VOID , -1, false);
def(_ifge , "ifge" , "boo" , NULL , T_VOID , -1, false); def(_ifge , "ifge" , "boo" , nullptr , T_VOID , -1, false);
def(_ifgt , "ifgt" , "boo" , NULL , T_VOID , -1, false); def(_ifgt , "ifgt" , "boo" , nullptr , T_VOID , -1, false);
def(_ifle , "ifle" , "boo" , NULL , T_VOID , -1, false); def(_ifle , "ifle" , "boo" , nullptr , T_VOID , -1, false);
def(_if_icmpeq , "if_icmpeq" , "boo" , NULL , T_VOID , -2, false); def(_if_icmpeq , "if_icmpeq" , "boo" , nullptr , T_VOID , -2, false);
def(_if_icmpne , "if_icmpne" , "boo" , NULL , T_VOID , -2, false); def(_if_icmpne , "if_icmpne" , "boo" , nullptr , T_VOID , -2, false);
def(_if_icmplt , "if_icmplt" , "boo" , NULL , T_VOID , -2, false); def(_if_icmplt , "if_icmplt" , "boo" , nullptr , T_VOID , -2, false);
def(_if_icmpge , "if_icmpge" , "boo" , NULL , T_VOID , -2, false); def(_if_icmpge , "if_icmpge" , "boo" , nullptr , T_VOID , -2, false);
def(_if_icmpgt , "if_icmpgt" , "boo" , NULL , T_VOID , -2, false); def(_if_icmpgt , "if_icmpgt" , "boo" , nullptr , T_VOID , -2, false);
def(_if_icmple , "if_icmple" , "boo" , NULL , T_VOID , -2, false); def(_if_icmple , "if_icmple" , "boo" , nullptr , T_VOID , -2, false);
def(_if_acmpeq , "if_acmpeq" , "boo" , NULL , T_VOID , -2, false); def(_if_acmpeq , "if_acmpeq" , "boo" , nullptr , T_VOID , -2, false);
def(_if_acmpne , "if_acmpne" , "boo" , NULL , T_VOID , -2, false); def(_if_acmpne , "if_acmpne" , "boo" , nullptr , T_VOID , -2, false);
def(_goto , "goto" , "boo" , NULL , T_VOID , 0, false); def(_goto , "goto" , "boo" , nullptr , T_VOID , 0, false);
def(_jsr , "jsr" , "boo" , NULL , T_INT , 0, false); def(_jsr , "jsr" , "boo" , nullptr , T_INT , 0, false);
def(_ret , "ret" , "bi" , "wbii" , T_VOID , 0, false); def(_ret , "ret" , "bi" , "wbii" , T_VOID , 0, false);
def(_tableswitch , "tableswitch" , "" , NULL , T_VOID , -1, false); // may have backward branches def(_tableswitch , "tableswitch" , "" , nullptr , T_VOID , -1, false); // may have backward branches
def(_lookupswitch , "lookupswitch" , "" , NULL , T_VOID , -1, false); // rewriting in interpreter def(_lookupswitch , "lookupswitch" , "" , nullptr , T_VOID , -1, false); // rewriting in interpreter
def(_ireturn , "ireturn" , "b" , NULL , T_INT , -1, true); def(_ireturn , "ireturn" , "b" , nullptr , T_INT , -1, true);
def(_lreturn , "lreturn" , "b" , NULL , T_LONG , -2, true); def(_lreturn , "lreturn" , "b" , nullptr , T_LONG , -2, true);
def(_freturn , "freturn" , "b" , NULL , T_FLOAT , -1, true); def(_freturn , "freturn" , "b" , nullptr , T_FLOAT , -1, true);
def(_dreturn , "dreturn" , "b" , NULL , T_DOUBLE , -2, true); def(_dreturn , "dreturn" , "b" , nullptr , T_DOUBLE , -2, true);
def(_areturn , "areturn" , "b" , NULL , T_OBJECT , -1, true); def(_areturn , "areturn" , "b" , nullptr , T_OBJECT , -1, true);
def(_return , "return" , "b" , NULL , T_VOID , 0, true); def(_return , "return" , "b" , nullptr , T_VOID , 0, true);
def(_getstatic , "getstatic" , "bJJ" , NULL , T_ILLEGAL, 1, true ); def(_getstatic , "getstatic" , "bJJ" , nullptr , T_ILLEGAL, 1, true );
def(_putstatic , "putstatic" , "bJJ" , NULL , T_ILLEGAL, -1, true ); def(_putstatic , "putstatic" , "bJJ" , nullptr , T_ILLEGAL, -1, true );
def(_getfield , "getfield" , "bJJ" , NULL , T_ILLEGAL, 0, true ); def(_getfield , "getfield" , "bJJ" , nullptr , T_ILLEGAL, 0, true );
def(_putfield , "putfield" , "bJJ" , NULL , T_ILLEGAL, -2, true ); def(_putfield , "putfield" , "bJJ" , nullptr , T_ILLEGAL, -2, true );
def(_invokevirtual , "invokevirtual" , "bJJ" , NULL , T_ILLEGAL, -1, true); def(_invokevirtual , "invokevirtual" , "bJJ" , nullptr , T_ILLEGAL, -1, true);
def(_invokespecial , "invokespecial" , "bJJ" , NULL , T_ILLEGAL, -1, true); def(_invokespecial , "invokespecial" , "bJJ" , nullptr , T_ILLEGAL, -1, true);
def(_invokestatic , "invokestatic" , "bJJ" , NULL , T_ILLEGAL, 0, true); def(_invokestatic , "invokestatic" , "bJJ" , nullptr , T_ILLEGAL, 0, true);
def(_invokeinterface , "invokeinterface" , "bJJ__", NULL , T_ILLEGAL, -1, true); def(_invokeinterface , "invokeinterface" , "bJJ__", nullptr , T_ILLEGAL, -1, true);
def(_invokedynamic , "invokedynamic" , "bJJJJ", NULL , T_ILLEGAL, 0, true ); def(_invokedynamic , "invokedynamic" , "bJJJJ", nullptr , T_ILLEGAL, 0, true );
def(_new , "new" , "bkk" , NULL , T_OBJECT , 1, true ); def(_new , "new" , "bkk" , nullptr , T_OBJECT , 1, true );
def(_newarray , "newarray" , "bc" , NULL , T_OBJECT , 0, true ); def(_newarray , "newarray" , "bc" , nullptr , T_OBJECT , 0, true );
def(_anewarray , "anewarray" , "bkk" , NULL , T_OBJECT , 0, true ); def(_anewarray , "anewarray" , "bkk" , nullptr , T_OBJECT , 0, true );
def(_arraylength , "arraylength" , "b" , NULL , T_INT , 0, true ); def(_arraylength , "arraylength" , "b" , nullptr , T_INT , 0, true );
def(_athrow , "athrow" , "b" , NULL , T_VOID , -1, true ); def(_athrow , "athrow" , "b" , nullptr , T_VOID , -1, true );
def(_checkcast , "checkcast" , "bkk" , NULL , T_OBJECT , 0, true ); def(_checkcast , "checkcast" , "bkk" , nullptr , T_OBJECT , 0, true );
def(_instanceof , "instanceof" , "bkk" , NULL , T_INT , 0, true ); def(_instanceof , "instanceof" , "bkk" , nullptr , T_INT , 0, true );
def(_monitorenter , "monitorenter" , "b" , NULL , T_VOID , -1, true ); def(_monitorenter , "monitorenter" , "b" , nullptr , T_VOID , -1, true );
def(_monitorexit , "monitorexit" , "b" , NULL , T_VOID , -1, true ); def(_monitorexit , "monitorexit" , "b" , nullptr , T_VOID , -1, true );
def(_wide , "wide" , "" , NULL , T_VOID , 0, false); def(_wide , "wide" , "" , nullptr , T_VOID , 0, false);
def(_multianewarray , "multianewarray" , "bkkc" , NULL , T_OBJECT , 1, true ); def(_multianewarray , "multianewarray" , "bkkc" , nullptr , T_OBJECT , 1, true );
def(_ifnull , "ifnull" , "boo" , NULL , T_VOID , -1, false); def(_ifnull , "ifnull" , "boo" , nullptr , T_VOID , -1, false);
def(_ifnonnull , "ifnonnull" , "boo" , NULL , T_VOID , -1, false); def(_ifnonnull , "ifnonnull" , "boo" , nullptr , T_VOID , -1, false);
def(_goto_w , "goto_w" , "boooo", NULL , T_VOID , 0, false); def(_goto_w , "goto_w" , "boooo", nullptr , T_VOID , 0, false);
def(_jsr_w , "jsr_w" , "boooo", NULL , T_INT , 0, false); def(_jsr_w , "jsr_w" , "boooo", nullptr , T_INT , 0, false);
def(_breakpoint , "breakpoint" , "" , NULL , T_VOID , 0, true); def(_breakpoint , "breakpoint" , "" , nullptr , T_VOID , 0, true);
// JVM bytecodes // JVM bytecodes
// bytecode bytecode name format wide f. result tp stk traps std code // bytecode bytecode name format wide f. result tp stk traps std code
def(_fast_agetfield , "fast_agetfield" , "bJJ" , NULL , T_OBJECT , 0, true , _getfield ); def(_fast_agetfield , "fast_agetfield" , "bJJ" , nullptr , T_OBJECT , 0, true , _getfield );
def(_fast_bgetfield , "fast_bgetfield" , "bJJ" , NULL , T_INT , 0, true , _getfield ); def(_fast_bgetfield , "fast_bgetfield" , "bJJ" , nullptr , T_INT , 0, true , _getfield );
def(_fast_cgetfield , "fast_cgetfield" , "bJJ" , NULL , T_CHAR , 0, true , _getfield ); def(_fast_cgetfield , "fast_cgetfield" , "bJJ" , nullptr , T_CHAR , 0, true , _getfield );
def(_fast_dgetfield , "fast_dgetfield" , "bJJ" , NULL , T_DOUBLE , 0, true , _getfield ); def(_fast_dgetfield , "fast_dgetfield" , "bJJ" , nullptr , T_DOUBLE , 0, true , _getfield );
def(_fast_fgetfield , "fast_fgetfield" , "bJJ" , NULL , T_FLOAT , 0, true , _getfield ); def(_fast_fgetfield , "fast_fgetfield" , "bJJ" , nullptr , T_FLOAT , 0, true , _getfield );
def(_fast_igetfield , "fast_igetfield" , "bJJ" , NULL , T_INT , 0, true , _getfield ); def(_fast_igetfield , "fast_igetfield" , "bJJ" , nullptr , T_INT , 0, true , _getfield );
def(_fast_lgetfield , "fast_lgetfield" , "bJJ" , NULL , T_LONG , 0, true , _getfield ); def(_fast_lgetfield , "fast_lgetfield" , "bJJ" , nullptr , T_LONG , 0, true , _getfield );
def(_fast_sgetfield , "fast_sgetfield" , "bJJ" , NULL , T_SHORT , 0, true , _getfield ); def(_fast_sgetfield , "fast_sgetfield" , "bJJ" , nullptr , T_SHORT , 0, true , _getfield );
def(_fast_aputfield , "fast_aputfield" , "bJJ" , NULL , T_OBJECT , 0, true , _putfield ); def(_fast_aputfield , "fast_aputfield" , "bJJ" , nullptr , T_OBJECT , 0, true , _putfield );
def(_fast_bputfield , "fast_bputfield" , "bJJ" , NULL , T_INT , 0, true , _putfield ); def(_fast_bputfield , "fast_bputfield" , "bJJ" , nullptr , T_INT , 0, true , _putfield );
def(_fast_zputfield , "fast_zputfield" , "bJJ" , NULL , T_INT , 0, true , _putfield ); def(_fast_zputfield , "fast_zputfield" , "bJJ" , nullptr , T_INT , 0, true , _putfield );
def(_fast_cputfield , "fast_cputfield" , "bJJ" , NULL , T_CHAR , 0, true , _putfield ); def(_fast_cputfield , "fast_cputfield" , "bJJ" , nullptr , T_CHAR , 0, true , _putfield );
def(_fast_dputfield , "fast_dputfield" , "bJJ" , NULL , T_DOUBLE , 0, true , _putfield ); def(_fast_dputfield , "fast_dputfield" , "bJJ" , nullptr , T_DOUBLE , 0, true , _putfield );
def(_fast_fputfield , "fast_fputfield" , "bJJ" , NULL , T_FLOAT , 0, true , _putfield ); def(_fast_fputfield , "fast_fputfield" , "bJJ" , nullptr , T_FLOAT , 0, true , _putfield );
def(_fast_iputfield , "fast_iputfield" , "bJJ" , NULL , T_INT , 0, true , _putfield ); def(_fast_iputfield , "fast_iputfield" , "bJJ" , nullptr , T_INT , 0, true , _putfield );
def(_fast_lputfield , "fast_lputfield" , "bJJ" , NULL , T_LONG , 0, true , _putfield ); def(_fast_lputfield , "fast_lputfield" , "bJJ" , nullptr , T_LONG , 0, true , _putfield );
def(_fast_sputfield , "fast_sputfield" , "bJJ" , NULL , T_SHORT , 0, true , _putfield ); def(_fast_sputfield , "fast_sputfield" , "bJJ" , nullptr , T_SHORT , 0, true , _putfield );
def(_fast_aload_0 , "fast_aload_0" , "b" , NULL , T_OBJECT , 1, true , _aload_0 ); def(_fast_aload_0 , "fast_aload_0" , "b" , nullptr , T_OBJECT , 1, true , _aload_0 );
def(_fast_iaccess_0 , "fast_iaccess_0" , "b_JJ" , NULL , T_INT , 1, true , _aload_0 ); def(_fast_iaccess_0 , "fast_iaccess_0" , "b_JJ" , nullptr , T_INT , 1, true , _aload_0 );
def(_fast_aaccess_0 , "fast_aaccess_0" , "b_JJ" , NULL , T_OBJECT , 1, true , _aload_0 ); def(_fast_aaccess_0 , "fast_aaccess_0" , "b_JJ" , nullptr , T_OBJECT , 1, true , _aload_0 );
def(_fast_faccess_0 , "fast_faccess_0" , "b_JJ" , NULL , T_OBJECT , 1, true , _aload_0 ); def(_fast_faccess_0 , "fast_faccess_0" , "b_JJ" , nullptr , T_OBJECT , 1, true , _aload_0 );
def(_fast_iload , "fast_iload" , "bi" , NULL , T_INT , 1, false, _iload); def(_fast_iload , "fast_iload" , "bi" , nullptr , T_INT , 1, false, _iload);
def(_fast_iload2 , "fast_iload2" , "bi_i" , NULL , T_INT , 2, false, _iload); def(_fast_iload2 , "fast_iload2" , "bi_i" , nullptr , T_INT , 2, false, _iload);
def(_fast_icaload , "fast_icaload" , "bi_" , NULL , T_INT , 0, false, _iload); def(_fast_icaload , "fast_icaload" , "bi_" , nullptr , T_INT , 0, false, _iload);
// Faster method invocation. // Faster method invocation.
def(_fast_invokevfinal , "fast_invokevfinal" , "bJJ" , NULL , T_ILLEGAL, -1, true, _invokevirtual ); def(_fast_invokevfinal , "fast_invokevfinal" , "bJJ" , nullptr , T_ILLEGAL, -1, true, _invokevirtual );
def(_fast_linearswitch , "fast_linearswitch" , "" , NULL , T_VOID , -1, false, _lookupswitch ); def(_fast_linearswitch , "fast_linearswitch" , "" , nullptr , T_VOID , -1, false, _lookupswitch );
def(_fast_binaryswitch , "fast_binaryswitch" , "" , NULL , T_VOID , -1, false, _lookupswitch ); def(_fast_binaryswitch , "fast_binaryswitch" , "" , nullptr , T_VOID , -1, false, _lookupswitch );
def(_return_register_finalizer , "return_register_finalizer" , "b" , NULL , T_VOID , 0, true, _return); def(_return_register_finalizer , "return_register_finalizer" , "b" , nullptr , T_VOID , 0, true, _return);
def(_invokehandle , "invokehandle" , "bJJ" , NULL , T_ILLEGAL, -1, true, _invokevirtual ); def(_invokehandle , "invokehandle" , "bJJ" , nullptr , T_ILLEGAL, -1, true, _invokevirtual );
def(_fast_aldc , "fast_aldc" , "bj" , NULL , T_OBJECT, 1, true, _ldc ); def(_fast_aldc , "fast_aldc" , "bj" , nullptr , T_OBJECT, 1, true, _ldc );
def(_fast_aldc_w , "fast_aldc_w" , "bJJ" , NULL , T_OBJECT, 1, true, _ldc_w ); def(_fast_aldc_w , "fast_aldc_w" , "bJJ" , nullptr , T_OBJECT, 1, true, _ldc_w );
def(_nofast_getfield , "nofast_getfield" , "bJJ" , NULL , T_ILLEGAL, 0, true, _getfield ); def(_nofast_getfield , "nofast_getfield" , "bJJ" , nullptr , T_ILLEGAL, 0, true, _getfield );
def(_nofast_putfield , "nofast_putfield" , "bJJ" , NULL , T_ILLEGAL, -2, true , _putfield ); def(_nofast_putfield , "nofast_putfield" , "bJJ" , nullptr , T_ILLEGAL, -2, true , _putfield );
def(_nofast_aload_0 , "nofast_aload_0" , "b" , NULL , T_OBJECT, 1, true , _aload_0 ); def(_nofast_aload_0 , "nofast_aload_0" , "b" , nullptr , T_OBJECT, 1, true , _aload_0 );
def(_nofast_iload , "nofast_iload" , "bi" , NULL , T_INT, 1, false, _iload ); def(_nofast_iload , "nofast_iload" , "bi" , nullptr , T_INT, 1, false, _iload );
def(_shouldnotreachhere , "_shouldnotreachhere" , "b" , NULL , T_VOID , 0, false); def(_shouldnotreachhere , "_shouldnotreachhere" , "b" , nullptr , T_VOID , 0, false);
// compare can_trap information for each bytecode with the // compare can_trap information for each bytecode with the
// can_trap information for the corresponding base bytecode // can_trap information for the corresponding base bytecode

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -365,12 +365,12 @@ class Bytecodes: AllStatic {
// argument is used for conversion of breakpoints into the original // argument is used for conversion of breakpoints into the original
// bytecode. The CI uses these methods but guarantees that // bytecode. The CI uses these methods but guarantees that
// breakpoints are hidden so the method argument should be passed as // breakpoints are hidden so the method argument should be passed as
// NULL since in that case the bcp and Method* are unrelated // null since in that case the bcp and Method* are unrelated
// memory. // memory.
static Code code_at(const Method* method, address bcp) { static Code code_at(const Method* method, address bcp) {
assert(method == NULL || check_method(method, bcp), "bcp must point into method"); assert(method == nullptr || check_method(method, bcp), "bcp must point into method");
Code code = cast(*bcp); Code code = cast(*bcp);
assert(code != _breakpoint || method != NULL, "need Method* to decode breakpoint"); assert(code != _breakpoint || method != nullptr, "need Method* to decode breakpoint");
return (code != _breakpoint) ? code : non_breakpoint_code_at(method, bcp); return (code != _breakpoint) ? code : non_breakpoint_code_at(method, bcp);
} }
static Code java_code_at(const Method* method, address bcp) { static Code java_code_at(const Method* method, address bcp) {
@ -404,8 +404,8 @@ class Bytecodes: AllStatic {
static bool uses_cp_cache (Code code) { check(code); return has_all_flags(code, _fmt_has_j, false); } static bool uses_cp_cache (Code code) { check(code); return has_all_flags(code, _fmt_has_j, false); }
// if 'end' is provided, it indicates the end of the code buffer which // if 'end' is provided, it indicates the end of the code buffer which
// should not be read past when parsing. // should not be read past when parsing.
static int special_length_at(Bytecodes::Code code, address bcp, address end = NULL); static int special_length_at(Bytecodes::Code code, address bcp, address end = nullptr);
static int raw_special_length_at(address bcp, address end = NULL); static int raw_special_length_at(address bcp, address end = nullptr);
static int length_for_code_at(Bytecodes::Code code, address bcp) { int l = length_for(code); return l > 0 ? l : special_length_at(code, bcp); } static int length_for_code_at(Bytecodes::Code code, address bcp) { int l = length_for(code); return l > 0 ? l : special_length_at(code, bcp); }
static int length_at (Method* method, address bcp) { return length_for_code_at(code_at(method, bcp), bcp); } static int length_at (Method* method, address bcp) { return length_for_code_at(code_at(method, bcp), bcp); }
static int java_length_at (Method* method, address bcp) { return length_for_code_at(java_code_at(method, bcp), bcp); } static int java_length_at (Method* method, address bcp) { return length_for_code_at(java_code_at(method, bcp), bcp); }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -71,7 +71,7 @@ void InterpreterCodelet::print_on(outputStream* st) const {
st->print_cr("----------------------------------------------------------------------"); st->print_cr("----------------------------------------------------------------------");
} }
if (description() != NULL) st->print("%s ", description()); if (description() != nullptr) st->print("%s ", description());
if (bytecode() >= 0 ) st->print("%d %s ", bytecode(), Bytecodes::name(bytecode())); if (bytecode() >= 0 ) st->print("%d %s ", bytecode(), Bytecodes::name(bytecode()));
st->print_cr("[" INTPTR_FORMAT ", " INTPTR_FORMAT "] %d bytes", st->print_cr("[" INTPTR_FORMAT ", " INTPTR_FORMAT "] %d bytes",
p2i(code_begin()), p2i(code_end()), code_size()); p2i(code_begin()), p2i(code_end()), code_size());
@ -90,7 +90,7 @@ CodeletMark::CodeletMark(InterpreterMacroAssembler*& masm,
_clet((InterpreterCodelet*)AbstractInterpreter::code()->request(codelet_size())), _clet((InterpreterCodelet*)AbstractInterpreter::code()->request(codelet_size())),
_cb(_clet->code_begin(), _clet->code_size()) { _cb(_clet->code_begin(), _clet->code_size()) {
// Request all space (add some slack for Codelet data). // Request all space (add some slack for Codelet data).
assert(_clet != NULL, "we checked not enough space already"); assert(_clet != nullptr, "we checked not enough space already");
// Initialize Codelet attributes. // Initialize Codelet attributes.
_clet->initialize(description, bytecode); _clet->initialize(description, bytecode);
@ -116,7 +116,7 @@ CodeletMark::~CodeletMark() {
AbstractInterpreter::code()->commit(committed_code_size); AbstractInterpreter::code()->commit(committed_code_size);
} }
// Make sure nobody can use _masm outside a CodeletMark lifespan. // Make sure nobody can use _masm outside a CodeletMark lifespan.
*_masm = NULL; *_masm = nullptr;
} }
// The reason that interpreter initialization is split into two parts is that the first part // The reason that interpreter initialization is split into two parts is that the first part

View File

@ -134,9 +134,9 @@ void InterpreterRuntime::set_bcp_and_mdp(address bcp, JavaThread* current) {
last_frame.set_bcp(bcp); last_frame.set_bcp(bcp);
if (ProfileInterpreter) { if (ProfileInterpreter) {
// ProfileTraps uses MDOs independently of ProfileInterpreter. // ProfileTraps uses MDOs independently of ProfileInterpreter.
// That is why we must check both ProfileInterpreter and mdo != NULL. // That is why we must check both ProfileInterpreter and mdo != nullptr.
MethodData* mdo = last_frame.method()->method_data(); MethodData* mdo = last_frame.method()->method_data();
if (mdo != NULL) { if (mdo != nullptr) {
NEEDS_CLEANUP; NEEDS_CLEANUP;
last_frame.set_mdp(mdo->bci_to_dp(last_frame.bci())); last_frame.set_mdp(mdo->bci_to_dp(last_frame.bci()));
} }
@ -184,7 +184,7 @@ JRT_ENTRY(void, InterpreterRuntime::resolve_ldc(JavaThread* current, Bytecodes::
// Resolve the constant. This does not do unboxing. // Resolve the constant. This does not do unboxing.
// But it does replace Universe::the_null_sentinel by null. // But it does replace Universe::the_null_sentinel by null.
oop result = ldc.resolve_constant(CHECK); oop result = ldc.resolve_constant(CHECK);
assert(result != NULL || is_fast_aldc, "null result only valid for fast_aldc"); assert(result != nullptr || is_fast_aldc, "null result only valid for fast_aldc");
#ifdef ASSERT #ifdef ASSERT
{ {
@ -195,7 +195,7 @@ JRT_ENTRY(void, InterpreterRuntime::resolve_ldc(JavaThread* current, Bytecodes::
rindex = m->constants()->cp_to_object_index(ldc2.pool_index()); rindex = m->constants()->cp_to_object_index(ldc2.pool_index());
if (rindex >= 0) { if (rindex >= 0) {
oop coop = m->constants()->resolved_reference_at(rindex); oop coop = m->constants()->resolved_reference_at(rindex);
oop roop = (result == NULL ? Universe::the_null_sentinel() : result); oop roop = (result == nullptr ? Universe::the_null_sentinel() : result);
assert(roop == coop, "expected result for assembly code"); assert(roop == coop, "expected result for assembly code");
} }
} }
@ -315,7 +315,7 @@ void InterpreterRuntime::note_trap_inner(JavaThread* current, int reason,
const methodHandle& trap_method, int trap_bci) { const methodHandle& trap_method, int trap_bci) {
if (trap_method.not_null()) { if (trap_method.not_null()) {
MethodData* trap_mdo = trap_method->method_data(); MethodData* trap_mdo = trap_method->method_data();
if (trap_mdo == NULL) { if (trap_mdo == nullptr) {
ExceptionMark em(current); ExceptionMark em(current);
JavaThread* THREAD = current; // For exception macros. JavaThread* THREAD = current; // For exception macros.
Method::build_profiling_method_data(trap_method, THREAD); Method::build_profiling_method_data(trap_method, THREAD);
@ -328,7 +328,7 @@ void InterpreterRuntime::note_trap_inner(JavaThread* current, int reason,
trap_mdo = trap_method->method_data(); trap_mdo = trap_method->method_data();
// and fall through... // and fall through...
} }
if (trap_mdo != NULL) { if (trap_mdo != nullptr) {
// Update per-method count of trap events. The interpreter // Update per-method count of trap events. The interpreter
// is updating the MDO to simulate the effect of compiler traps. // is updating the MDO to simulate the effect of compiler traps.
Deoptimization::update_method_data_from_interpreter(trap_mdo, trap_bci, reason); Deoptimization::update_method_data_from_interpreter(trap_mdo, trap_bci, reason);
@ -504,7 +504,7 @@ JRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea
should_repeat = false; should_repeat = false;
// assertions // assertions
assert(h_exception.not_null(), "NULL exceptions should be handled by athrow"); assert(h_exception.not_null(), "null exceptions should be handled by athrow");
// Check that exception is a subclass of Throwable. // Check that exception is a subclass of Throwable.
assert(h_exception->is_a(vmClasses::Throwable_klass()), assert(h_exception->is_a(vmClasses::Throwable_klass()),
"Exception not subclass of Throwable"); "Exception not subclass of Throwable");
@ -547,10 +547,10 @@ JRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea
} while (should_repeat == true); } while (should_repeat == true);
#if INCLUDE_JVMCI #if INCLUDE_JVMCI
if (EnableJVMCI && h_method->method_data() != NULL) { if (EnableJVMCI && h_method->method_data() != nullptr) {
ResourceMark rm(current); ResourceMark rm(current);
ProfileData* pdata = h_method->method_data()->allocate_bci_to_data(current_bci, NULL); ProfileData* pdata = h_method->method_data()->allocate_bci_to_data(current_bci, nullptr);
if (pdata != NULL && pdata->is_BitData()) { if (pdata != nullptr && pdata->is_BitData()) {
BitData* bit_data = (BitData*) pdata; BitData* bit_data = (BitData*) pdata;
bit_data->set_exception_seen(); bit_data->set_exception_seen();
} }
@ -563,8 +563,8 @@ JRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea
JvmtiExport::post_exception_throw(current, h_method(), last_frame.bcp(), h_exception()); JvmtiExport::post_exception_throw(current, h_method(), last_frame.bcp(), h_exception());
} }
address continuation = NULL; address continuation = nullptr;
address handler_pc = NULL; address handler_pc = nullptr;
if (handler_bci < 0 || !current->stack_overflow_state()->reguard_stack((address) &continuation)) { if (handler_bci < 0 || !current->stack_overflow_state()->reguard_stack((address) &continuation)) {
// Forward exception to callee (leaving bci/bcp untouched) because (a) no // Forward exception to callee (leaving bci/bcp untouched) because (a) no
// handler in this method, or (b) after a stack overflow there is not yet // handler in this method, or (b) after a stack overflow there is not yet
@ -588,7 +588,7 @@ JRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea
// notify debugger of an exception catch // notify debugger of an exception catch
// (this is good for exceptions caught in native methods as well) // (this is good for exceptions caught in native methods as well)
if (JvmtiExport::can_post_on_exceptions()) { if (JvmtiExport::can_post_on_exceptions()) {
JvmtiExport::notice_unwind_due_to_exception(current, h_method(), handler_pc, h_exception(), (handler_pc != NULL)); JvmtiExport::notice_unwind_due_to_exception(current, h_method(), handler_pc, h_exception(), (handler_pc != nullptr));
} }
current->set_vm_result(h_exception()); current->set_vm_result(h_exception());
@ -615,7 +615,7 @@ JRT_END
JRT_ENTRY(void, InterpreterRuntime::throw_AbstractMethodErrorWithMethod(JavaThread* current, JRT_ENTRY(void, InterpreterRuntime::throw_AbstractMethodErrorWithMethod(JavaThread* current,
Method* missingMethod)) Method* missingMethod))
ResourceMark rm(current); ResourceMark rm(current);
assert(missingMethod != NULL, "sanity"); assert(missingMethod != nullptr, "sanity");
methodHandle m(current, missingMethod); methodHandle m(current, missingMethod);
LinkResolver::throw_abstract_method_error(m, THREAD); LinkResolver::throw_abstract_method_error(m, THREAD);
JRT_END JRT_END
@ -641,8 +641,8 @@ JRT_ENTRY(void, InterpreterRuntime::throw_IncompatibleClassChangeErrorVerbose(Ja
buf[0] = '\0'; buf[0] = '\0';
jio_snprintf(buf, sizeof(buf), jio_snprintf(buf, sizeof(buf),
"Class %s does not implement the requested interface %s", "Class %s does not implement the requested interface %s",
recvKlass ? recvKlass->external_name() : "NULL", recvKlass ? recvKlass->external_name() : "nullptr",
interfaceKlass ? interfaceKlass->external_name() : "NULL"); interfaceKlass ? interfaceKlass->external_name() : "nullptr");
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
JRT_END JRT_END
@ -740,10 +740,10 @@ JRT_ENTRY_NO_ASYNC(void, InterpreterRuntime::monitorenter(JavaThread* current, B
#endif #endif
Handle h_obj(current, elem->obj()); Handle h_obj(current, elem->obj());
assert(Universe::heap()->is_in_or_null(h_obj()), assert(Universe::heap()->is_in_or_null(h_obj()),
"must be NULL or an object"); "must be null or an object");
ObjectSynchronizer::enter(h_obj, elem->lock(), current); ObjectSynchronizer::enter(h_obj, elem->lock(), current);
assert(Universe::heap()->is_in_or_null(elem->obj()), assert(Universe::heap()->is_in_or_null(elem->obj()),
"must be NULL or an object"); "must be null or an object");
#ifdef ASSERT #ifdef ASSERT
current->last_frame().interpreter_frame_verify_monitor(elem); current->last_frame().interpreter_frame_verify_monitor(elem);
#endif #endif
@ -764,7 +764,7 @@ JRT_LEAF(void, InterpreterRuntime::monitorexit(BasicObjectLock* elem))
ObjectSynchronizer::exit(obj, elem->lock(), JavaThread::current()); ObjectSynchronizer::exit(obj, elem->lock(), JavaThread::current());
// Free entry. If it is not cleared, the exception handling code will try to unlock the monitor // Free entry. If it is not cleared, the exception handling code will try to unlock the monitor
// again at method exit or in the case of an exception. // again at method exit or in the case of an exception.
elem->set_obj(NULL); elem->set_obj(nullptr);
JRT_END JRT_END
@ -781,8 +781,8 @@ JRT_ENTRY(void, InterpreterRuntime::new_illegal_monitor_state_exception(JavaThre
assert(!HAS_PENDING_EXCEPTION, "no pending exception"); assert(!HAS_PENDING_EXCEPTION, "no pending exception");
Handle exception(current, current->vm_result()); Handle exception(current, current->vm_result());
assert(exception() != NULL, "vm result should be set"); assert(exception() != nullptr, "vm result should be set");
current->set_vm_result(NULL); // clear vm result before continuing (may cause memory leaks and assert failures) current->set_vm_result(nullptr); // clear vm result before continuing (may cause memory leaks and assert failures)
exception = get_preinitialized_exception(vmClasses::IllegalMonitorStateException_klass(), CATCH); exception = get_preinitialized_exception(vmClasses::IllegalMonitorStateException_klass(), CATCH);
current->set_vm_result(exception()); current->set_vm_result(exception());
JRT_END JRT_END
@ -806,7 +806,7 @@ JRT_END
void InterpreterRuntime::resolve_invoke(JavaThread* current, Bytecodes::Code bytecode) { void InterpreterRuntime::resolve_invoke(JavaThread* current, Bytecodes::Code bytecode) {
LastFrameAccessor last_frame(current); LastFrameAccessor last_frame(current);
// extract receiver from the outgoing argument list if necessary // extract receiver from the outgoing argument list if necessary
Handle receiver(current, NULL); Handle receiver(current, nullptr);
if (bytecode == Bytecodes::_invokevirtual || bytecode == Bytecodes::_invokeinterface || if (bytecode == Bytecodes::_invokevirtual || bytecode == Bytecodes::_invokeinterface ||
bytecode == Bytecodes::_invokespecial) { bytecode == Bytecodes::_invokespecial) {
ResourceMark rm(current); ResourceMark rm(current);
@ -991,8 +991,8 @@ nmethod* InterpreterRuntime::frequency_counter_overflow(JavaThread* current, add
// frequency_counter_overflow_inner can throw async exception. // frequency_counter_overflow_inner can throw async exception.
nmethod* nm = frequency_counter_overflow_inner(current, branch_bcp); nmethod* nm = frequency_counter_overflow_inner(current, branch_bcp);
assert(branch_bcp != NULL || nm == NULL, "always returns null for non OSR requests"); assert(branch_bcp != nullptr || nm == nullptr, "always returns null for non OSR requests");
if (branch_bcp != NULL && nm != NULL) { if (branch_bcp != nullptr && nm != nullptr) {
// This was a successful request for an OSR nmethod. Because // This was a successful request for an OSR nmethod. Because
// frequency_counter_overflow_inner ends with a safepoint check, // frequency_counter_overflow_inner ends with a safepoint check,
// nm could have been unloaded so look it up again. It's unsafe // nm could have been unloaded so look it up again. It's unsafe
@ -1003,24 +1003,24 @@ nmethod* InterpreterRuntime::frequency_counter_overflow(JavaThread* current, add
int bci = method->bci_from(last_frame.bcp()); int bci = method->bci_from(last_frame.bcp());
nm = method->lookup_osr_nmethod_for(bci, CompLevel_none, false); nm = method->lookup_osr_nmethod_for(bci, CompLevel_none, false);
BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
if (nm != NULL && bs_nm != NULL) { if (nm != nullptr && bs_nm != nullptr) {
// in case the transition passed a safepoint we need to barrier this again // in case the transition passed a safepoint we need to barrier this again
if (!bs_nm->nmethod_osr_entry_barrier(nm)) { if (!bs_nm->nmethod_osr_entry_barrier(nm)) {
nm = NULL; nm = nullptr;
} }
} }
} }
if (nm != NULL && current->is_interp_only_mode()) { if (nm != nullptr && current->is_interp_only_mode()) {
// Normally we never get an nm if is_interp_only_mode() is true, because // Normally we never get an nm if is_interp_only_mode() is true, because
// policy()->event has a check for this and won't compile the method when // policy()->event has a check for this and won't compile the method when
// true. However, it's possible for is_interp_only_mode() to become true // true. However, it's possible for is_interp_only_mode() to become true
// during the compilation. We don't want to return the nm in that case // during the compilation. We don't want to return the nm in that case
// because we want to continue to execute interpreted. // because we want to continue to execute interpreted.
nm = NULL; nm = nullptr;
} }
#ifndef PRODUCT #ifndef PRODUCT
if (TraceOnStackReplacement) { if (TraceOnStackReplacement) {
if (nm != NULL) { if (nm != nullptr) {
tty->print("OSR entry @ pc: " INTPTR_FORMAT ": ", p2i(nm->osr_entry())); tty->print("OSR entry @ pc: " INTPTR_FORMAT ": ", p2i(nm->osr_entry()));
nm->print(); nm->print();
} }
@ -1038,15 +1038,15 @@ JRT_ENTRY(nmethod*,
LastFrameAccessor last_frame(current); LastFrameAccessor last_frame(current);
assert(last_frame.is_interpreted_frame(), "must come from interpreter"); assert(last_frame.is_interpreted_frame(), "must come from interpreter");
methodHandle method(current, last_frame.method()); methodHandle method(current, last_frame.method());
const int branch_bci = branch_bcp != NULL ? method->bci_from(branch_bcp) : InvocationEntryBci; const int branch_bci = branch_bcp != nullptr ? method->bci_from(branch_bcp) : InvocationEntryBci;
const int bci = branch_bcp != NULL ? method->bci_from(last_frame.bcp()) : InvocationEntryBci; const int bci = branch_bcp != nullptr ? method->bci_from(last_frame.bcp()) : InvocationEntryBci;
nmethod* osr_nm = CompilationPolicy::event(method, method, branch_bci, bci, CompLevel_none, NULL, CHECK_NULL); nmethod* osr_nm = CompilationPolicy::event(method, method, branch_bci, bci, CompLevel_none, nullptr, CHECK_NULL);
BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
if (osr_nm != NULL && bs_nm != NULL) { if (osr_nm != nullptr && bs_nm != nullptr) {
if (!bs_nm->nmethod_osr_entry_barrier(osr_nm)) { if (!bs_nm->nmethod_osr_entry_barrier(osr_nm)) {
osr_nm = NULL; osr_nm = nullptr;
} }
} }
return osr_nm; return osr_nm;
@ -1056,7 +1056,7 @@ JRT_LEAF(jint, InterpreterRuntime::bcp_to_di(Method* method, address cur_bcp))
assert(ProfileInterpreter, "must be profiling interpreter"); assert(ProfileInterpreter, "must be profiling interpreter");
int bci = method->bci_from(cur_bcp); int bci = method->bci_from(cur_bcp);
MethodData* mdo = method->method_data(); MethodData* mdo = method->method_data();
if (mdo == NULL) return 0; if (mdo == nullptr) return 0;
return mdo->bci_to_di(bci); return mdo->bci_to_di(bci);
JRT_END JRT_END
@ -1065,7 +1065,7 @@ JRT_LEAF(void, InterpreterRuntime::verify_mdp(Method* method, address bcp, addre
assert(ProfileInterpreter, "must be profiling interpreter"); assert(ProfileInterpreter, "must be profiling interpreter");
MethodData* mdo = method->method_data(); MethodData* mdo = method->method_data();
assert(mdo != NULL, "must not be null"); assert(mdo != nullptr, "must not be null");
int bci = method->bci_from(bcp); int bci = method->bci_from(bcp);
@ -1103,7 +1103,7 @@ JRT_ENTRY(void, InterpreterRuntime::update_mdp_for_ret(JavaThread* current, int
// ProfileData is essentially a wrapper around a derived oop, so we // ProfileData is essentially a wrapper around a derived oop, so we
// need to take the lock before making any ProfileData structures. // need to take the lock before making any ProfileData structures.
ProfileData* data = h_mdo->data_at(h_mdo->dp_to_di(last_frame.mdp())); ProfileData* data = h_mdo->data_at(h_mdo->dp_to_di(last_frame.mdp()));
guarantee(data != NULL, "profile data must be valid"); guarantee(data != nullptr, "profile data must be valid");
RetData* rdata = data->as_RetData(); RetData* rdata = data->as_RetData();
address new_mdp = rdata->fixup_ret(return_bci, h_mdo); address new_mdp = rdata->fixup_ret(return_bci, h_mdo);
last_frame.set_mdp(new_mdp); last_frame.set_mdp(new_mdp);
@ -1161,7 +1161,7 @@ JRT_ENTRY(void, InterpreterRuntime::post_field_access(JavaThread* current, oopDe
int index = cp_entry->field_index(); int index = cp_entry->field_index();
if ((ik->field_access_flags(index) & JVM_ACC_FIELD_ACCESS_WATCHED) == 0) return; if ((ik->field_access_flags(index) & JVM_ACC_FIELD_ACCESS_WATCHED) == 0) return;
bool is_static = (obj == NULL); bool is_static = (obj == nullptr);
HandleMark hm(current); HandleMark hm(current);
Handle h_obj; Handle h_obj;
@ -1200,7 +1200,7 @@ JRT_ENTRY(void, InterpreterRuntime::post_field_modification(JavaThread* current,
case dtos: sig_type = JVM_SIGNATURE_DOUBLE; break; case dtos: sig_type = JVM_SIGNATURE_DOUBLE; break;
default: ShouldNotReachHere(); return; default: ShouldNotReachHere(); return;
} }
bool is_static = (obj == NULL); bool is_static = (obj == nullptr);
HandleMark hm(current); HandleMark hm(current);
jfieldID fid = jfieldIDWorkaround::to_jfieldID(ik, cp_entry->f2_as_index(), is_static); jfieldID fid = jfieldIDWorkaround::to_jfieldID(ik, cp_entry->f2_as_index(), is_static);
@ -1265,8 +1265,8 @@ uint64_t InterpreterRuntime::normalize_fast_native_fingerprint(uint64_t fingerpr
address SignatureHandlerLibrary::set_handler_blob() { address SignatureHandlerLibrary::set_handler_blob() {
BufferBlob* handler_blob = BufferBlob::create("native signature handlers", blob_size); BufferBlob* handler_blob = BufferBlob::create("native signature handlers", blob_size);
if (handler_blob == NULL) { if (handler_blob == nullptr) {
return NULL; return nullptr;
} }
address handler = handler_blob->code_begin(); address handler = handler_blob->code_begin();
_handler_blob = handler_blob; _handler_blob = handler_blob;
@ -1275,10 +1275,10 @@ address SignatureHandlerLibrary::set_handler_blob() {
} }
void SignatureHandlerLibrary::initialize() { void SignatureHandlerLibrary::initialize() {
if (_fingerprints != NULL) { if (_fingerprints != nullptr) {
return; return;
} }
if (set_handler_blob() == NULL) { if (set_handler_blob() == nullptr) {
vm_exit_out_of_memory(blob_size, OOM_MALLOC_ERROR, "native signature handlers"); vm_exit_out_of_memory(blob_size, OOM_MALLOC_ERROR, "native signature handlers");
} }
@ -1297,7 +1297,7 @@ address SignatureHandlerLibrary::set_handler(CodeBuffer* buffer) {
// get a new handler blob // get a new handler blob
handler = set_handler_blob(); handler = set_handler_blob();
} }
if (handler != NULL) { if (handler != nullptr) {
memcpy(handler, buffer->insts_begin(), insts_size); memcpy(handler, buffer->insts_begin(), insts_size);
pd_set_handler(handler); pd_set_handler(handler);
ICache::invalidate_range(handler, insts_size); ICache::invalidate_range(handler, insts_size);
@ -1307,7 +1307,7 @@ address SignatureHandlerLibrary::set_handler(CodeBuffer* buffer) {
} }
void SignatureHandlerLibrary::add(const methodHandle& method) { void SignatureHandlerLibrary::add(const methodHandle& method) {
if (method->signature_handler() == NULL) { if (method->signature_handler() == nullptr) {
// use slow signature handler if we can't do better // use slow signature handler if we can't do better
int handler_index = -1; int handler_index = -1;
// check if we can use customized (fast) signature handler // check if we can use customized (fast) signature handler
@ -1330,7 +1330,7 @@ void SignatureHandlerLibrary::add(const methodHandle& method) {
InterpreterRuntime::SignatureHandlerGenerator(method, &buffer).generate(fingerprint); InterpreterRuntime::SignatureHandlerGenerator(method, &buffer).generate(fingerprint);
// copy into code heap // copy into code heap
address handler = set_handler(&buffer); address handler = set_handler(&buffer);
if (handler == NULL) { if (handler == nullptr) {
// use slow signature handler (without memorizing it in the fingerprints) // use slow signature handler (without memorizing it in the fingerprints)
} else { } else {
// debugging support // debugging support
@ -1393,7 +1393,7 @@ void SignatureHandlerLibrary::add(const methodHandle& method) {
// thread which may change the arrays in the above, mutex protected block, we // thread which may change the arrays in the above, mutex protected block, we
// have to protect this read access here with the same mutex as well! // have to protect this read access here with the same mutex as well!
MutexLocker mu(SignatureHandlerLibrary_lock); MutexLocker mu(SignatureHandlerLibrary_lock);
if (_handlers != NULL) { if (_handlers != nullptr) {
handler_index = _handlers->find(method->signature_handler()); handler_index = _handlers->find(method->signature_handler());
uint64_t fingerprint = Fingerprinter(method).fingerprint(); uint64_t fingerprint = Fingerprinter(method).fingerprint();
fingerprint = InterpreterRuntime::normalize_fast_native_fingerprint(fingerprint); fingerprint = InterpreterRuntime::normalize_fast_native_fingerprint(fingerprint);
@ -1437,11 +1437,11 @@ void SignatureHandlerLibrary::add(uint64_t fingerprint, address handler) {
} }
BufferBlob* SignatureHandlerLibrary::_handler_blob = NULL; BufferBlob* SignatureHandlerLibrary::_handler_blob = nullptr;
address SignatureHandlerLibrary::_handler = NULL; address SignatureHandlerLibrary::_handler = nullptr;
GrowableArray<uint64_t>* SignatureHandlerLibrary::_fingerprints = NULL; GrowableArray<uint64_t>* SignatureHandlerLibrary::_fingerprints = nullptr;
GrowableArray<address>* SignatureHandlerLibrary::_handlers = NULL; GrowableArray<address>* SignatureHandlerLibrary::_handlers = nullptr;
address SignatureHandlerLibrary::_buffer = NULL; address SignatureHandlerLibrary::_buffer = nullptr;
JRT_ENTRY(void, InterpreterRuntime::prepare_native_call(JavaThread* current, Method* method)) JRT_ENTRY(void, InterpreterRuntime::prepare_native_call(JavaThread* current, Method* method))
@ -1504,7 +1504,7 @@ JRT_ENTRY(void, InterpreterRuntime::member_name_arg_or_null(JavaThread* current,
} }
current->set_vm_result(member_name_oop); current->set_vm_result(member_name_oop);
} else { } else {
current->set_vm_result(NULL); current->set_vm_result(nullptr);
} }
JRT_END JRT_END
#endif // INCLUDE_JVMTI #endif // INCLUDE_JVMTI

View File

@ -132,7 +132,7 @@ void CallInfo::set_common(Klass* resolved_klass,
// utility query for unreflecting a method // utility query for unreflecting a method
CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass, TRAPS) { CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass, TRAPS) {
Klass* resolved_method_holder = resolved_method->method_holder(); Klass* resolved_method_holder = resolved_method->method_holder();
if (resolved_klass == NULL) { // 2nd argument defaults to holder of 1st if (resolved_klass == nullptr) { // 2nd argument defaults to holder of 1st
resolved_klass = resolved_method_holder; resolved_klass = resolved_method_holder;
} }
_resolved_klass = resolved_klass; _resolved_klass = resolved_klass;
@ -184,7 +184,7 @@ CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass, TRAPS) {
} }
void CallInfo::set_resolved_method_name(TRAPS) { void CallInfo::set_resolved_method_name(TRAPS) {
assert(_resolved_method() != NULL, "Should already have a Method*"); assert(_resolved_method() != nullptr, "Should already have a Method*");
oop rmethod_name = java_lang_invoke_ResolvedMethodName::find_resolved_method(_resolved_method, CHECK); oop rmethod_name = java_lang_invoke_ResolvedMethodName::find_resolved_method(_resolved_method, CHECK);
_resolved_method_name = Handle(THREAD, rmethod_name); _resolved_method_name = Handle(THREAD, rmethod_name);
} }
@ -267,7 +267,7 @@ void LinkInfo::print() {
_resolved_klass->name()->as_C_string(), _resolved_klass->name()->as_C_string(),
_name->as_C_string(), _name->as_C_string(),
_signature->as_C_string(), _signature->as_C_string(),
_current_klass == NULL ? "(none)" : _current_klass->name()->as_C_string(), _current_klass == nullptr ? "(none)" : _current_klass->name()->as_C_string(),
_check_access ? "true" : "false", _check_access ? "true" : "false",
_check_loader_constraints ? "true" : "false"); _check_loader_constraints ? "true" : "false");
@ -295,7 +295,7 @@ void LinkResolver::check_klass_accessibility(Klass* ref_klass, Klass* sel_klass,
InstanceKlass::cast(base_klass), InstanceKlass::cast(base_klass),
vca_result); vca_result);
bool same_module = (base_klass->module() == ref_klass->module()); bool same_module = (base_klass->module() == ref_klass->module());
if (msg == NULL) { if (msg == nullptr) {
Exceptions::fthrow( Exceptions::fthrow(
THREAD_AND_LOCATION, THREAD_AND_LOCATION,
vmSymbols::java_lang_IllegalAccessError(), vmSymbols::java_lang_IllegalAccessError(),
@ -345,31 +345,31 @@ Method* LinkResolver::lookup_method_in_klasses(const LinkInfo& link_info,
// ignore static and non-public methods of java.lang.Object, // ignore static and non-public methods of java.lang.Object,
// like clone and finalize. // like clone and finalize.
if (in_imethod_resolve && if (in_imethod_resolve &&
result != NULL && result != nullptr &&
ik->is_interface() && ik->is_interface() &&
(result->is_static() || !result->is_public()) && (result->is_static() || !result->is_public()) &&
result->method_holder() == vmClasses::Object_klass()) { result->method_holder() == vmClasses::Object_klass()) {
result = NULL; result = nullptr;
} }
// Before considering default methods, check for an overpass in the // Before considering default methods, check for an overpass in the
// current class if a method has not been found. // current class if a method has not been found.
if (result == NULL) { if (result == nullptr) {
result = ik->find_method(name, signature); result = ik->find_method(name, signature);
} }
if (result == NULL) { if (result == nullptr) {
Array<Method*>* default_methods = ik->default_methods(); Array<Method*>* default_methods = ik->default_methods();
if (default_methods != NULL) { if (default_methods != nullptr) {
result = InstanceKlass::find_method(default_methods, name, signature); result = InstanceKlass::find_method(default_methods, name, signature);
} }
} }
if (checkpolymorphism && result != NULL) { if (checkpolymorphism && result != nullptr) {
vmIntrinsics::ID iid = result->intrinsic_id(); vmIntrinsics::ID iid = result->intrinsic_id();
if (MethodHandles::is_signature_polymorphic(iid)) { if (MethodHandles::is_signature_polymorphic(iid)) {
// Do not link directly to these. The VM must produce a synthetic one using lookup_polymorphic_method. // Do not link directly to these. The VM must produce a synthetic one using lookup_polymorphic_method.
return NULL; return nullptr;
} }
} }
return result; return result;
@ -383,7 +383,7 @@ Method* LinkResolver::lookup_instance_method_in_klasses(Klass* klass,
Klass::PrivateLookupMode private_mode) { Klass::PrivateLookupMode private_mode) {
Method* result = klass->uncached_lookup_method(name, signature, Klass::OverpassLookupMode::find, private_mode); Method* result = klass->uncached_lookup_method(name, signature, Klass::OverpassLookupMode::find, private_mode);
while (result != NULL && result->is_static() && result->method_holder()->super() != NULL) { while (result != nullptr && result->is_static() && result->method_holder()->super() != nullptr) {
Klass* super_klass = result->method_holder()->super(); Klass* super_klass = result->method_holder()->super();
result = super_klass->uncached_lookup_method(name, signature, Klass::OverpassLookupMode::find, private_mode); result = super_klass->uncached_lookup_method(name, signature, Klass::OverpassLookupMode::find, private_mode);
} }
@ -393,11 +393,11 @@ Method* LinkResolver::lookup_instance_method_in_klasses(Klass* klass,
return result; return result;
} }
if (result == NULL) { if (result == nullptr) {
Array<Method*>* default_methods = InstanceKlass::cast(klass)->default_methods(); Array<Method*>* default_methods = InstanceKlass::cast(klass)->default_methods();
if (default_methods != NULL) { if (default_methods != nullptr) {
result = InstanceKlass::find_method(default_methods, name, signature); result = InstanceKlass::find_method(default_methods, name, signature);
assert(result == NULL || !result->is_static(), "static defaults not allowed"); assert(result == nullptr || !result->is_static(), "static defaults not allowed");
} }
} }
return result; return result;
@ -446,7 +446,7 @@ Method* LinkResolver::lookup_polymorphic_method(const LinkInfo& link_info,
Method* result = SystemDictionary::find_method_handle_intrinsic(iid, Method* result = SystemDictionary::find_method_handle_intrinsic(iid,
basic_signature, basic_signature,
CHECK_NULL); CHECK_NULL);
if (result != NULL) { if (result != nullptr) {
assert(result->is_method_handle_intrinsic(), "MH.invokeBasic or MH.linkTo* intrinsic"); assert(result->is_method_handle_intrinsic(), "MH.invokeBasic or MH.linkTo* intrinsic");
assert(result->intrinsic_id() != vmIntrinsics::_invokeGeneric, "wrong place to find this"); assert(result->intrinsic_id() != vmIntrinsics::_invokeGeneric, "wrong place to find this");
assert(basic_signature == result->signature(), "predict the result signature"); assert(basic_signature == result->signature(), "predict the result signature");
@ -459,13 +459,13 @@ Method* LinkResolver::lookup_polymorphic_method(const LinkInfo& link_info,
return result; return result;
} else if (iid == vmIntrinsics::_invokeGeneric } else if (iid == vmIntrinsics::_invokeGeneric
&& THREAD->can_call_java() && THREAD->can_call_java()
&& appendix_result_or_null != NULL) { && appendix_result_or_null != nullptr) {
// This is a method with type-checking semantics. // This is a method with type-checking semantics.
// We will ask Java code to spin an adapter method for it. // We will ask Java code to spin an adapter method for it.
if (!MethodHandles::enabled()) { if (!MethodHandles::enabled()) {
// Make sure the Java part of the runtime has been booted up. // Make sure the Java part of the runtime has been booted up.
Klass* natives = vmClasses::MethodHandleNatives_klass(); Klass* natives = vmClasses::MethodHandleNatives_klass();
if (natives == NULL || InstanceKlass::cast(natives)->is_not_initialized()) { if (natives == nullptr || InstanceKlass::cast(natives)->is_not_initialized()) {
SystemDictionary::resolve_or_fail(vmSymbols::java_lang_invoke_MethodHandleNatives(), SystemDictionary::resolve_or_fail(vmSymbols::java_lang_invoke_MethodHandleNatives(),
Handle(), Handle(),
Handle(), Handle(),
@ -488,7 +488,7 @@ Method* LinkResolver::lookup_polymorphic_method(const LinkInfo& link_info,
ls.print(" lookup_polymorphic_method => appendix = "); ls.print(" lookup_polymorphic_method => appendix = ");
appendix.is_null() ? ls.print_cr("(none)") : appendix->print_on(&ls); appendix.is_null() ? ls.print_cr("(none)") : appendix->print_on(&ls);
} }
if (result != NULL) { if (result != nullptr) {
#ifdef ASSERT #ifdef ASSERT
ResourceMark rm(THREAD); ResourceMark rm(THREAD);
@ -508,13 +508,13 @@ Method* LinkResolver::lookup_polymorphic_method(const LinkInfo& link_info,
"%d != %d", actual_size_of_params, expected_size_of_params); "%d != %d", actual_size_of_params, expected_size_of_params);
#endif //ASSERT #endif //ASSERT
assert(appendix_result_or_null != NULL, ""); assert(appendix_result_or_null != nullptr, "");
(*appendix_result_or_null) = appendix; (*appendix_result_or_null) = appendix;
} }
return result; return result;
} }
} }
return NULL; return nullptr;
} }
static void print_nest_host_error_on(stringStream* ss, Klass* ref_klass, Klass* sel_klass) { static void print_nest_host_error_on(stringStream* ss, Klass* ref_klass, Klass* sel_klass) {
@ -524,11 +524,11 @@ static void print_nest_host_error_on(stringStream* ss, Klass* ref_klass, Klass*
InstanceKlass* sel_ik = InstanceKlass::cast(sel_klass); InstanceKlass* sel_ik = InstanceKlass::cast(sel_klass);
const char* nest_host_error_1 = ref_ik->nest_host_error(); const char* nest_host_error_1 = ref_ik->nest_host_error();
const char* nest_host_error_2 = sel_ik->nest_host_error(); const char* nest_host_error_2 = sel_ik->nest_host_error();
if (nest_host_error_1 != NULL || nest_host_error_2 != NULL) { if (nest_host_error_1 != nullptr || nest_host_error_2 != nullptr) {
ss->print(", (%s%s%s)", ss->print(", (%s%s%s)",
(nest_host_error_1 != NULL) ? nest_host_error_1 : "", (nest_host_error_1 != nullptr) ? nest_host_error_1 : "",
(nest_host_error_1 != NULL && nest_host_error_2 != NULL) ? ", " : "", (nest_host_error_1 != nullptr && nest_host_error_2 != nullptr) ? ", " : "",
(nest_host_error_2 != NULL) ? nest_host_error_2 : ""); (nest_host_error_2 != nullptr) ? nest_host_error_2 : "");
} }
} }
@ -557,7 +557,7 @@ void LinkResolver::check_method_accessability(Klass* ref_klass,
new_flags = new_flags | JVM_ACC_PUBLIC; new_flags = new_flags | JVM_ACC_PUBLIC;
flags.set_flags(new_flags); flags.set_flags(new_flags);
} }
// assert(extra_arg_result_or_null != NULL, "must be able to return extra argument"); // assert(extra_arg_result_or_null != nullptr, "must be able to return extra argument");
bool can_access = Reflection::verify_member_access(ref_klass, bool can_access = Reflection::verify_member_access(ref_klass,
resolved_klass, resolved_klass,
@ -631,7 +631,7 @@ Method* LinkResolver::resolve_method_statically(Bytecodes::Code code,
|| ((resolved_klass == vmClasses::MethodHandle_klass() || resolved_klass == vmClasses::VarHandle_klass()) && || ((resolved_klass == vmClasses::MethodHandle_klass() || resolved_klass == vmClasses::VarHandle_klass()) &&
MethodHandles::is_signature_polymorphic_name(resolved_klass, link_info.name()))) { MethodHandles::is_signature_polymorphic_name(resolved_klass, link_info.name()))) {
Method* result = ConstantPool::method_at_if_loaded(pool, index); Method* result = ConstantPool::method_at_if_loaded(pool, index);
if (result != NULL) { if (result != nullptr) {
return result; return result;
} }
} }
@ -657,16 +657,16 @@ void LinkResolver::check_method_loader_constraints(const LinkInfo& link_info,
ResourceMark rm(THREAD); ResourceMark rm(THREAD);
Symbol* failed_type_symbol = Symbol* failed_type_symbol =
SystemDictionary::check_signature_loaders(link_info.signature(), SystemDictionary::check_signature_loaders(link_info.signature(),
/*klass_being_linked*/ NULL, // We are not linking class /*klass_being_linked*/ nullptr, // We are not linking class
current_loader, current_loader,
resolved_loader, true); resolved_loader, true);
if (failed_type_symbol != NULL) { if (failed_type_symbol != nullptr) {
Klass* current_class = link_info.current_klass(); Klass* current_class = link_info.current_klass();
ClassLoaderData* current_loader_data = current_class->class_loader_data(); ClassLoaderData* current_loader_data = current_class->class_loader_data();
assert(current_loader_data != NULL, "current class has no class loader data"); assert(current_loader_data != nullptr, "current class has no class loader data");
Klass* resolved_method_class = resolved_method->method_holder(); Klass* resolved_method_class = resolved_method->method_holder();
ClassLoaderData* target_loader_data = resolved_method_class->class_loader_data(); ClassLoaderData* target_loader_data = resolved_method_class->class_loader_data();
assert(target_loader_data != NULL, "resolved method's class has no class loader data"); assert(target_loader_data != nullptr, "resolved method's class has no class loader data");
stringStream ss; stringStream ss;
ss.print("loader constraint violation: when resolving %s '", method_type); ss.print("loader constraint violation: when resolving %s '", method_type);
@ -694,10 +694,10 @@ void LinkResolver::check_field_loader_constraints(Symbol* field, Symbol* sig,
ResourceMark rm(THREAD); // needed for check_signature_loaders ResourceMark rm(THREAD); // needed for check_signature_loaders
Symbol* failed_type_symbol = Symbol* failed_type_symbol =
SystemDictionary::check_signature_loaders(sig, SystemDictionary::check_signature_loaders(sig,
/*klass_being_linked*/ NULL, // We are not linking class /*klass_being_linked*/ nullptr, // We are not linking class
ref_loader, sel_loader, ref_loader, sel_loader,
false); false);
if (failed_type_symbol != NULL) { if (failed_type_symbol != nullptr) {
stringStream ss; stringStream ss;
const char* failed_type_name = failed_type_symbol->as_klass_external_name(); const char* failed_type_name = failed_type_symbol->as_klass_external_name();
@ -753,7 +753,7 @@ Method* LinkResolver::resolve_method(const LinkInfo& link_info,
if (resolved_method.is_null()) { if (resolved_method.is_null()) {
// JSR 292: see if this is an implicitly generated method MethodHandle.linkToVirtual(*...), etc // JSR 292: see if this is an implicitly generated method MethodHandle.linkToVirtual(*...), etc
Method* method = lookup_polymorphic_method(link_info, (Handle*)NULL, THREAD); Method* method = lookup_polymorphic_method(link_info, (Handle*)nullptr, THREAD);
resolved_method = methodHandle(THREAD, method); resolved_method = methodHandle(THREAD, method);
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
nested_exception = Handle(THREAD, PENDING_EXCEPTION); nested_exception = Handle(THREAD, PENDING_EXCEPTION);
@ -770,13 +770,13 @@ Method* LinkResolver::resolve_method(const LinkInfo& link_info,
Method::print_external_name(&ss, resolved_klass, link_info.name(), link_info.signature()); Method::print_external_name(&ss, resolved_klass, link_info.name(), link_info.signature());
ss.print("'"); ss.print("'");
THROW_MSG_CAUSE_(vmSymbols::java_lang_NoSuchMethodError(), THROW_MSG_CAUSE_(vmSymbols::java_lang_NoSuchMethodError(),
ss.as_string(), nested_exception, NULL); ss.as_string(), nested_exception, nullptr);
} }
// 6. access checks, access checking may be turned off when calling from within the VM. // 6. access checks, access checking may be turned off when calling from within the VM.
Klass* current_klass = link_info.current_klass(); Klass* current_klass = link_info.current_klass();
if (link_info.check_access()) { if (link_info.check_access()) {
assert(current_klass != NULL , "current_klass should not be null"); assert(current_klass != nullptr , "current_klass should not be null");
// check if method can be accessed by the referring class // check if method can be accessed by the referring class
check_method_accessability(current_klass, check_method_accessability(current_klass,
@ -813,7 +813,7 @@ static void trace_method_resolution(const char* prefix,
} }
st->print("%s%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ", st->print("%s%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ",
prefix, prefix,
(klass == NULL ? "<NULL>" : klass->internal_name()), (klass == nullptr ? "<nullptr>" : klass->internal_name()),
resolved_klass->internal_name(), resolved_klass->internal_name(),
Method::name_and_sig_as_C_string(resolved_klass, Method::name_and_sig_as_C_string(resolved_klass,
method->name(), method->name(),
@ -873,7 +873,7 @@ Method* LinkResolver::resolve_interface_method(const LinkInfo& link_info, Byteco
// JDK8 adds non-public interface methods, and accessability check requirement // JDK8 adds non-public interface methods, and accessability check requirement
Klass* current_klass = link_info.current_klass(); Klass* current_klass = link_info.current_klass();
assert(current_klass != NULL , "current_klass should not be null"); assert(current_klass != nullptr , "current_klass should not be null");
// check if method can be accessed by the referring class // check if method can be accessed by the referring class
check_method_accessability(current_klass, check_method_accessability(current_klass,
@ -973,7 +973,7 @@ void LinkResolver::resolve_field(fieldDescriptor& fd,
// Resolve instance field // Resolve instance field
Klass* sel_klass = resolved_klass->find_field(field, sig, &fd); Klass* sel_klass = resolved_klass->find_field(field, sig, &fd);
// check if field exists; i.e., if a klass containing the field def has been selected // check if field exists; i.e., if a klass containing the field def has been selected
if (sel_klass == NULL) { if (sel_klass == nullptr) {
ResourceMark rm(THREAD); ResourceMark rm(THREAD);
stringStream ss; stringStream ss;
ss.print("Class %s does not have member field '", resolved_klass->external_name()); ss.print("Class %s does not have member field '", resolved_klass->external_name());
@ -1014,7 +1014,7 @@ void LinkResolver::resolve_field(fieldDescriptor& fd,
if (fd.constants()->pool_holder()->major_version() >= 53) { if (fd.constants()->pool_holder()->major_version() >= 53) {
Method* m = link_info.current_method(); Method* m = link_info.current_method();
assert(m != NULL, "information about the current method must be available for 'put' bytecodes"); assert(m != nullptr, "information about the current method must be available for 'put' bytecodes");
bool is_initialized_static_final_update = (byte == Bytecodes::_putstatic && bool is_initialized_static_final_update = (byte == Bytecodes::_putstatic &&
fd.is_static() && fd.is_static() &&
!m->is_static_initializer()); !m->is_static_initializer());
@ -1045,7 +1045,7 @@ void LinkResolver::resolve_field(fieldDescriptor& fd,
} }
} }
if (link_info.check_loader_constraints() && (sel_klass != current_klass) && (current_klass != NULL)) { if (link_info.check_loader_constraints() && (sel_klass != current_klass) && (current_klass != nullptr)) {
check_field_loader_constraints(field, sig, current_klass, sel_klass, CHECK); check_field_loader_constraints(field, sig, current_klass, sel_klass, CHECK);
} }
@ -1085,7 +1085,7 @@ void LinkResolver::resolve_static_call(CallInfo& result,
} }
if (resolved_method->is_continuation_native_intrinsic() if (resolved_method->is_continuation_native_intrinsic()
&& resolved_method->from_interpreted_entry() == NULL) { // does a load_acquire && resolved_method->from_interpreted_entry() == nullptr) { // does a load_acquire
methodHandle mh(THREAD, resolved_method); methodHandle mh(THREAD, resolved_method);
// Generate a compiled form of the enterSpecial intrinsic. // Generate a compiled form of the enterSpecial intrinsic.
AdapterHandlerLibrary::create_native_wrapper(mh); AdapterHandlerLibrary::create_native_wrapper(mh);
@ -1139,7 +1139,7 @@ Method* LinkResolver::linktime_resolve_special_method(const LinkInfo& link_info,
// and the selected method is recalculated relative to the direct superclass // and the selected method is recalculated relative to the direct superclass
// superinterface.method, which explicitly does not check shadowing // superinterface.method, which explicitly does not check shadowing
Klass* resolved_klass = link_info.resolved_klass(); Klass* resolved_klass = link_info.resolved_klass();
Method* resolved_method = NULL; Method* resolved_method = nullptr;
if (!resolved_klass->is_interface()) { if (!resolved_klass->is_interface()) {
resolved_method = resolve_method(link_info, Bytecodes::_invokespecial, CHECK_NULL); resolved_method = resolve_method(link_info, Bytecodes::_invokespecial, CHECK_NULL);
@ -1161,13 +1161,13 @@ Method* LinkResolver::linktime_resolve_special_method(const LinkInfo& link_info,
THREAD_AND_LOCATION, THREAD_AND_LOCATION,
vmSymbols::java_lang_NoSuchMethodError(), vmSymbols::java_lang_NoSuchMethodError(),
"%s", ss.as_string()); "%s", ss.as_string());
return NULL; return nullptr;
} }
// ensure that invokespecial's interface method reference is in // ensure that invokespecial's interface method reference is in
// a direct superinterface, not an indirect superinterface // a direct superinterface, not an indirect superinterface
Klass* current_klass = link_info.current_klass(); Klass* current_klass = link_info.current_klass();
if (current_klass != NULL && resolved_klass->is_interface()) { if (current_klass != nullptr && resolved_klass->is_interface()) {
InstanceKlass* klass_to_check = InstanceKlass::cast(current_klass); InstanceKlass* klass_to_check = InstanceKlass::cast(current_klass);
// Disable verification for the dynamically-generated reflection bytecodes. // Disable verification for the dynamically-generated reflection bytecodes.
bool is_reflect = klass_to_check->is_subclass_of( bool is_reflect = klass_to_check->is_subclass_of(
@ -1332,7 +1332,7 @@ Method* LinkResolver::linktime_resolve_virtual_method(const LinkInfo& link_info,
ss.print("private interface method requires invokespecial, not invokevirtual: method '"); ss.print("private interface method requires invokespecial, not invokevirtual: method '");
resolved_method->print_external_name(&ss); resolved_method->print_external_name(&ss);
ss.print("', caller-class: %s", ss.print("', caller-class: %s",
(current_klass == NULL ? "<null>" : current_klass->internal_name())); (current_klass == nullptr ? "<null>" : current_klass->internal_name()));
THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), ss.as_string()); THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), ss.as_string());
} }
@ -1542,7 +1542,7 @@ Method* LinkResolver::linktime_resolve_interface_method_or_null(
Method* method_result = linktime_resolve_interface_method(link_info, THREAD); Method* method_result = linktime_resolve_interface_method(link_info, THREAD);
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
CLEAR_PENDING_EXCEPTION; CLEAR_PENDING_EXCEPTION;
return NULL; return nullptr;
} else { } else {
return method_result; return method_result;
} }
@ -1554,7 +1554,7 @@ Method* LinkResolver::linktime_resolve_virtual_method_or_null(
Method* method_result = linktime_resolve_virtual_method(link_info, THREAD); Method* method_result = linktime_resolve_virtual_method(link_info, THREAD);
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
CLEAR_PENDING_EXCEPTION; CLEAR_PENDING_EXCEPTION;
return NULL; return nullptr;
} else { } else {
return method_result; return method_result;
} }
@ -1568,7 +1568,7 @@ Method* LinkResolver::resolve_virtual_call_or_null(
resolve_virtual_call(info, Handle(), receiver_klass, link_info, false, THREAD); resolve_virtual_call(info, Handle(), receiver_klass, link_info, false, THREAD);
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
CLEAR_PENDING_EXCEPTION; CLEAR_PENDING_EXCEPTION;
return NULL; return nullptr;
} }
return info.selected_method(); return info.selected_method();
} }
@ -1581,7 +1581,7 @@ Method* LinkResolver::resolve_interface_call_or_null(
resolve_interface_call(info, Handle(), receiver_klass, link_info, false, THREAD); resolve_interface_call(info, Handle(), receiver_klass, link_info, false, THREAD);
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
CLEAR_PENDING_EXCEPTION; CLEAR_PENDING_EXCEPTION;
return NULL; return nullptr;
} }
return info.selected_method(); return info.selected_method();
} }
@ -1605,7 +1605,7 @@ Method* LinkResolver::resolve_static_call_or_null(const LinkInfo& link_info) {
resolve_static_call(info, link_info, /*initialize_class*/false, THREAD); resolve_static_call(info, link_info, /*initialize_class*/false, THREAD);
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
CLEAR_PENDING_EXCEPTION; CLEAR_PENDING_EXCEPTION;
return NULL; return nullptr;
} }
return info.selected_method(); return info.selected_method();
} }
@ -1616,7 +1616,7 @@ Method* LinkResolver::resolve_special_call_or_null(const LinkInfo& link_info) {
resolve_special_call(info, Handle(), link_info, THREAD); resolve_special_call(info, Handle(), link_info, THREAD);
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
CLEAR_PENDING_EXCEPTION; CLEAR_PENDING_EXCEPTION;
return NULL; return nullptr;
} }
return info.selected_method(); return info.selected_method();
} }
@ -1685,14 +1685,14 @@ void LinkResolver::resolve_invokevirtual(CallInfo& result, Handle recv,
TRAPS) { TRAPS) {
LinkInfo link_info(pool, index, CHECK); LinkInfo link_info(pool, index, CHECK);
Klass* recvrKlass = recv.is_null() ? (Klass*)NULL : recv->klass(); Klass* recvrKlass = recv.is_null() ? (Klass*)nullptr : recv->klass();
resolve_virtual_call(result, recv, recvrKlass, link_info, /*check_null_or_abstract*/true, CHECK); resolve_virtual_call(result, recv, recvrKlass, link_info, /*check_null_or_abstract*/true, CHECK);
} }
void LinkResolver::resolve_invokeinterface(CallInfo& result, Handle recv, const constantPoolHandle& pool, int index, TRAPS) { void LinkResolver::resolve_invokeinterface(CallInfo& result, Handle recv, const constantPoolHandle& pool, int index, TRAPS) {
LinkInfo link_info(pool, index, CHECK); LinkInfo link_info(pool, index, CHECK);
Klass* recvrKlass = recv.is_null() ? (Klass*)NULL : recv->klass(); Klass* recvrKlass = recv.is_null() ? (Klass*)nullptr : recv->klass();
resolve_interface_call(result, recv, recvrKlass, link_info, true, CHECK); resolve_interface_call(result, recv, recvrKlass, link_info, true, CHECK);
} }
@ -1746,7 +1746,7 @@ void LinkResolver::resolve_handle_call(CallInfo& result,
assert(iid == vmIntrinsicID::_invokeBasic, "%s", vmIntrinsics::name_at(iid)); assert(iid == vmIntrinsicID::_invokeBasic, "%s", vmIntrinsics::name_at(iid));
Klass* current_klass = link_info.current_klass(); Klass* current_klass = link_info.current_klass();
assert(current_klass != NULL , "current_klass should not be null"); assert(current_klass != nullptr , "current_klass should not be null");
check_method_accessability(current_klass, check_method_accessability(current_klass,
resolved_klass, resolved_klass,
resolved_method->method_holder(), resolved_method->method_holder(),
@ -1852,7 +1852,7 @@ void LinkResolver::throw_abstract_method_error(const methodHandle& resolved_meth
ResourceMark rm(THREAD); ResourceMark rm(THREAD);
stringStream ss; stringStream ss;
if (recv_klass != NULL) { if (recv_klass != nullptr) {
ss.print("Receiver class %s does not define or inherit an " ss.print("Receiver class %s does not define or inherit an "
"implementation of the", "implementation of the",
recv_klass->external_name()); recv_klass->external_name());

View File

@ -347,7 +347,7 @@ class LinkResolver: AllStatic {
// Only resolved method known. // Only resolved method known.
static void throw_abstract_method_error(const methodHandle& resolved_method, TRAPS) { static void throw_abstract_method_error(const methodHandle& resolved_method, TRAPS) {
throw_abstract_method_error(resolved_method, methodHandle(), NULL, CHECK); throw_abstract_method_error(resolved_method, methodHandle(), nullptr, CHECK);
} }
// Resolved method and receiver klass know. // Resolved method and receiver klass know.
static void throw_abstract_method_error(const methodHandle& resolved_method, Klass *recv_klass, TRAPS) { static void throw_abstract_method_error(const methodHandle& resolved_method, Klass *recv_klass, TRAPS) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -60,7 +60,7 @@ class OopMapCacheEntry: private InterpreterOopMap {
public: public:
OopMapCacheEntry() : InterpreterOopMap() { OopMapCacheEntry() : InterpreterOopMap() {
_next = NULL; _next = nullptr;
#ifdef ASSERT #ifdef ASSERT
_resource_allocate_bit_mask = false; _resource_allocate_bit_mask = false;
#endif #endif
@ -190,15 +190,15 @@ InterpreterOopMap::~InterpreterOopMap() {
} }
bool InterpreterOopMap::is_empty() const { bool InterpreterOopMap::is_empty() const {
bool result = _method == NULL; bool result = _method == nullptr;
assert(_method != NULL || (_bci == 0 && assert(_method != nullptr || (_bci == 0 &&
(_mask_size == 0 || _mask_size == USHRT_MAX) && (_mask_size == 0 || _mask_size == USHRT_MAX) &&
_bit_mask[0] == 0), "Should be completely empty"); _bit_mask[0] == 0), "Should be completely empty");
return result; return result;
} }
void InterpreterOopMap::initialize() { void InterpreterOopMap::initialize() {
_method = NULL; _method = nullptr;
_mask_size = USHRT_MAX; // This value should cause a failure quickly _mask_size = USHRT_MAX; // This value should cause a failure quickly
_bci = 0; _bci = 0;
_expression_stack_size = 0; _expression_stack_size = 0;
@ -443,16 +443,16 @@ inline unsigned int OopMapCache::hash_value_for(const methodHandle& method, int
^ ((unsigned int) method->size_of_parameters() << 6); ^ ((unsigned int) method->size_of_parameters() << 6);
} }
OopMapCacheEntry* volatile OopMapCache::_old_entries = NULL; OopMapCacheEntry* volatile OopMapCache::_old_entries = nullptr;
OopMapCache::OopMapCache() { OopMapCache::OopMapCache() {
_array = NEW_C_HEAP_ARRAY(OopMapCacheEntry*, _size, mtClass); _array = NEW_C_HEAP_ARRAY(OopMapCacheEntry*, _size, mtClass);
for(int i = 0; i < _size; i++) _array[i] = NULL; for(int i = 0; i < _size; i++) _array[i] = nullptr;
} }
OopMapCache::~OopMapCache() { OopMapCache::~OopMapCache() {
assert(_array != NULL, "sanity check"); assert(_array != nullptr, "sanity check");
// Deallocate oop maps that are allocated out-of-line // Deallocate oop maps that are allocated out-of-line
flush(); flush();
// Deallocate array // Deallocate array
@ -470,8 +470,8 @@ bool OopMapCache::put_at(int i, OopMapCacheEntry* entry, OopMapCacheEntry* old)
void OopMapCache::flush() { void OopMapCache::flush() {
for (int i = 0; i < _size; i++) { for (int i = 0; i < _size; i++) {
OopMapCacheEntry* entry = _array[i]; OopMapCacheEntry* entry = _array[i];
if (entry != NULL) { if (entry != nullptr) {
_array[i] = NULL; // no barrier, only called in OopMapCache destructor _array[i] = nullptr; // no barrier, only called in OopMapCache destructor
entry->flush(); entry->flush();
FREE_C_HEAP_OBJ(entry); FREE_C_HEAP_OBJ(entry);
} }
@ -482,7 +482,7 @@ void OopMapCache::flush_obsolete_entries() {
assert(SafepointSynchronize::is_at_safepoint(), "called by RedefineClasses in a safepoint"); assert(SafepointSynchronize::is_at_safepoint(), "called by RedefineClasses in a safepoint");
for (int i = 0; i < _size; i++) { for (int i = 0; i < _size; i++) {
OopMapCacheEntry* entry = _array[i]; OopMapCacheEntry* entry = _array[i];
if (entry != NULL && !entry->is_empty() && entry->method()->is_old()) { if (entry != nullptr && !entry->is_empty() && entry->method()->is_old()) {
// Cache entry is occupied by an old redefined method and we don't want // Cache entry is occupied by an old redefined method and we don't want
// to pin it down so flush the entry. // to pin it down so flush the entry.
if (log_is_enabled(Debug, redefine, class, oopmap)) { if (log_is_enabled(Debug, redefine, class, oopmap)) {
@ -491,7 +491,7 @@ void OopMapCache::flush_obsolete_entries() {
("flush: %s(%s): cached entry @%d", ("flush: %s(%s): cached entry @%d",
entry->method()->name()->as_C_string(), entry->method()->signature()->as_C_string(), i); entry->method()->name()->as_C_string(), entry->method()->signature()->as_C_string(), i);
} }
_array[i] = NULL; _array[i] = nullptr;
entry->flush(); entry->flush();
FREE_C_HEAP_OBJ(entry); FREE_C_HEAP_OBJ(entry);
} }
@ -506,7 +506,7 @@ void OopMapCache::lookup(const methodHandle& method,
assert(SafepointSynchronize::is_at_safepoint(), "called by GC in a safepoint"); assert(SafepointSynchronize::is_at_safepoint(), "called by GC in a safepoint");
int probe = hash_value_for(method, bci); int probe = hash_value_for(method, bci);
int i; int i;
OopMapCacheEntry* entry = NULL; OopMapCacheEntry* entry = nullptr;
if (log_is_enabled(Debug, interpreter, oopmap)) { if (log_is_enabled(Debug, interpreter, oopmap)) {
static int count = 0; static int count = 0;
@ -519,7 +519,7 @@ void OopMapCache::lookup(const methodHandle& method,
// Search hashtable for match // Search hashtable for match
for(i = 0; i < _probe_depth; i++) { for(i = 0; i < _probe_depth; i++) {
entry = entry_at(probe + i); entry = entry_at(probe + i);
if (entry != NULL && !entry->is_empty() && entry->match(method, bci)) { if (entry != nullptr && !entry->is_empty() && entry->match(method, bci)) {
entry_for->resource_copy(entry); entry_for->resource_copy(entry);
assert(!entry_for->is_empty(), "A non-empty oop map should be returned"); assert(!entry_for->is_empty(), "A non-empty oop map should be returned");
log_debug(interpreter, oopmap)("- found at hash %d", probe + i); log_debug(interpreter, oopmap)("- found at hash %d", probe + i);
@ -547,8 +547,8 @@ void OopMapCache::lookup(const methodHandle& method,
// First search for an empty slot // First search for an empty slot
for(i = 0; i < _probe_depth; i++) { for(i = 0; i < _probe_depth; i++) {
entry = entry_at(probe + i); entry = entry_at(probe + i);
if (entry == NULL) { if (entry == nullptr) {
if (put_at(probe + i, tmp, NULL)) { if (put_at(probe + i, tmp, nullptr)) {
assert(!entry_for->is_empty(), "A non-empty oop map should be returned"); assert(!entry_for->is_empty(), "A non-empty oop map should be returned");
return; return;
} }
@ -590,8 +590,8 @@ void OopMapCache::enqueue_for_cleanup(OopMapCacheEntry* entry) {
// list, so no synchronization needed. // list, so no synchronization needed.
void OopMapCache::cleanup_old_entries() { void OopMapCache::cleanup_old_entries() {
OopMapCacheEntry* entry = _old_entries; OopMapCacheEntry* entry = _old_entries;
_old_entries = NULL; _old_entries = nullptr;
while (entry != NULL) { while (entry != nullptr) {
if (log_is_enabled(Debug, interpreter, oopmap)) { if (log_is_enabled(Debug, interpreter, oopmap)) {
ResourceMark rm; ResourceMark rm;
log_debug(interpreter, oopmap)("cleanup entry %s at bci %d", log_debug(interpreter, oopmap)("cleanup entry %s at bci %d",

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -127,7 +127,7 @@ void Rewriter::make_constant_pool_cache(TRAPS) {
// Clean up constant pool cache if initialize_resolved_references() failed. // Clean up constant pool cache if initialize_resolved_references() failed.
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
MetadataFactory::free_metadata(loader_data, cache); MetadataFactory::free_metadata(loader_data, cache);
_pool->set_cache(NULL); // so the verifier isn't confused _pool->set_cache(nullptr); // so the verifier isn't confused
} }
} }
@ -457,7 +457,7 @@ void Rewriter::scan_method(Thread* thread, Method* method, bool reverse, bool* i
Symbol* field_sig = cp->signature_ref_at(bc_index); Symbol* field_sig = cp->signature_ref_at(bc_index);
fieldDescriptor fd; fieldDescriptor fd;
if (klass->find_field(field_name, field_sig, &fd) != NULL) { if (klass->find_field(field_name, field_sig, &fd) != nullptr) {
if (fd.access_flags().is_final()) { if (fd.access_flags().is_final()) {
if (fd.access_flags().is_static()) { if (fd.access_flags().is_static()) {
if (!method->is_static_initializer()) { if (!method->is_static_initializer()) {
@ -530,7 +530,7 @@ methodHandle Rewriter::rewrite_jsrs(const methodHandle& method, TRAPS) {
} }
void Rewriter::rewrite_bytecodes(TRAPS) { void Rewriter::rewrite_bytecodes(TRAPS) {
assert(_pool->cache() == NULL, "constant pool cache must not be set yet"); assert(_pool->cache() == nullptr, "constant pool cache must not be set yet");
// determine index maps for Method* rewriting // determine index maps for Method* rewriting
compute_index_maps(); compute_index_maps();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -40,7 +40,7 @@
void TemplateInterpreter::initialize_stub() { void TemplateInterpreter::initialize_stub() {
// assertions // assertions
assert(_code == NULL, "must only initialize once"); assert(_code == nullptr, "must only initialize once");
assert((int)Bytecodes::number_of_codes <= (int)DispatchTable::length, assert((int)Bytecodes::number_of_codes <= (int)DispatchTable::length,
"dispatch table too small"); "dispatch table too small");
@ -51,7 +51,7 @@ void TemplateInterpreter::initialize_stub() {
// plus their code section is aligned to CodeEntryAlignement. So we need additional size due to alignment. // plus their code section is aligned to CodeEntryAlignement. So we need additional size due to alignment.
int max_aligned_codelets = 280; int max_aligned_codelets = 280;
int max_aligned_bytes = max_aligned_codelets * (HeapWordSize + CodeEntryAlignment); int max_aligned_bytes = max_aligned_codelets * (HeapWordSize + CodeEntryAlignment);
_code = new StubQueue(new InterpreterCodeletInterface, code_size + max_aligned_bytes, NULL, _code = new StubQueue(new InterpreterCodeletInterface, code_size + max_aligned_bytes, nullptr,
"Interpreter"); "Interpreter");
} }
@ -82,16 +82,16 @@ void TemplateInterpreter::initialize_code() {
EntryPoint::EntryPoint() { EntryPoint::EntryPoint() {
assert(number_of_states == 10, "check the code below"); assert(number_of_states == 10, "check the code below");
_entry[btos] = NULL; _entry[btos] = nullptr;
_entry[ztos] = NULL; _entry[ztos] = nullptr;
_entry[ctos] = NULL; _entry[ctos] = nullptr;
_entry[stos] = NULL; _entry[stos] = nullptr;
_entry[atos] = NULL; _entry[atos] = nullptr;
_entry[itos] = NULL; _entry[itos] = nullptr;
_entry[ltos] = NULL; _entry[ltos] = nullptr;
_entry[ftos] = NULL; _entry[ftos] = nullptr;
_entry[dtos] = NULL; _entry[dtos] = nullptr;
_entry[vtos] = NULL; _entry[vtos] = nullptr;
} }
@ -200,17 +200,17 @@ bool DispatchTable::operator == (DispatchTable& y) {
return true; return true;
} }
address TemplateInterpreter::_remove_activation_entry = NULL; address TemplateInterpreter::_remove_activation_entry = nullptr;
address TemplateInterpreter::_remove_activation_preserving_args_entry = NULL; address TemplateInterpreter::_remove_activation_preserving_args_entry = nullptr;
address TemplateInterpreter::_throw_ArrayIndexOutOfBoundsException_entry = NULL; address TemplateInterpreter::_throw_ArrayIndexOutOfBoundsException_entry = nullptr;
address TemplateInterpreter::_throw_ArrayStoreException_entry = NULL; address TemplateInterpreter::_throw_ArrayStoreException_entry = nullptr;
address TemplateInterpreter::_throw_ArithmeticException_entry = NULL; address TemplateInterpreter::_throw_ArithmeticException_entry = nullptr;
address TemplateInterpreter::_throw_ClassCastException_entry = NULL; address TemplateInterpreter::_throw_ClassCastException_entry = nullptr;
address TemplateInterpreter::_throw_NullPointerException_entry = NULL; address TemplateInterpreter::_throw_NullPointerException_entry = nullptr;
address TemplateInterpreter::_throw_StackOverflowError_entry = NULL; address TemplateInterpreter::_throw_StackOverflowError_entry = nullptr;
address TemplateInterpreter::_throw_exception_entry = NULL; address TemplateInterpreter::_throw_exception_entry = nullptr;
#ifndef PRODUCT #ifndef PRODUCT
EntryPoint TemplateInterpreter::_trace_code; EntryPoint TemplateInterpreter::_trace_code;
@ -250,7 +250,7 @@ address* TemplateInterpreter::invoke_return_entry_table_for(Bytecodes::Code code
return Interpreter::invokedynamic_return_entry_table(); return Interpreter::invokedynamic_return_entry_table();
default: default:
fatal("invalid bytecode: %s", Bytecodes::name(code)); fatal("invalid bytecode: %s", Bytecodes::name(code));
return NULL; return nullptr;
} }
} }
@ -273,7 +273,7 @@ address TemplateInterpreter::return_entry(TosState state, int length, Bytecodes:
default: default:
assert(!Bytecodes::is_invoke(code), "invoke instructions should be handled separately: %s", Bytecodes::name(code)); assert(!Bytecodes::is_invoke(code), "invoke instructions should be handled separately: %s", Bytecodes::name(code));
address entry = _return_entry[length].entry(state); address entry = _return_entry[length].entry(state);
vmassert(entry != NULL, "unsupported return entry requested, length=%d state=%d", length, index); vmassert(entry != nullptr, "unsupported return entry requested, length=%d state=%d", length, index);
return entry; return entry;
} }
} }
@ -282,7 +282,7 @@ address TemplateInterpreter::return_entry(TosState state, int length, Bytecodes:
address TemplateInterpreter::deopt_entry(TosState state, int length) { address TemplateInterpreter::deopt_entry(TosState state, int length) {
guarantee(0 <= length && length < Interpreter::number_of_deopt_entries, "illegal length"); guarantee(0 <= length && length < Interpreter::number_of_deopt_entries, "illegal length");
address entry = _deopt_entry[length].entry(state); address entry = _deopt_entry[length].entry(state);
vmassert(entry != NULL, "unsupported deopt entry requested, length=%d state=%d", length, TosState_as_index(state)); vmassert(entry != nullptr, "unsupported deopt entry requested, length=%d state=%d", length, TosState_as_index(state));
return entry; return entry;
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -138,7 +138,7 @@ class TemplateInterpreter: public AbstractInterpreter {
static void initialize_stub(); static void initialize_stub();
static void initialize_code(); static void initialize_code();
// this only returns whether a pc is within generated code for the interpreter. // this only returns whether a pc is within generated code for the interpreter.
static bool contains(address pc) { return _code != NULL && _code->contains(pc); } static bool contains(address pc) { return _code != nullptr && _code->contains(pc); }
// Debugging/printing // Debugging/printing
static InterpreterCodelet* codelet_containing(address pc); static InterpreterCodelet* codelet_containing(address pc);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -35,8 +35,8 @@
#define __ Disassembler::hook<InterpreterMacroAssembler>(__FILE__, __LINE__, _masm)-> #define __ Disassembler::hook<InterpreterMacroAssembler>(__FILE__, __LINE__, _masm)->
TemplateInterpreterGenerator::TemplateInterpreterGenerator(): AbstractInterpreterGenerator() { TemplateInterpreterGenerator::TemplateInterpreterGenerator(): AbstractInterpreterGenerator() {
_unimplemented_bytecode = NULL; _unimplemented_bytecode = nullptr;
_illegal_bytecode_sequence = NULL; _illegal_bytecode_sequence = nullptr;
generate_all(); generate_all();
} }
@ -171,7 +171,7 @@ void TemplateInterpreterGenerator::generate_all() {
Interpreter::_throw_ArrayStoreException_entry = generate_klass_exception_handler("java/lang/ArrayStoreException"); Interpreter::_throw_ArrayStoreException_entry = generate_klass_exception_handler("java/lang/ArrayStoreException");
Interpreter::_throw_ArithmeticException_entry = generate_exception_handler("java/lang/ArithmeticException", "/ by zero"); Interpreter::_throw_ArithmeticException_entry = generate_exception_handler("java/lang/ArithmeticException", "/ by zero");
Interpreter::_throw_ClassCastException_entry = generate_ClassCastException_handler(); Interpreter::_throw_ClassCastException_entry = generate_ClassCastException_handler();
Interpreter::_throw_NullPointerException_entry = generate_exception_handler("java/lang/NullPointerException", NULL); Interpreter::_throw_NullPointerException_entry = generate_exception_handler("java/lang/NullPointerException", nullptr);
Interpreter::_throw_StackOverflowError_entry = generate_StackOverflowError_handler(); Interpreter::_throw_StackOverflowError_entry = generate_StackOverflowError_handler();
} }
@ -247,7 +247,7 @@ void TemplateInterpreterGenerator::generate_all() {
); );
} }
address return_continuation = Interpreter::_normal_table.entry(Bytecodes::_return).entry(vtos); address return_continuation = Interpreter::_normal_table.entry(Bytecodes::_return).entry(vtos);
vmassert(return_continuation != NULL, "return entry not generated yet"); vmassert(return_continuation != nullptr, "return entry not generated yet");
Interpreter::_deopt_reexecute_return_entry = generate_deopt_entry_for(vtos, 0, return_continuation); Interpreter::_deopt_reexecute_return_entry = generate_deopt_entry_for(vtos, 0, return_continuation);
} }
@ -295,8 +295,8 @@ void TemplateInterpreterGenerator::set_unimplemented(int i) {
void TemplateInterpreterGenerator::set_entry_points(Bytecodes::Code code) { void TemplateInterpreterGenerator::set_entry_points(Bytecodes::Code code) {
CodeletMark cm(_masm, Bytecodes::name(code), code); CodeletMark cm(_masm, Bytecodes::name(code), code);
// initialize entry points // initialize entry points
assert(_unimplemented_bytecode != NULL, "should have been generated before"); assert(_unimplemented_bytecode != nullptr, "should have been generated before");
assert(_illegal_bytecode_sequence != NULL, "should have been generated before"); assert(_illegal_bytecode_sequence != nullptr, "should have been generated before");
address bep = _illegal_bytecode_sequence; address bep = _illegal_bytecode_sequence;
address zep = _illegal_bytecode_sequence; address zep = _illegal_bytecode_sequence;
address cep = _illegal_bytecode_sequence; address cep = _illegal_bytecode_sequence;
@ -398,7 +398,7 @@ address TemplateInterpreterGenerator::generate_method_entry(
// determine code generation flags // determine code generation flags
bool native = false; bool native = false;
bool synchronized = false; bool synchronized = false;
address entry_point = NULL; address entry_point = nullptr;
switch (kind) { switch (kind) {
case Interpreter::zerolocals : break; case Interpreter::zerolocals : break;
@ -469,12 +469,12 @@ address TemplateInterpreterGenerator::generate_method_entry(
// We expect the normal and native entry points to be generated first so we can reuse them. // We expect the normal and native entry points to be generated first so we can reuse them.
if (native) { if (native) {
entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native);
if (entry_point == NULL) { if (entry_point == nullptr) {
entry_point = generate_native_entry(synchronized); entry_point = generate_native_entry(synchronized);
} }
} else { } else {
entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals);
if (entry_point == NULL) { if (entry_point == nullptr) {
entry_point = generate_normal_entry(synchronized); entry_point = generate_normal_entry(synchronized);
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -47,14 +47,14 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator {
return generate_exception_handler_common(name, message, false); return generate_exception_handler_common(name, message, false);
} }
address generate_klass_exception_handler(const char* name) { address generate_klass_exception_handler(const char* name) {
return generate_exception_handler_common(name, NULL, true); return generate_exception_handler_common(name, nullptr, true);
} }
address generate_exception_handler_common(const char* name, const char* message, bool pass_oop); address generate_exception_handler_common(const char* name, const char* message, bool pass_oop);
address generate_ClassCastException_handler(); address generate_ClassCastException_handler();
address generate_ArrayIndexOutOfBounds_handler(); address generate_ArrayIndexOutOfBounds_handler();
address generate_return_entry_for(TosState state, int step, size_t index_size); address generate_return_entry_for(TosState state, int step, size_t index_size);
address generate_earlyret_entry_for(TosState state); address generate_earlyret_entry_for(TosState state);
address generate_deopt_entry_for(TosState state, int step, address continuation = NULL); address generate_deopt_entry_for(TosState state, int step, address continuation = nullptr);
address generate_safept_entry_for(TosState state, address runtime_entry); address generate_safept_entry_for(TosState state, address runtime_entry);
void generate_throw_exception(); void generate_throw_exception();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -64,7 +64,7 @@ class Template {
public: public:
Bytecodes::Code bytecode() const; Bytecodes::Code bytecode() const;
bool is_valid() const { return _gen != NULL; } bool is_valid() const { return _gen != nullptr; }
bool uses_bcp() const { return (_flags & (1 << uses_bcp_bit )) != 0; } bool uses_bcp() const { return (_flags & (1 << uses_bcp_bit )) != 0; }
bool does_dispatch() const { return (_flags & (1 << does_dispatch_bit)) != 0; } bool does_dispatch() const { return (_flags & (1 << does_dispatch_bit)) != 0; }
bool calls_vm() const { return (_flags & (1 << calls_vm_bit )) != 0; } bool calls_vm() const { return (_flags & (1 << calls_vm_bit )) != 0; }

View File

@ -340,8 +340,8 @@ JRT_END
*/ */
#undef CHECK_NULL #undef CHECK_NULL
#define CHECK_NULL(obj_) \ #define CHECK_NULL(obj_) \
if ((obj_) == NULL) { \ if ((obj_) == nullptr) { \
VM_JAVA_ERROR(vmSymbols::java_lang_NullPointerException(), NULL); \ VM_JAVA_ERROR(vmSymbols::java_lang_NullPointerException(), nullptr); \
} \ } \
VERIFY_OOP(obj_) VERIFY_OOP(obj_)
@ -400,7 +400,7 @@ JRT_END
if (*count_addr > 0) { \ if (*count_addr > 0) { \
oop target; \ oop target; \
if ((Bytecodes::Code)opcode == Bytecodes::_getstatic) { \ if ((Bytecodes::Code)opcode == Bytecodes::_getstatic) { \
target = NULL; \ target = nullptr; \
} else { \ } else { \
target = obj; \ target = obj; \
} \ } \
@ -420,7 +420,7 @@ JRT_END
if (*count_addr > 0) { \ if (*count_addr > 0) { \
oop target; \ oop target; \
if ((Bytecodes::Code)opcode == Bytecodes::_putstatic) { \ if ((Bytecodes::Code)opcode == Bytecodes::_putstatic) { \
target = NULL; \ target = nullptr; \
} else { \ } else { \
target = obj; \ target = obj; \
} \ } \
@ -506,7 +506,7 @@ void BytecodeInterpreter::run(interpreterState istate) {
do { do {
assert(l == l->_self_link, "bad link"); assert(l == l->_self_link, "bad link");
l = l->_prev_link; l = l->_prev_link;
} while (l != NULL); } while (l != nullptr);
// Screwups with stack management usually cause us to overwrite istate // Screwups with stack management usually cause us to overwrite istate
// save a copy so we can verify it. // save a copy so we can verify it.
interpreterState orig = istate; interpreterState orig = istate;
@ -629,7 +629,7 @@ void BytecodeInterpreter::run(interpreterState istate) {
if (call_vm || rcvr->cas_set_mark(markWord::from_pointer(mon), displaced) != displaced) { if (call_vm || rcvr->cas_set_mark(markWord::from_pointer(mon), displaced) != displaced) {
// Is it simple recursive case? // Is it simple recursive case?
if (!call_vm && THREAD->is_lock_owned((address) displaced.clear_lock_bits().to_pointer())) { if (!call_vm && THREAD->is_lock_owned((address) displaced.clear_lock_bits().to_pointer())) {
mon->lock()->set_displaced_header(markWord::from_pointer(NULL)); mon->lock()->set_displaced_header(markWord::from_pointer(nullptr));
} else { } else {
inc_monitor_count = false; inc_monitor_count = false;
CALL_VM(InterpreterRuntime::monitorenter(THREAD, mon), handle_exception); CALL_VM(InterpreterRuntime::monitorenter(THREAD, mon), handle_exception);
@ -717,7 +717,7 @@ void BytecodeInterpreter::run(interpreterState istate) {
// derefing's lockee ought to provoke implicit null check // derefing's lockee ought to provoke implicit null check
// find a free monitor // find a free monitor
BasicObjectLock* entry = (BasicObjectLock*) istate->stack_base(); BasicObjectLock* entry = (BasicObjectLock*) istate->stack_base();
assert(entry->obj() == NULL, "Frame manager didn't allocate the monitor"); assert(entry->obj() == nullptr, "Frame manager didn't allocate the monitor");
entry->set_obj(lockee); entry->set_obj(lockee);
// traditional lightweight locking // traditional lightweight locking
@ -728,7 +728,7 @@ void BytecodeInterpreter::run(interpreterState istate) {
if (call_vm || lockee->cas_set_mark(markWord::from_pointer(entry), displaced) != displaced) { if (call_vm || lockee->cas_set_mark(markWord::from_pointer(entry), displaced) != displaced) {
// Is it simple recursive case? // Is it simple recursive case?
if (!call_vm && THREAD->is_lock_owned((address) displaced.clear_lock_bits().to_pointer())) { if (!call_vm && THREAD->is_lock_owned((address) displaced.clear_lock_bits().to_pointer())) {
entry->lock()->set_displaced_header(markWord::from_pointer(NULL)); entry->lock()->set_displaced_header(markWord::from_pointer(nullptr));
} else { } else {
inc_monitor_count = false; inc_monitor_count = false;
CALL_VM(InterpreterRuntime::monitorenter(THREAD, entry), handle_exception); CALL_VM(InterpreterRuntime::monitorenter(THREAD, entry), handle_exception);
@ -784,7 +784,7 @@ run:
/* Push miscellaneous constants onto the stack. */ /* Push miscellaneous constants onto the stack. */
CASE(_aconst_null): CASE(_aconst_null):
SET_STACK_OBJECT(NULL, 0); SET_STACK_OBJECT(nullptr, 0);
UPDATE_PC_AND_TOS_AND_CONTINUE(1, 1); UPDATE_PC_AND_TOS_AND_CONTINUE(1, 1);
#undef OPC_CONST_n #undef OPC_CONST_n
@ -1367,7 +1367,7 @@ run:
#define NULL_COMPARISON_NOT_OP(name) \ #define NULL_COMPARISON_NOT_OP(name) \
CASE(_if##name): { \ CASE(_if##name): { \
int skip = (!(STACK_OBJECT(-1) == NULL)) \ int skip = (!(STACK_OBJECT(-1) == nullptr)) \
? (int16_t)Bytes::get_Java_u2(pc + 1) : 3; \ ? (int16_t)Bytes::get_Java_u2(pc + 1) : 3; \
address branch_pc = pc; \ address branch_pc = pc; \
UPDATE_PC_AND_TOS(skip, -1); \ UPDATE_PC_AND_TOS(skip, -1); \
@ -1377,7 +1377,7 @@ run:
#define NULL_COMPARISON_OP(name) \ #define NULL_COMPARISON_OP(name) \
CASE(_if##name): { \ CASE(_if##name): { \
int skip = ((STACK_OBJECT(-1) == NULL)) \ int skip = ((STACK_OBJECT(-1) == nullptr)) \
? (int16_t)Bytes::get_Java_u2(pc + 1) : 3; \ ? (int16_t)Bytes::get_Java_u2(pc + 1) : 3; \
address branch_pc = pc; \ address branch_pc = pc; \
UPDATE_PC_AND_TOS(skip, -1); \ UPDATE_PC_AND_TOS(skip, -1); \
@ -1585,7 +1585,7 @@ run:
VERIFY_OOP(rhsObject); VERIFY_OOP(rhsObject);
ARRAY_INTRO( -3); ARRAY_INTRO( -3);
// arrObj, index are set // arrObj, index are set
if (rhsObject != NULL) { if (rhsObject != nullptr) {
/* Check assignability of rhsObject into arrObj */ /* Check assignability of rhsObject into arrObj */
Klass* rhsKlass = rhsObject->klass(); // EBX (subclass) Klass* rhsKlass = rhsObject->klass(); // EBX (subclass)
Klass* elemKlass = ObjArrayKlass::cast(arrObj->klass())->element_klass(); // superklass EAX Klass* elemKlass = ObjArrayKlass::cast(arrObj->klass())->element_klass(); // superklass EAX
@ -1641,13 +1641,13 @@ run:
// since this is recursive enter // since this is recursive enter
BasicObjectLock* limit = istate->monitor_base(); BasicObjectLock* limit = istate->monitor_base();
BasicObjectLock* most_recent = (BasicObjectLock*) istate->stack_base(); BasicObjectLock* most_recent = (BasicObjectLock*) istate->stack_base();
BasicObjectLock* entry = NULL; BasicObjectLock* entry = nullptr;
while (most_recent != limit ) { while (most_recent != limit ) {
if (most_recent->obj() == NULL) entry = most_recent; if (most_recent->obj() == nullptr) entry = most_recent;
else if (most_recent->obj() == lockee) break; else if (most_recent->obj() == lockee) break;
most_recent++; most_recent++;
} }
if (entry != NULL) { if (entry != nullptr) {
entry->set_obj(lockee); entry->set_obj(lockee);
// traditional lightweight locking // traditional lightweight locking
@ -1658,7 +1658,7 @@ run:
if (call_vm || lockee->cas_set_mark(markWord::from_pointer(entry), displaced) != displaced) { if (call_vm || lockee->cas_set_mark(markWord::from_pointer(entry), displaced) != displaced) {
// Is it simple recursive case? // Is it simple recursive case?
if (!call_vm && THREAD->is_lock_owned((address) displaced.clear_lock_bits().to_pointer())) { if (!call_vm && THREAD->is_lock_owned((address) displaced.clear_lock_bits().to_pointer())) {
entry->lock()->set_displaced_header(markWord::from_pointer(NULL)); entry->lock()->set_displaced_header(markWord::from_pointer(nullptr));
} else { } else {
inc_monitor_count = false; inc_monitor_count = false;
CALL_VM(InterpreterRuntime::monitorenter(THREAD, entry), handle_exception); CALL_VM(InterpreterRuntime::monitorenter(THREAD, entry), handle_exception);
@ -1685,12 +1685,12 @@ run:
if ((most_recent)->obj() == lockee) { if ((most_recent)->obj() == lockee) {
BasicLock* lock = most_recent->lock(); BasicLock* lock = most_recent->lock();
markWord header = lock->displaced_header(); markWord header = lock->displaced_header();
most_recent->set_obj(NULL); most_recent->set_obj(nullptr);
// If it isn't recursive we either must swap old header or call the runtime // If it isn't recursive we either must swap old header or call the runtime
bool dec_monitor_count = true; bool dec_monitor_count = true;
bool call_vm = UseHeavyMonitors; bool call_vm = UseHeavyMonitors;
if (header.to_pointer() != NULL || call_vm) { if (header.to_pointer() != nullptr || call_vm) {
markWord old_header = markWord::encode(lock); markWord old_header = markWord::encode(lock);
if (call_vm || lockee->cas_set_mark(header, old_header) != old_header) { if (call_vm || lockee->cas_set_mark(header, old_header) != old_header) {
// restore object for the slow case // restore object for the slow case
@ -1988,7 +1988,7 @@ run:
if (ik->is_initialized() && ik->can_be_fastpath_allocated()) { if (ik->is_initialized() && ik->can_be_fastpath_allocated()) {
size_t obj_size = ik->size_helper(); size_t obj_size = ik->size_helper();
HeapWord* result = THREAD->tlab().allocate(obj_size); HeapWord* result = THREAD->tlab().allocate(obj_size);
if (result != NULL) { if (result != nullptr) {
// Initialize object field block: // Initialize object field block:
// - if TLAB is pre-zeroed, we can skip this path // - if TLAB is pre-zeroed, we can skip this path
// - in debug mode, ThreadLocalAllocBuffer::allocate mangles // - in debug mode, ThreadLocalAllocBuffer::allocate mangles
@ -2020,7 +2020,7 @@ run:
// with stores that publish the new object. // with stores that publish the new object.
OrderAccess::storestore(); OrderAccess::storestore();
SET_STACK_OBJECT(THREAD->vm_result(), 0); SET_STACK_OBJECT(THREAD->vm_result(), 0);
THREAD->set_vm_result(NULL); THREAD->set_vm_result(nullptr);
UPDATE_PC_AND_TOS_AND_CONTINUE(3, 1); UPDATE_PC_AND_TOS_AND_CONTINUE(3, 1);
} }
CASE(_anewarray): { CASE(_anewarray): {
@ -2032,7 +2032,7 @@ run:
// with stores that publish the new object. // with stores that publish the new object.
OrderAccess::storestore(); OrderAccess::storestore();
SET_STACK_OBJECT(THREAD->vm_result(), -1); SET_STACK_OBJECT(THREAD->vm_result(), -1);
THREAD->set_vm_result(NULL); THREAD->set_vm_result(nullptr);
UPDATE_PC_AND_CONTINUE(3); UPDATE_PC_AND_CONTINUE(3);
} }
CASE(_multianewarray): { CASE(_multianewarray): {
@ -2049,11 +2049,11 @@ run:
// with stores that publish the new object. // with stores that publish the new object.
OrderAccess::storestore(); OrderAccess::storestore();
SET_STACK_OBJECT(THREAD->vm_result(), -dims); SET_STACK_OBJECT(THREAD->vm_result(), -dims);
THREAD->set_vm_result(NULL); THREAD->set_vm_result(nullptr);
UPDATE_PC_AND_TOS_AND_CONTINUE(4, -(dims-1)); UPDATE_PC_AND_TOS_AND_CONTINUE(4, -(dims-1));
} }
CASE(_checkcast): CASE(_checkcast):
if (STACK_OBJECT(-1) != NULL) { if (STACK_OBJECT(-1) != nullptr) {
VERIFY_OOP(STACK_OBJECT(-1)); VERIFY_OOP(STACK_OBJECT(-1));
u2 index = Bytes::get_Java_u2(pc+1); u2 index = Bytes::get_Java_u2(pc+1);
// Constant pool may have actual klass or unresolved klass. If it is // Constant pool may have actual klass or unresolved klass. If it is
@ -2077,7 +2077,7 @@ run:
UPDATE_PC_AND_CONTINUE(3); UPDATE_PC_AND_CONTINUE(3);
CASE(_instanceof): CASE(_instanceof):
if (STACK_OBJECT(-1) == NULL) { if (STACK_OBJECT(-1) == nullptr) {
SET_STACK_INT(0, -1); SET_STACK_INT(0, -1);
} else { } else {
VERIFY_OOP(STACK_OBJECT(-1)); VERIFY_OOP(STACK_OBJECT(-1));
@ -2128,10 +2128,10 @@ run:
case JVM_CONSTANT_String: case JVM_CONSTANT_String:
{ {
oop result = constants->resolved_reference_at(index); oop result = constants->resolved_reference_at(index);
if (result == NULL) { if (result == nullptr) {
CALL_VM(InterpreterRuntime::resolve_ldc(THREAD, (Bytecodes::Code) opcode), handle_exception); CALL_VM(InterpreterRuntime::resolve_ldc(THREAD, (Bytecodes::Code) opcode), handle_exception);
SET_STACK_OBJECT(THREAD->vm_result(), 0); SET_STACK_OBJECT(THREAD->vm_result(), 0);
THREAD->set_vm_result(NULL); THREAD->set_vm_result(nullptr);
} else { } else {
VERIFY_OOP(result); VERIFY_OOP(result);
SET_STACK_OBJECT(result, 0); SET_STACK_OBJECT(result, 0);
@ -2148,7 +2148,7 @@ run:
case JVM_CONSTANT_UnresolvedClassInError: case JVM_CONSTANT_UnresolvedClassInError:
CALL_VM(InterpreterRuntime::ldc(THREAD, wide), handle_exception); CALL_VM(InterpreterRuntime::ldc(THREAD, wide), handle_exception);
SET_STACK_OBJECT(THREAD->vm_result(), 0); SET_STACK_OBJECT(THREAD->vm_result(), 0);
THREAD->set_vm_result(NULL); THREAD->set_vm_result(nullptr);
break; break;
case JVM_CONSTANT_Dynamic: case JVM_CONSTANT_Dynamic:
@ -2233,13 +2233,13 @@ run:
// there is a 1-1 relation between bytecode type and CP entry type. // there is a 1-1 relation between bytecode type and CP entry type.
ConstantPool* constants = METHOD->constants(); ConstantPool* constants = METHOD->constants();
oop result = constants->resolved_reference_at(index); oop result = constants->resolved_reference_at(index);
if (result == NULL) { if (result == nullptr) {
CALL_VM(InterpreterRuntime::resolve_ldc(THREAD, (Bytecodes::Code) opcode), CALL_VM(InterpreterRuntime::resolve_ldc(THREAD, (Bytecodes::Code) opcode),
handle_exception); handle_exception);
result = THREAD->vm_result(); result = THREAD->vm_result();
} }
if (result == Universe::the_null_sentinel()) if (result == Universe::the_null_sentinel())
result = NULL; result = nullptr;
VERIFY_OOP(result); VERIFY_OOP(result);
SET_STACK_OBJECT(result, 0); SET_STACK_OBJECT(result, 0);
@ -2322,7 +2322,7 @@ run:
// Special case of invokeinterface called for virtual method of // Special case of invokeinterface called for virtual method of
// java.lang.Object. See cpCache.cpp for details. // java.lang.Object. See cpCache.cpp for details.
Method* callee = NULL; Method* callee = nullptr;
if (cache->is_forced_virtual()) { if (cache->is_forced_virtual()) {
CHECK_NULL(STACK_OBJECT(-(cache->parameter_size()))); CHECK_NULL(STACK_OBJECT(-(cache->parameter_size())));
if (cache->is_vfinal()) { if (cache->is_vfinal()) {
@ -2358,7 +2358,7 @@ run:
} }
callee = cache->f2_as_vfinal_method(); callee = cache->f2_as_vfinal_method();
} }
if (callee != NULL) { if (callee != nullptr) {
istate->set_callee(callee); istate->set_callee(callee);
istate->set_callee_entry_point(callee->from_interpreted_entry()); istate->set_callee_entry_point(callee->from_interpreted_entry());
if (JVMTI_ENABLED && THREAD->is_interp_only_mode()) { if (JVMTI_ENABLED && THREAD->is_interp_only_mode()) {
@ -2383,7 +2383,7 @@ run:
Klass* refc = cache->f1_as_klass(); Klass* refc = cache->f1_as_klass();
itableOffsetEntry* scan; itableOffsetEntry* scan;
for (scan = (itableOffsetEntry*) int2->start_of_itable(); for (scan = (itableOffsetEntry*) int2->start_of_itable();
scan->interface_klass() != NULL; scan->interface_klass() != nullptr;
scan++) { scan++) {
if (scan->interface_klass() == refc) { if (scan->interface_klass() == refc) {
break; break;
@ -2393,7 +2393,7 @@ run:
// that the receiver class doesn't implement the // that the receiver class doesn't implement the
// interface, and wasn't the same as when the caller was // interface, and wasn't the same as when the caller was
// compiled. // compiled.
if (scan->interface_klass() == NULL) { if (scan->interface_klass() == nullptr) {
VM_JAVA_ERROR(vmSymbols::java_lang_IncompatibleClassChangeError(), ""); VM_JAVA_ERROR(vmSymbols::java_lang_IncompatibleClassChangeError(), "");
} }
} }
@ -2414,7 +2414,7 @@ run:
itableMethodEntry* im = ki->first_method_entry(rcvr->klass()); itableMethodEntry* im = ki->first_method_entry(rcvr->klass());
callee = im[mindex].method(); callee = im[mindex].method();
if (callee == NULL) { if (callee == nullptr) {
CALL_VM(InterpreterRuntime::throw_AbstractMethodErrorVerbose(THREAD, rcvr->klass(), interface_method), CALL_VM(InterpreterRuntime::throw_AbstractMethodErrorVerbose(THREAD, rcvr->klass(), interface_method),
handle_exception); handle_exception);
} }
@ -2512,7 +2512,7 @@ run:
// with stores that publish the new object. // with stores that publish the new object.
OrderAccess::storestore(); OrderAccess::storestore();
SET_STACK_OBJECT(THREAD->vm_result(), -1); SET_STACK_OBJECT(THREAD->vm_result(), -1);
THREAD->set_vm_result(NULL); THREAD->set_vm_result(nullptr);
UPDATE_PC_AND_CONTINUE(2); UPDATE_PC_AND_CONTINUE(2);
} }
@ -2523,7 +2523,7 @@ run:
oop except_oop = STACK_OBJECT(-1); oop except_oop = STACK_OBJECT(-1);
CHECK_NULL(except_oop); CHECK_NULL(except_oop);
// set pending_exception so we use common code // set pending_exception so we use common code
THREAD->set_pending_exception(except_oop, NULL, 0); THREAD->set_pending_exception(except_oop, nullptr, 0);
goto handle_exception; goto handle_exception;
} }
@ -2945,7 +2945,7 @@ run:
HandleMark __hm(THREAD); HandleMark __hm(THREAD);
THREAD->clear_pending_exception(); THREAD->clear_pending_exception();
assert(except_oop() != NULL, "No exception to process"); assert(except_oop() != nullptr, "No exception to process");
intptr_t continuation_bci; intptr_t continuation_bci;
// expression stack is emptied // expression stack is emptied
topOfStack = istate->stack_base() - Interpreter::stackElementWords; topOfStack = istate->stack_base() - Interpreter::stackElementWords;
@ -2953,7 +2953,7 @@ run:
handle_exception); handle_exception);
except_oop = Handle(THREAD, THREAD->vm_result()); except_oop = Handle(THREAD, THREAD->vm_result());
THREAD->set_vm_result(NULL); THREAD->set_vm_result(nullptr);
if (continuation_bci >= 0) { if (continuation_bci >= 0) {
// Place exception on top of stack // Place exception on top of stack
SET_STACK_OBJECT(except_oop(), 0); SET_STACK_OBJECT(except_oop(), 0);
@ -2987,7 +2987,7 @@ run:
Exceptions::debug_check_abort(except_oop); Exceptions::debug_check_abort(except_oop);
// No handler in this activation, unwind and try again // No handler in this activation, unwind and try again
THREAD->set_pending_exception(except_oop(), NULL, 0); THREAD->set_pending_exception(except_oop(), nullptr, 0);
goto handle_return; goto handle_return;
} // handle_exception: } // handle_exception:
@ -3054,7 +3054,7 @@ run:
} }
ts->clr_earlyret_value(); ts->clr_earlyret_value();
ts->set_earlyret_oop(NULL); ts->set_earlyret_oop(nullptr);
ts->clr_earlyret_pending(); ts->clr_earlyret_pending();
// Fall through to handle_return. // Fall through to handle_return.
@ -3073,14 +3073,14 @@ run:
bool suppress_error = istate->msg() == popping_frame || istate->msg() == early_return; bool suppress_error = istate->msg() == popping_frame || istate->msg() == early_return;
bool suppress_exit_event = THREAD->has_pending_exception() || istate->msg() == popping_frame; bool suppress_exit_event = THREAD->has_pending_exception() || istate->msg() == popping_frame;
Handle original_exception(THREAD, THREAD->pending_exception()); Handle original_exception(THREAD, THREAD->pending_exception());
Handle illegal_state_oop(THREAD, NULL); Handle illegal_state_oop(THREAD, nullptr);
// We'd like a HandleMark here to prevent any subsequent HandleMarkCleaner // We'd like a HandleMark here to prevent any subsequent HandleMarkCleaner
// in any following VM entries from freeing our live handles, but illegal_state_oop // in any following VM entries from freeing our live handles, but illegal_state_oop
// isn't really allocated yet and so doesn't become live until later and // isn't really allocated yet and so doesn't become live until later and
// in unpredictable places. Instead we must protect the places where we enter the // in unpredictable places. Instead we must protect the places where we enter the
// VM. It would be much simpler (and safer) if we could allocate a real handle with // VM. It would be much simpler (and safer) if we could allocate a real handle with
// a NULL oop in it and then overwrite the oop later as needed. This isn't // a null oop in it and then overwrite the oop later as needed. This isn't
// unfortunately isn't possible. // unfortunately isn't possible.
if (THREAD->has_pending_exception()) { if (THREAD->has_pending_exception()) {
@ -3130,14 +3130,14 @@ run:
// Check all the monitors to see they are unlocked. Install exception if found to be locked. // Check all the monitors to see they are unlocked. Install exception if found to be locked.
while (end < base) { while (end < base) {
oop lockee = end->obj(); oop lockee = end->obj();
if (lockee != NULL) { if (lockee != nullptr) {
BasicLock* lock = end->lock(); BasicLock* lock = end->lock();
markWord header = lock->displaced_header(); markWord header = lock->displaced_header();
end->set_obj(NULL); end->set_obj(nullptr);
// If it isn't recursive we either must swap old header or call the runtime // If it isn't recursive we either must swap old header or call the runtime
bool dec_monitor_count = true; bool dec_monitor_count = true;
if (header.to_pointer() != NULL) { if (header.to_pointer() != nullptr) {
markWord old_header = markWord::encode(lock); markWord old_header = markWord::encode(lock);
if (lockee->cas_set_mark(header, old_header) != old_header) { if (lockee->cas_set_mark(header, old_header) != old_header) {
// restore object for the slow case // restore object for the slow case
@ -3151,7 +3151,7 @@ run:
} }
// One error is plenty // One error is plenty
if (illegal_state_oop() == NULL && !suppress_error) { if (illegal_state_oop() == nullptr && !suppress_error) {
{ {
// Prevent any HandleMarkCleaner from freeing our live handles // Prevent any HandleMarkCleaner from freeing our live handles
HandleMark __hm(THREAD); HandleMark __hm(THREAD);
@ -3166,9 +3166,9 @@ run:
} }
// Unlock the method if needed // Unlock the method if needed
if (method_unlock_needed) { if (method_unlock_needed) {
if (base->obj() == NULL) { if (base->obj() == nullptr) {
// The method is already unlocked this is not good. // The method is already unlocked this is not good.
if (illegal_state_oop() == NULL && !suppress_error) { if (illegal_state_oop() == nullptr && !suppress_error) {
{ {
// Prevent any HandleMarkCleaner from freeing our live handles // Prevent any HandleMarkCleaner from freeing our live handles
HandleMark __hm(THREAD); HandleMark __hm(THREAD);
@ -3189,7 +3189,7 @@ run:
// and must use first monitor slot. // and must use first monitor slot.
// //
oop rcvr = base->obj(); oop rcvr = base->obj();
if (rcvr == NULL) { if (rcvr == nullptr) {
if (!suppress_error) { if (!suppress_error) {
VM_JAVA_ERROR_NO_JUMP(vmSymbols::java_lang_NullPointerException(), ""); VM_JAVA_ERROR_NO_JUMP(vmSymbols::java_lang_NullPointerException(), "");
illegal_state_oop = Handle(THREAD, THREAD->pending_exception()); illegal_state_oop = Handle(THREAD, THREAD->pending_exception());
@ -3204,11 +3204,11 @@ run:
} else { } else {
BasicLock* lock = base->lock(); BasicLock* lock = base->lock();
markWord header = lock->displaced_header(); markWord header = lock->displaced_header();
base->set_obj(NULL); base->set_obj(nullptr);
// If it isn't recursive we either must swap old header or call the runtime // If it isn't recursive we either must swap old header or call the runtime
bool dec_monitor_count = true; bool dec_monitor_count = true;
if (header.to_pointer() != NULL) { if (header.to_pointer() != nullptr) {
markWord old_header = markWord::encode(lock); markWord old_header = markWord::encode(lock);
if (rcvr->cas_set_mark(header, old_header) != old_header) { if (rcvr->cas_set_mark(header, old_header) != old_header) {
// restore object for the slow case // restore object for the slow case
@ -3249,7 +3249,7 @@ run:
// (with this note) in anticipation of changing the vm and the tests // (with this note) in anticipation of changing the vm and the tests
// simultaneously. // simultaneously.
suppress_exit_event = suppress_exit_event || illegal_state_oop() != NULL; suppress_exit_event = suppress_exit_event || illegal_state_oop() != nullptr;
// Whenever JVMTI puts a thread in interp_only_mode, method // Whenever JVMTI puts a thread in interp_only_mode, method
// entry/exit events are sent for that thread to track stack depth. // entry/exit events are sent for that thread to track stack depth.
@ -3265,21 +3265,21 @@ run:
// A pending exception that was pending prior to a possible popping frame // A pending exception that was pending prior to a possible popping frame
// overrides the popping frame. // overrides the popping frame.
// //
assert(!suppress_error || (suppress_error && illegal_state_oop() == NULL), "Error was not suppressed"); assert(!suppress_error || (suppress_error && illegal_state_oop() == nullptr), "Error was not suppressed");
if (illegal_state_oop() != NULL || original_exception() != NULL) { if (illegal_state_oop() != nullptr || original_exception() != nullptr) {
// Inform the frame manager we have no result. // Inform the frame manager we have no result.
istate->set_msg(throwing_exception); istate->set_msg(throwing_exception);
if (illegal_state_oop() != NULL) if (illegal_state_oop() != nullptr)
THREAD->set_pending_exception(illegal_state_oop(), NULL, 0); THREAD->set_pending_exception(illegal_state_oop(), nullptr, 0);
else else
THREAD->set_pending_exception(original_exception(), NULL, 0); THREAD->set_pending_exception(original_exception(), nullptr, 0);
UPDATE_PC_AND_RETURN(0); UPDATE_PC_AND_RETURN(0);
} }
if (istate->msg() == popping_frame) { if (istate->msg() == popping_frame) {
// Make it simpler on the assembly code and set the message for the frame pop. // Make it simpler on the assembly code and set the message for the frame pop.
// returns // returns
if (istate->prev() == NULL) { if (istate->prev() == nullptr) {
// We must be returning to a deoptimized frame (because popframe only happens between // We must be returning to a deoptimized frame (because popframe only happens between
// two interpreted frames). We need to save the current arguments in C heap so that // two interpreted frames). We need to save the current arguments in C heap so that
// the deoptimized frame when it restarts can copy the arguments to its expression // the deoptimized frame when it restarts can copy the arguments to its expression
@ -3316,7 +3316,7 @@ BytecodeInterpreter::BytecodeInterpreter(messages msg) {
if (msg != initialize) ShouldNotReachHere(); if (msg != initialize) ShouldNotReachHere();
_msg = msg; _msg = msg;
_self_link = this; _self_link = this;
_prev_link = NULL; _prev_link = nullptr;
} }
void BytecodeInterpreter::astore(intptr_t* tos, int stack_offset, void BytecodeInterpreter::astore(intptr_t* tos, int stack_offset,

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -35,7 +35,7 @@
#ifdef ASSERT #ifdef ASSERT
#define VERIFY_OOP(o_) \ #define VERIFY_OOP(o_) \
if (VerifyOops) { \ if (VerifyOops) { \
assert(oopDesc::is_oop_or_null(oop(o_)), "Expected an oop or NULL at " PTR_FORMAT, p2i(oop(o_))); \ assert(oopDesc::is_oop_or_null(oop(o_)), "Expected an oop or null at " PTR_FORMAT, p2i(oop(o_))); \
StubRoutines::_verify_oop_count++; \ StubRoutines::_verify_oop_count++; \
} }
#else #else

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -68,9 +68,9 @@ class ZeroInterpreter: public AbstractInterpreter {
address osr_buf, address osr_buf,
TRAPS); TRAPS);
static address throw_NullPointerException_entry() { return NULL; } static address throw_NullPointerException_entry() { return nullptr; }
static address throw_ArithmeticException_entry() { return NULL; } static address throw_ArithmeticException_entry() { return nullptr; }
static address throw_StackOverflowError_entry() { return NULL; } static address throw_StackOverflowError_entry() { return nullptr; }
# include "zeroInterpreter_zero.hpp" # include "zeroInterpreter_zero.hpp"
}; };

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
@ -81,7 +81,7 @@ address ZeroInterpreterGenerator::generate_method_entry(
// determine code generation flags // determine code generation flags
bool native = false; bool native = false;
bool synchronized = false; bool synchronized = false;
address entry_point = NULL; address entry_point = nullptr;
switch (kind) { switch (kind) {
case Interpreter::zerolocals : break; case Interpreter::zerolocals : break;
@ -118,12 +118,12 @@ address ZeroInterpreterGenerator::generate_method_entry(
// We expect the normal and native entry points to be generated first so we can reuse them. // We expect the normal and native entry points to be generated first so we can reuse them.
if (native) { if (native) {
entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native);
if (entry_point == NULL) { if (entry_point == nullptr) {
entry_point = generate_native_entry(synchronized); entry_point = generate_native_entry(synchronized);
} }
} else { } else {
entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals);
if (entry_point == NULL) { if (entry_point == nullptr) {
entry_point = generate_normal_entry(synchronized); entry_point = generate_normal_entry(synchronized);
} }
} }
@ -139,10 +139,10 @@ address ZeroInterpreterGenerator::generate_slow_signature_handler() {
address ZeroInterpreterGenerator::generate_math_entry( address ZeroInterpreterGenerator::generate_math_entry(
AbstractInterpreter::MethodKind kind) { AbstractInterpreter::MethodKind kind) {
if (!InlineIntrinsics) if (!InlineIntrinsics)
return NULL; return nullptr;
Unimplemented(); Unimplemented();
return NULL; return nullptr;
} }
address ZeroInterpreterGenerator::generate_abstract_entry() { address ZeroInterpreterGenerator::generate_abstract_entry() {
@ -151,21 +151,21 @@ address ZeroInterpreterGenerator::generate_abstract_entry() {
address ZeroInterpreterGenerator::generate_empty_entry() { address ZeroInterpreterGenerator::generate_empty_entry() {
if (!UseFastEmptyMethods) if (!UseFastEmptyMethods)
return NULL; return nullptr;
return generate_entry((address) ZeroInterpreter::empty_entry); return generate_entry((address) ZeroInterpreter::empty_entry);
} }
address ZeroInterpreterGenerator::generate_getter_entry() { address ZeroInterpreterGenerator::generate_getter_entry() {
if (!UseFastAccessorMethods) if (!UseFastAccessorMethods)
return NULL; return nullptr;
return generate_entry((address) ZeroInterpreter::getter_entry); return generate_entry((address) ZeroInterpreter::getter_entry);
} }
address ZeroInterpreterGenerator::generate_setter_entry() { address ZeroInterpreterGenerator::generate_setter_entry() {
if (!UseFastAccessorMethods) if (!UseFastAccessorMethods)
return NULL; return nullptr;
return generate_entry((address) ZeroInterpreter::setter_entry); return generate_entry((address) ZeroInterpreter::setter_entry);
} }