mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8233913: Remove implicit conversion from Method* to methodHandle
Fix call sites to use existing THREAD local or pass down THREAD local for shallower callsites. Make linkResolver methods return Method* for caller to handleize if needed. Reviewed-by: iklam, thartmann, hseigel
This commit is contained in:
parent
25d3cf9216
commit
ed21b56269
82 changed files with 610 additions and 572 deletions
|
@ -546,7 +546,7 @@ MethodCounters* Method::build_method_counters(Method* m, TRAPS) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
methodHandle mh(m);
|
||||
methodHandle mh(THREAD, m);
|
||||
MethodCounters* counters = MethodCounters::allocate(mh, THREAD);
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
CompileBroker::log_metaspace_failure();
|
||||
|
@ -628,7 +628,7 @@ bool Method::is_vanilla_constructor() const {
|
|||
|
||||
|
||||
bool Method::compute_has_loops_flag() {
|
||||
BytecodeStream bcs(this);
|
||||
BytecodeStream bcs(methodHandle(Thread::current(), this));
|
||||
Bytecodes::Code bc;
|
||||
|
||||
while ((bc = bcs.next()) >= 0) {
|
||||
|
@ -986,7 +986,7 @@ void Method::set_not_compilable(const char* reason, int comp_level, bool report)
|
|||
set_not_c2_compilable();
|
||||
}
|
||||
CompilationPolicy::policy()->disable_compilation(this);
|
||||
assert(!CompilationPolicy::can_be_compiled(this, comp_level), "sanity check");
|
||||
assert(!CompilationPolicy::can_be_compiled(methodHandle(Thread::current(), this), comp_level), "sanity check");
|
||||
}
|
||||
|
||||
bool Method::is_not_osr_compilable(int comp_level) const {
|
||||
|
@ -1013,7 +1013,7 @@ void Method::set_not_osr_compilable(const char* reason, int comp_level, bool rep
|
|||
set_not_c2_osr_compilable();
|
||||
}
|
||||
CompilationPolicy::policy()->disable_compilation(this);
|
||||
assert(!CompilationPolicy::can_be_osr_compiled(this, comp_level), "sanity check");
|
||||
assert(!CompilationPolicy::can_be_osr_compiled(methodHandle(Thread::current(), this), comp_level), "sanity check");
|
||||
}
|
||||
|
||||
// Revert to using the interpreter and clear out the nmethod
|
||||
|
@ -1058,7 +1058,7 @@ void Method::unlink_method() {
|
|||
Arguments::assert_is_dumping_archive();
|
||||
// Set the values to what they should be at run time. Note that
|
||||
// this Method can no longer be executed during dump time.
|
||||
_i2i_entry = Interpreter::entry_for_cds_method(this);
|
||||
_i2i_entry = Interpreter::entry_for_cds_method(methodHandle(Thread::current(), this));
|
||||
_from_interpreted_entry = _i2i_entry;
|
||||
|
||||
if (DynamicDumpSharedSpaces) {
|
||||
|
@ -1570,14 +1570,14 @@ methodHandle Method::clone_with_new_data(const methodHandle& m, u_char* new_code
|
|||
if (m->has_stackmap_table()) {
|
||||
int code_attribute_length = m->stackmap_data()->length();
|
||||
Array<u1>* stackmap_data =
|
||||
MetadataFactory::new_array<u1>(loader_data, code_attribute_length, 0, CHECK_NULL);
|
||||
MetadataFactory::new_array<u1>(loader_data, code_attribute_length, 0, CHECK_(methodHandle()));
|
||||
memcpy((void*)stackmap_data->adr_at(0),
|
||||
(void*)m->stackmap_data()->adr_at(0), code_attribute_length);
|
||||
newm->set_stackmap_data(stackmap_data);
|
||||
}
|
||||
|
||||
// copy annotations over to new method
|
||||
newcm->copy_annotations_from(loader_data, cm, CHECK_NULL);
|
||||
newcm->copy_annotations_from(loader_data, cm, CHECK_(methodHandle()));
|
||||
return newm;
|
||||
}
|
||||
|
||||
|
@ -2218,6 +2218,11 @@ jmethodID Method::make_jmethod_id(ClassLoaderData* loader_data, Method* m) {
|
|||
}
|
||||
}
|
||||
|
||||
jmethodID Method::jmethod_id() {
|
||||
methodHandle mh(Thread::current(), this);
|
||||
return method_holder()->get_jmethod_id(mh);
|
||||
}
|
||||
|
||||
// Mark a jmethodID as free. This is called when there is a data race in
|
||||
// InstanceKlass while creating the jmethodID cache.
|
||||
void Method::destroy_jmethod_id(ClassLoaderData* loader_data, jmethodID m) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue