< prev index next >

src/hotspot/share/oops/method.cpp

Print this page

        

*** 542,552 **** // Do not profile the method if metaspace has hit an OOM previously if (ClassLoaderDataGraph::has_metaspace_oom()) { return NULL; } ! methodHandle mh(m); MethodCounters* counters = MethodCounters::allocate(mh, THREAD); if (HAS_PENDING_EXCEPTION) { CompileBroker::log_metaspace_failure(); ClassLoaderDataGraph::set_metaspace_oom(true); return NULL; // return the exception (which is cleared) --- 542,552 ---- // Do not profile the method if metaspace has hit an OOM previously if (ClassLoaderDataGraph::has_metaspace_oom()) { return NULL; } ! methodHandle mh(THREAD, m); MethodCounters* counters = MethodCounters::allocate(mh, THREAD); if (HAS_PENDING_EXCEPTION) { CompileBroker::log_metaspace_failure(); ClassLoaderDataGraph::set_metaspace_oom(true); return NULL; // return the exception (which is cleared)
*** 624,634 **** return true; } bool Method::compute_has_loops_flag() { ! BytecodeStream bcs(this); Bytecodes::Code bc; while ((bc = bcs.next()) >= 0) { switch( bc ) { case Bytecodes::_ifeq: --- 624,634 ---- return true; } bool Method::compute_has_loops_flag() { ! BytecodeStream bcs(methodHandle(Thread::current(), this)); Bytecodes::Code bc; while ((bc = bcs.next()) >= 0) { switch( bc ) { case Bytecodes::_ifeq:
*** 982,992 **** set_not_c1_compilable(); if (is_c2_compile(comp_level)) set_not_c2_compilable(); } CompilationPolicy::policy()->disable_compilation(this); ! assert(!CompilationPolicy::can_be_compiled(this, comp_level), "sanity check"); } bool Method::is_not_osr_compilable(int comp_level) const { if (is_not_compilable(comp_level)) return true; --- 982,992 ---- set_not_c1_compilable(); if (is_c2_compile(comp_level)) set_not_c2_compilable(); } CompilationPolicy::policy()->disable_compilation(this); ! assert(!CompilationPolicy::can_be_compiled(methodHandle(Thread::current(), this), comp_level), "sanity check"); } bool Method::is_not_osr_compilable(int comp_level) const { if (is_not_compilable(comp_level)) return true;
*** 1009,1019 **** set_not_c1_osr_compilable(); if (is_c2_compile(comp_level)) set_not_c2_osr_compilable(); } CompilationPolicy::policy()->disable_compilation(this); ! assert(!CompilationPolicy::can_be_osr_compiled(this, comp_level), "sanity check"); } // Revert to using the interpreter and clear out the nmethod void Method::clear_code() { // this may be NULL if c2i adapters have not been made yet --- 1009,1019 ---- set_not_c1_osr_compilable(); if (is_c2_compile(comp_level)) set_not_c2_osr_compilable(); } CompilationPolicy::policy()->disable_compilation(this); ! assert(!CompilationPolicy::can_be_osr_compiled(methodHandle(Thread::current(), this), comp_level), "sanity check"); } // Revert to using the interpreter and clear out the nmethod void Method::clear_code() { // this may be NULL if c2i adapters have not been made yet
*** 1054,1064 **** _code = NULL; 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); _from_interpreted_entry = _i2i_entry; if (DynamicDumpSharedSpaces) { assert(_from_compiled_entry != NULL, "sanity"); } else { --- 1054,1064 ---- _code = NULL; 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(methodHandle(Thread::current(), this)); _from_interpreted_entry = _i2i_entry; if (DynamicDumpSharedSpaces) { assert(_from_compiled_entry != NULL, "sanity"); } else {
*** 1566,1583 **** } // Copy stackmap table 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); 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); return newm; } vmSymbols::SID Method::klass_id_for_intrinsics(const Klass* holder) { // if loader is not the default loader (i.e., != NULL), we can't know the intrinsics --- 1566,1583 ---- } // Copy stackmap table 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_(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_(methodHandle())); return newm; } vmSymbols::SID Method::klass_id_for_intrinsics(const Klass* holder) { // if loader is not the default loader (i.e., != NULL), we can't know the intrinsics
*** 2214,2223 **** --- 2214,2228 ---- // jmethodID is a pointer to Method* return (jmethodID)cld->jmethod_ids()->add_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) { ClassLoaderData* cld = loader_data; Method** ptr = (Method**)m;
< prev index next >