8025566: EXCEPTION_ACCESS_VIOLATION in compiled by C1 String.valueOf method
Reviewed-by: kvn
This commit is contained in:
parent
bb528dd1d5
commit
619948a8f1
@ -3053,7 +3053,11 @@ void LIRGenerator::increment_event_counter_impl(CodeEmitInfo* info,
|
||||
int offset = -1;
|
||||
LIR_Opr counter_holder;
|
||||
if (level == CompLevel_limited_profile) {
|
||||
address counters_adr = method->ensure_method_counters();
|
||||
MethodCounters* counters_adr = method->ensure_method_counters();
|
||||
if (counters_adr == NULL) {
|
||||
bailout("method counters allocation failed");
|
||||
return;
|
||||
}
|
||||
counter_holder = new_pointer_register();
|
||||
__ move(LIR_OprFact::intptrConst(counters_adr), counter_holder);
|
||||
offset = in_bytes(backedge ? MethodCounters::backedge_counter_offset() :
|
||||
|
@ -846,7 +846,9 @@ bool ciMethod::has_member_arg() const {
|
||||
// Return true if allocation was successful or no MDO is required.
|
||||
bool ciMethod::ensure_method_data(methodHandle h_m) {
|
||||
EXCEPTION_CONTEXT;
|
||||
if (is_native() || is_abstract() || h_m()->is_accessor()) return true;
|
||||
if (is_native() || is_abstract() || h_m()->is_accessor()) {
|
||||
return true;
|
||||
}
|
||||
if (h_m()->method_data() == NULL) {
|
||||
Method::build_interpreter_method_data(h_m, THREAD);
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
@ -903,22 +905,21 @@ ciMethodData* ciMethod::method_data() {
|
||||
// NULL otherwise.
|
||||
ciMethodData* ciMethod::method_data_or_null() {
|
||||
ciMethodData *md = method_data();
|
||||
if (md->is_empty()) return NULL;
|
||||
if (md->is_empty()) {
|
||||
return NULL;
|
||||
}
|
||||
return md;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciMethod::ensure_method_counters
|
||||
//
|
||||
address ciMethod::ensure_method_counters() {
|
||||
MethodCounters* ciMethod::ensure_method_counters() {
|
||||
check_is_loaded();
|
||||
VM_ENTRY_MARK;
|
||||
methodHandle mh(THREAD, get_Method());
|
||||
MethodCounters *counter = mh->method_counters();
|
||||
if (counter == NULL) {
|
||||
counter = Method::build_method_counters(mh(), CHECK_AND_CLEAR_NULL);
|
||||
}
|
||||
return (address)counter;
|
||||
MethodCounters* method_counters = mh->get_method_counters(CHECK_NULL);
|
||||
return method_counters;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
@ -265,7 +265,7 @@ class ciMethod : public ciMetadata {
|
||||
bool is_klass_loaded(int refinfo_index, bool must_be_resolved) const;
|
||||
bool check_call(int refinfo_index, bool is_static) const;
|
||||
bool ensure_method_data(); // make sure it exists in the VM also
|
||||
address ensure_method_counters();
|
||||
MethodCounters* ensure_method_counters();
|
||||
int instructions_size();
|
||||
int scale_count(int count, float prof_factor = 1.); // make MDO count commensurate with IIC
|
||||
|
||||
|
@ -78,7 +78,9 @@ ciMethodData::ciMethodData() : ciMetadata(NULL) {
|
||||
|
||||
void ciMethodData::load_data() {
|
||||
MethodData* mdo = get_MethodData();
|
||||
if (mdo == NULL) return;
|
||||
if (mdo == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
// To do: don't copy the data if it is not "ripe" -- require a minimum #
|
||||
// of invocations.
|
||||
|
@ -232,8 +232,6 @@ private:
|
||||
public:
|
||||
bool is_method_data() const { return true; }
|
||||
|
||||
void set_mature() { _state = mature_state; }
|
||||
|
||||
bool is_empty() { return _state == empty_state; }
|
||||
bool is_mature() { return _state == mature_state; }
|
||||
|
||||
|
@ -965,14 +965,12 @@ void ciReplay::initialize(ciMethod* m) {
|
||||
tty->cr();
|
||||
} else {
|
||||
EXCEPTION_CONTEXT;
|
||||
MethodCounters* mcs = method->method_counters();
|
||||
// m->_instructions_size = rec->instructions_size;
|
||||
m->_instructions_size = -1;
|
||||
m->_interpreter_invocation_count = rec->interpreter_invocation_count;
|
||||
m->_interpreter_throwout_count = rec->interpreter_throwout_count;
|
||||
if (mcs == NULL) {
|
||||
mcs = Method::build_method_counters(method, CHECK_AND_CLEAR);
|
||||
}
|
||||
MethodCounters* mcs = method->get_method_counters(CHECK_AND_CLEAR);
|
||||
guarantee(mcs != NULL, "method counters allocation failed");
|
||||
mcs->invocation_counter()->_counter = rec->invocation_counter;
|
||||
mcs->backedge_counter()->_counter = rec->backedge_counter;
|
||||
}
|
||||
|
@ -804,6 +804,7 @@ class Method : public Metadata {
|
||||
private:
|
||||
void print_made_not_compilable(int comp_level, bool is_osr, bool report, const char* reason);
|
||||
|
||||
public:
|
||||
MethodCounters* get_method_counters(TRAPS) {
|
||||
if (_method_counters == NULL) {
|
||||
build_method_counters(this, CHECK_AND_CLEAR_NULL);
|
||||
@ -811,7 +812,6 @@ class Method : public Metadata {
|
||||
return _method_counters;
|
||||
}
|
||||
|
||||
public:
|
||||
bool is_not_c1_compilable() const { return access_flags().is_not_c1_compilable(); }
|
||||
void set_not_c1_compilable() { _access_flags.set_not_c1_compilable(); }
|
||||
void clear_not_c1_compilable() { _access_flags.clear_not_c1_compilable(); }
|
||||
|
@ -343,10 +343,14 @@ void Parse::increment_and_test_invocation_counter(int limit) {
|
||||
|
||||
// Get the Method* node.
|
||||
ciMethod* m = method();
|
||||
address counters_adr = m->ensure_method_counters();
|
||||
MethodCounters* counters_adr = m->ensure_method_counters();
|
||||
if (counters_adr == NULL) {
|
||||
C->record_failure("method counters allocation failed");
|
||||
return;
|
||||
}
|
||||
|
||||
Node* ctrl = control();
|
||||
const TypePtr* adr_type = TypeRawPtr::make(counters_adr);
|
||||
const TypePtr* adr_type = TypeRawPtr::make((address) counters_adr);
|
||||
Node *counters_node = makecon(adr_type);
|
||||
Node* adr_iic_node = basic_plus_adr(counters_node, counters_node,
|
||||
MethodCounters::interpreter_invocation_counter_offset_in_bytes());
|
||||
|
Loading…
Reference in New Issue
Block a user