Home | History | Annotate | Download | only in runtime

Lines Matching refs:method

50 // Do we want to deoptimize for method entry and exit listeners or just try to intercept
85 static void UpdateEntrypoints(mirror::ArtMethod* method, const void* quick_code,
89 method->SetEntryPointFromPortableCompiledCode(portable_code);
91 method->SetEntryPointFromQuickCompiledCode(quick_code);
92 bool portable_enabled = method->IsPortableCompiled();
94 method->SetIsPortableCompiled();
96 method->ClearIsPortableCompiled();
98 if (!method->IsResolutionMethod()) {
104 && !method->IsNative() && !method->IsProxyMethod())) {
116 DCHECK(!method->IsNative()) << PrettyMethod(method);
117 DCHECK(!method->IsProxyMethod()) << PrettyMethod(method);
118 method->SetEntryPointFromInterpreter(art::interpreter::artInterpreterToInterpreterBridge);
120 method->SetEntryPointFromInterpreter(art::artInterpreterToCompiledCodeBridge);
125 void Instrumentation::InstallStubsForMethod(mirror::ArtMethod* method) {
126 if (method->IsAbstract() || method->IsProxyMethod()) {
131 if (method->IsConstructor() &&
132 method->GetDeclaringClass()->DescriptorEquals("Ljava/lang/reflect/Proxy;")) {
139 bool is_class_initialized = method->GetDeclaringClass()->IsInitialized();
145 if ((forced_interpret_only_ || IsDeoptimized(method)) && !method->IsNative()) {
150 } else if (is_class_initialized || !method->IsStatic() || method->IsConstructor()) {
152 new_portable_code = class_linker->GetPortableOatCodeFor(method, &have_portable_code);
154 new_quick_code = class_linker->GetQuickOatCodeFor(method);
162 if ((interpreter_stubs_installed_ || forced_interpret_only_ || IsDeoptimized(method)) &&
163 !method->IsNative()) {
169 // Do not overwrite resolution trampoline. When the trampoline initializes the method's
172 if (is_class_initialized || !method->IsStatic() || method->IsConstructor()) {
180 new_portable_code = class_linker->GetPortableOatCodeFor(method, &have_portable_code);
182 new_quick_code = class_linker->GetQuickOatCodeFor(method);
193 UpdateEntrypoints(method, new_quick_code, new_portable_code, have_portable_code);
239 // This is an interpreter frame so method enter event must have been reported. However we
241 // Since we won't report method entry here, we can safely push any DEX pc.
248 LOG(INFO) << " Skipping runtime method. Frame " << GetFrameId();
319 // Create method enter events for all methods currently on the thread's stack. We only do this
358 << " Method=" << PrettyMethod(m);
383 // Create the method exit events. As the methods didn't really exit the result is 0.
605 // Restore stack only if there is no method currently deoptimized.
679 void Instrumentation::UpdateMethodsCode(mirror::ArtMethod* method, const void* quick_code,
689 if ((interpreter_stubs_installed_ || IsDeoptimized(method)) && !method->IsNative()) {
724 UpdateEntrypoints(method, new_quick_code, new_portable_code, new_have_portable_code);
727 bool Instrumentation::AddDeoptimizedMethod(mirror::ArtMethod* method) {
730 // storing the same method twice in the map (the from-space and the
732 if (FindDeoptimizedMethod(method)) {
737 int32_t hash_code = method->IdentityHashCode();
738 deoptimized_methods_.insert(std::make_pair(hash_code, GcRoot<mirror::ArtMethod>(method)));
742 bool Instrumentation::FindDeoptimizedMethod(mirror::ArtMethod* method) {
743 int32_t hash_code = method->IdentityHashCode();
747 if (m == method) {
765 bool Instrumentation::RemoveDeoptimizedMethod(mirror::ArtMethod* method) {
766 int32_t hash_code = method->IdentityHashCode();
770 if (m == method) {
784 void Instrumentation::Deoptimize(mirror::ArtMethod* method) {
785 CHECK(!method->IsNative());
786 CHECK(!method->IsProxyMethod());
787 CHECK(!method->IsAbstract());
792 bool has_not_been_deoptimized = AddDeoptimizedMethod(method);
793 CHECK(has_not_been_deoptimized) << "Method " << PrettyMethod(method)
797 UpdateEntrypoints(method, GetQuickInstrumentationEntryPoint(),
813 void Instrumentation::Undeoptimize(mirror::ArtMethod* method) {
814 CHECK(!method->IsNative());
815 CHECK(!method->IsProxyMethod());
816 CHECK(!method->IsAbstract());
822 bool found_and_erased = RemoveDeoptimizedMethod(method);
823 CHECK(found_and_erased) << "Method " << PrettyMethod(method)
832 if (method->IsStatic() && !method->IsConstructor() &&
833 !method->GetDeclaringClass()->IsInitialized()) {
835 UpdateEntrypoints(method, class_linker->GetQuickResolutionTrampoline(),
844 const void* quick_code = class_linker->GetQuickOatCodeFor(method);
846 const void* portable_code = class_linker->GetPortableOatCodeFor(method, &have_portable_code);
850 UpdateEntrypoints(method, quick_code, portable_code, have_portable_code);
853 // If there is no deoptimized method left, we can restore the stack of each thread.
862 bool Instrumentation::IsDeoptimized(mirror::ArtMethod* method) {
863 DCHECK(method != nullptr);
865 return FindDeoptimizedMethod(method);
883 mirror::ArtMethod* method;
889 method = BeginDeoptimizedMethod();
890 CHECK(method != nullptr);
892 Undeoptimize(method);
897 // Indicates if instrumentation should notify method enter/exit events to the listeners.
921 const void* Instrumentation::GetQuickCodeFor(mirror::ArtMethod* method) const {
924 const void* code = method->GetEntryPointFromQuickCompiledCode();
933 return runtime->GetClassLinker()->GetQuickOatCodeFor(method);
937 mirror::ArtMethod* method,
946 cur->MethodEntered(thread, this_object, method, dex_pc);
951 mirror::ArtMethod* method,
960 cur->MethodExited(thread, this_object, method, dex_pc, return_value);
965 mirror::ArtMethod* method,
969 listener->MethodUnwind(thread, this_object, method, dex_pc);
975 mirror::ArtMethod* method,
980 listener->DexPcMoved(thread, this_object, method, dex_pc);
986 mirror::ArtMethod* method, uint32_t dex_pc,
991 listener->FieldRead(thread, this_object, method, dex_pc, field);
997 mirror::ArtMethod* method, uint32_t dex_pc,
1002 listener->FieldWritten(thread, this_object, method, dex_pc, field, field_value);
1038 mirror::ArtMethod* method,
1044 LOG(INFO) << "Entering " << PrettyMethod(method) << " from PC " << reinterpret_cast<void*>(lr);
1046 instrumentation::InstrumentationStackFrame instrumentation_frame(this_object, method, lr,
1051 MethodEnterEvent(self, this_object, method, 0);
1068 mirror::ArtMethod* method = instrumentation_frame.method_;
1070 char return_shorty = method->GetShorty(&length)[0];
1098 LOG(INFO) << "Deoptimizing from " << PrettyMethod(method)
1106 LOG(INFO) << "Returning from " << PrettyMethod(method)
1121 mirror::ArtMethod* method = instrumentation_frame.method_;
1124 LOG(INFO) << "Popping for deoptimization " << PrettyMethod(method);
1128 LOG(INFO) << "Popping for unwind " << PrettyMethod(method);
1131 // Notify listeners of method unwind.
1135 MethodUnwindEvent(self, instrumentation_frame.this_object_, method, dex_pc);