< prev index next >

src/share/vm/interpreter/interpreterRuntime.cpp

Print this page




1016   }
1017   assert(mdp == mdp2, "wrong mdp");
1018 IRT_END
1019 #endif // ASSERT
1020 
1021 IRT_ENTRY(void, InterpreterRuntime::update_mdp_for_ret(JavaThread* thread, int return_bci))
1022   assert(ProfileInterpreter, "must be profiling interpreter");
1023   ResourceMark rm(thread);
1024   HandleMark hm(thread);
1025   frame fr = thread->last_frame();
1026   assert(fr.is_interpreted_frame(), "must come from interpreter");
1027   MethodData* h_mdo = fr.interpreter_frame_method()->method_data();
1028 
1029   // Grab a lock to ensure atomic access to setting the return bci and
1030   // the displacement.  This can block and GC, invalidating all naked oops.
1031   MutexLocker ml(RetData_lock);
1032 
1033   // ProfileData is essentially a wrapper around a derived oop, so we
1034   // need to take the lock before making any ProfileData structures.
1035   ProfileData* data = h_mdo->data_at(h_mdo->dp_to_di(fr.interpreter_frame_mdp()));

1036   RetData* rdata = data->as_RetData();
1037   address new_mdp = rdata->fixup_ret(return_bci, h_mdo);
1038   fr.interpreter_frame_set_mdp(new_mdp);
1039 IRT_END
1040 
1041 IRT_ENTRY(MethodCounters*, InterpreterRuntime::build_method_counters(JavaThread* thread, Method* m))
1042   MethodCounters* mcs = Method::build_method_counters(m, thread);
1043   if (HAS_PENDING_EXCEPTION) {
1044     assert((PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())), "we expect only an OOM error here");
1045     CLEAR_PENDING_EXCEPTION;
1046   }
1047   return mcs;
1048 IRT_END
1049 
1050 
1051 IRT_ENTRY(void, InterpreterRuntime::at_safepoint(JavaThread* thread))
1052   // We used to need an explict preserve_arguments here for invoke bytecodes. However,
1053   // stack traversal automatically takes care of preserving arguments for invoke, so
1054   // this is no longer needed.
1055 




1016   }
1017   assert(mdp == mdp2, "wrong mdp");
1018 IRT_END
1019 #endif // ASSERT
1020 
1021 IRT_ENTRY(void, InterpreterRuntime::update_mdp_for_ret(JavaThread* thread, int return_bci))
1022   assert(ProfileInterpreter, "must be profiling interpreter");
1023   ResourceMark rm(thread);
1024   HandleMark hm(thread);
1025   frame fr = thread->last_frame();
1026   assert(fr.is_interpreted_frame(), "must come from interpreter");
1027   MethodData* h_mdo = fr.interpreter_frame_method()->method_data();
1028 
1029   // Grab a lock to ensure atomic access to setting the return bci and
1030   // the displacement.  This can block and GC, invalidating all naked oops.
1031   MutexLocker ml(RetData_lock);
1032 
1033   // ProfileData is essentially a wrapper around a derived oop, so we
1034   // need to take the lock before making any ProfileData structures.
1035   ProfileData* data = h_mdo->data_at(h_mdo->dp_to_di(fr.interpreter_frame_mdp()));
1036   guarantee(data != NULL, "profile data must be valid");
1037   RetData* rdata = data->as_RetData();
1038   address new_mdp = rdata->fixup_ret(return_bci, h_mdo);
1039   fr.interpreter_frame_set_mdp(new_mdp);
1040 IRT_END
1041 
1042 IRT_ENTRY(MethodCounters*, InterpreterRuntime::build_method_counters(JavaThread* thread, Method* m))
1043   MethodCounters* mcs = Method::build_method_counters(m, thread);
1044   if (HAS_PENDING_EXCEPTION) {
1045     assert((PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())), "we expect only an OOM error here");
1046     CLEAR_PENDING_EXCEPTION;
1047   }
1048   return mcs;
1049 IRT_END
1050 
1051 
1052 IRT_ENTRY(void, InterpreterRuntime::at_safepoint(JavaThread* thread))
1053   // We used to need an explict preserve_arguments here for invoke bytecodes. However,
1054   // stack traversal automatically takes care of preserving arguments for invoke, so
1055   // this is no longer needed.
1056 


< prev index next >