< prev index next >

src/hotspot/share/ci/ciMethod.cpp

Print this page

        

*** 70,98 **** _holder(holder) { assert(h_m() != NULL, "no null method"); if (LogTouchedMethods) { ! h_m()->log_touched(Thread::current()); } // These fields are always filled in in loaded methods. ! _flags = ciFlags(h_m()->access_flags()); // Easy to compute, so fill them in now. ! _max_stack = h_m()->max_stack(); ! _max_locals = h_m()->max_locals(); ! _code_size = h_m()->code_size(); ! _intrinsic_id = h_m()->intrinsic_id(); ! _handler_count = h_m()->exception_table_length(); ! _size_of_parameters = h_m()->size_of_parameters(); ! _uses_monitors = h_m()->access_flags().has_monitor_bytecodes(); ! _balanced_monitors = !_uses_monitors || h_m()->access_flags().is_monitor_matching(); ! _is_c1_compilable = !h_m()->is_not_c1_compilable(); ! _is_c2_compilable = !h_m()->is_not_c2_compilable(); _can_be_parsed = true; ! _has_reserved_stack_access = h_m()->has_reserved_stack_access(); ! _is_overpass = h_m()->is_overpass(); // Lazy fields, filled in on demand. Require allocation. _code = NULL; _exception_handlers = NULL; _liveness = NULL; _method_blocks = NULL; --- 70,98 ---- _holder(holder) { assert(h_m() != NULL, "no null method"); if (LogTouchedMethods) { ! h_m->log_touched(Thread::current()); } // These fields are always filled in in loaded methods. ! _flags = ciFlags(h_m->access_flags()); // Easy to compute, so fill them in now. ! _max_stack = h_m->max_stack(); ! _max_locals = h_m->max_locals(); ! _code_size = h_m->code_size(); ! _intrinsic_id = h_m->intrinsic_id(); ! _handler_count = h_m->exception_table_length(); ! _size_of_parameters = h_m->size_of_parameters(); ! _uses_monitors = h_m->access_flags().has_monitor_bytecodes(); ! _balanced_monitors = !_uses_monitors || h_m->access_flags().is_monitor_matching(); ! _is_c1_compilable = !h_m->is_not_c1_compilable(); ! _is_c2_compilable = !h_m->is_not_c2_compilable(); _can_be_parsed = true; ! _has_reserved_stack_access = h_m->has_reserved_stack_access(); ! _is_overpass = h_m->is_overpass(); // Lazy fields, filled in on demand. Require allocation. _code = NULL; _exception_handlers = NULL; _liveness = NULL; _method_blocks = NULL;
*** 112,149 **** } } else { DEBUG_ONLY(CompilerThread::current()->check_possible_safepoint()); } ! if (h_m()->method_holder()->is_linked()) { ! _can_be_statically_bound = h_m()->can_be_statically_bound(); } else { // Have to use a conservative value in this case. _can_be_statically_bound = false; } // Adjust the definition of this condition to be more useful: // %%% take these conditions into account in vtable generation ! if (!_can_be_statically_bound && h_m()->is_private()) _can_be_statically_bound = true; ! if (_can_be_statically_bound && h_m()->is_abstract()) _can_be_statically_bound = false; // generating _signature may allow GC and therefore move m. // These fields are always filled in. ! _name = env->get_symbol(h_m()->name()); ! ciSymbol* sig_symbol = env->get_symbol(h_m()->signature()); ! constantPoolHandle cpool = h_m()->constants(); _signature = new (env->arena()) ciSignature(_holder, cpool, sig_symbol); _method_data = NULL; ! _nmethod_age = h_m()->nmethod_age(); // Take a snapshot of these values, so they will be commensurate with the MDO. if (ProfileInterpreter || TieredCompilation) { ! int invcnt = h_m()->interpreter_invocation_count(); // if the value overflowed report it as max int _interpreter_invocation_count = invcnt < 0 ? max_jint : invcnt ; ! _interpreter_throwout_count = h_m()->interpreter_throwout_count(); } else { _interpreter_invocation_count = 0; _interpreter_throwout_count = 0; } if (_interpreter_invocation_count == 0) --- 112,149 ---- } } else { DEBUG_ONLY(CompilerThread::current()->check_possible_safepoint()); } ! if (h_m->method_holder()->is_linked()) { ! _can_be_statically_bound = h_m->can_be_statically_bound(); } else { // Have to use a conservative value in this case. _can_be_statically_bound = false; } // Adjust the definition of this condition to be more useful: // %%% take these conditions into account in vtable generation ! if (!_can_be_statically_bound && h_m->is_private()) _can_be_statically_bound = true; ! if (_can_be_statically_bound && h_m->is_abstract()) _can_be_statically_bound = false; // generating _signature may allow GC and therefore move m. // These fields are always filled in. ! _name = env->get_symbol(h_m->name()); ! ciSymbol* sig_symbol = env->get_symbol(h_m->signature()); ! constantPoolHandle cpool(Thread::current(), h_m->constants()); _signature = new (env->arena()) ciSignature(_holder, cpool, sig_symbol); _method_data = NULL; ! _nmethod_age = h_m->nmethod_age(); // Take a snapshot of these values, so they will be commensurate with the MDO. if (ProfileInterpreter || TieredCompilation) { ! int invcnt = h_m->interpreter_invocation_count(); // if the value overflowed report it as max int _interpreter_invocation_count = invcnt < 0 ? max_jint : invcnt ; ! _interpreter_throwout_count = h_m->interpreter_throwout_count(); } else { _interpreter_invocation_count = 0; _interpreter_throwout_count = 0; } if (_interpreter_invocation_count == 0)
*** 429,439 **** // OSR when loading the locals. ResourceBitMap ciMethod::live_local_oops_at_bci(int bci) { VM_ENTRY_MARK; InterpreterOopMap mask; ! OopMapCache::compute_one_oop_map(get_Method(), bci, &mask); int mask_size = max_locals(); ResourceBitMap result(mask_size); int i; for (i = 0; i < mask_size ; i++ ) { if (mask.is_oop(i)) result.set_bit(i); --- 429,439 ---- // OSR when loading the locals. ResourceBitMap ciMethod::live_local_oops_at_bci(int bci) { VM_ENTRY_MARK; InterpreterOopMap mask; ! OopMapCache::compute_one_oop_map(methodHandle(THREAD, get_Method()), bci, &mask); int mask_size = max_locals(); ResourceBitMap result(mask_size); int i; for (i = 0; i < mask_size ; i++ ) { if (mask.is_oop(i)) result.set_bit(i);
*** 747,758 **** methodHandle target; { MutexLocker locker(Compile_lock); Klass* context = actual_recv->get_Klass(); ! target = Dependencies::find_unique_concrete_method(context, ! root_m->get_Method()); // %%% Should upgrade this ciMethod API to look for 1 or 2 concrete methods. } #ifndef PRODUCT if (TraceDependencies && target() != NULL && target() != root_m->get_Method()) { --- 747,758 ---- methodHandle target; { MutexLocker locker(Compile_lock); Klass* context = actual_recv->get_Klass(); ! target = methodHandle(THREAD, Dependencies::find_unique_concrete_method(context, ! root_m->get_Method())); // %%% Should upgrade this ciMethod API to look for 1 or 2 concrete methods. } #ifndef PRODUCT if (TraceDependencies && target() != NULL && target() != root_m->get_Method()) {
*** 808,818 **** Symbol* h_name = name()->get_symbol(); Symbol* h_signature = signature()->get_symbol(); LinkInfo link_info(resolved, h_name, h_signature, caller_klass, check_access ? LinkInfo::needs_access_check : LinkInfo::skip_access_check); ! methodHandle m; // Only do exact lookup if receiver klass has been linked. Otherwise, // the vtable has not been setup, and the LinkResolver will fail. if (recv->is_array_klass() || (InstanceKlass::cast(recv)->is_linked() && !exact_receiver->is_interface())) { --- 808,818 ---- Symbol* h_name = name()->get_symbol(); Symbol* h_signature = signature()->get_symbol(); LinkInfo link_info(resolved, h_name, h_signature, caller_klass, check_access ? LinkInfo::needs_access_check : LinkInfo::skip_access_check); ! Method* m = NULL; // Only do exact lookup if receiver klass has been linked. Otherwise, // the vtable has not been setup, and the LinkResolver will fail. if (recv->is_array_klass() || (InstanceKlass::cast(recv)->is_linked() && !exact_receiver->is_interface())) {
*** 821,838 **** } else { m = LinkResolver::resolve_virtual_call_or_null(recv, link_info); } } ! if (m.is_null()) { // Return NULL only if there was a problem with lookup (uninitialized class, etc.) return NULL; } ciMethod* result = this; ! if (m() != get_Method()) { ! result = CURRENT_THREAD_ENV->get_method(m()); } // Don't return abstract methods because they aren't // optimizable or interesting. if (result->is_abstract()) { --- 821,838 ---- } else { m = LinkResolver::resolve_virtual_call_or_null(recv, link_info); } } ! if (m == NULL) { // Return NULL only if there was a problem with lookup (uninitialized class, etc.) return NULL; } ciMethod* result = this; ! if (m != get_Method()) { ! result = CURRENT_THREAD_ENV->get_method(m); } // Don't return abstract methods because they aren't // optimizable or interesting. if (result->is_abstract()) {
*** 1033,1043 **** // public, retroactive version bool ciMethod::ensure_method_data() { bool result = true; if (_method_data == NULL || _method_data->is_empty()) { GUARDED_VM_ENTRY({ ! result = ensure_method_data(get_Method()); }); } return result; } --- 1033,1044 ---- // public, retroactive version bool ciMethod::ensure_method_data() { bool result = true; if (_method_data == NULL || _method_data->is_empty()) { GUARDED_VM_ENTRY({ ! methodHandle mh(Thread::current(), get_Method()); ! result = ensure_method_data(mh); }); } return result; }
*** 1266,1276 **** { EXCEPTION_MARK; HandleMark hm(THREAD); constantPoolHandle pool (THREAD, get_Method()->constants()); Bytecodes::Code code = (is_static ? Bytecodes::_invokestatic : Bytecodes::_invokevirtual); ! methodHandle spec_method = LinkResolver::resolve_method_statically(code, pool, refinfo_index, THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return false; } else { return (spec_method->is_static() == is_static); --- 1267,1277 ---- { EXCEPTION_MARK; HandleMark hm(THREAD); constantPoolHandle pool (THREAD, get_Method()->constants()); Bytecodes::Code code = (is_static ? Bytecodes::_invokestatic : Bytecodes::_invokevirtual); ! Method* spec_method = LinkResolver::resolve_method_statically(code, pool, refinfo_index, THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return false; } else { return (spec_method->is_static() == is_static);
< prev index next >