50
51 void DependencyContext::init() {
52 if (UsePerfData) {
53 EXCEPTION_MARK;
54 _perf_total_buckets_allocated_count =
55 PerfDataManager::create_counter(SUN_CI, "nmethodBucketsAllocated", PerfData::U_Events, CHECK);
56 _perf_total_buckets_deallocated_count =
57 PerfDataManager::create_counter(SUN_CI, "nmethodBucketsDeallocated", PerfData::U_Events, CHECK);
58 _perf_total_buckets_stale_count =
59 PerfDataManager::create_counter(SUN_CI, "nmethodBucketsStale", PerfData::U_Events, CHECK);
60 _perf_total_buckets_stale_acc_count =
61 PerfDataManager::create_counter(SUN_CI, "nmethodBucketsStaleAccumulated", PerfData::U_Events, CHECK);
62 }
63 }
64
65 //
66 // Walk the list of dependent nmethods searching for nmethods which
67 // are dependent on the changes that were passed in and mark them for
68 // deoptimization.
69 //
70 void DependencyContext::mark_dependent_nmethods(DeoptimizationScope* deopt_scope, DepChange& changes) {
71 for (nmethodBucket* b = dependencies_not_unloading(); b != nullptr; b = b->next_not_unloading()) {
72 nmethod* nm = b->get_nmethod();
73 if (nm->is_marked_for_deoptimization()) {
74 deopt_scope->dependent(nm);
75 } else if (nm->check_dependency_on(changes)) {
76 LogTarget(Info, dependencies) lt;
77 if (lt.is_enabled()) {
78 ResourceMark rm;
79 LogStream ls(<);
80 ls.print_cr("Marked for deoptimization");
81 changes.print_on(&ls);
82 nm->print_on(&ls);
83 nm->print_dependencies_on(&ls);
84 }
85 deopt_scope->mark(nm, !changes.is_call_site_change());
86 }
87 }
88 }
89
90 //
91 // Add an nmethod to the dependency context.
92 //
|
50
51 void DependencyContext::init() {
52 if (UsePerfData) {
53 EXCEPTION_MARK;
54 _perf_total_buckets_allocated_count =
55 PerfDataManager::create_counter(SUN_CI, "nmethodBucketsAllocated", PerfData::U_Events, CHECK);
56 _perf_total_buckets_deallocated_count =
57 PerfDataManager::create_counter(SUN_CI, "nmethodBucketsDeallocated", PerfData::U_Events, CHECK);
58 _perf_total_buckets_stale_count =
59 PerfDataManager::create_counter(SUN_CI, "nmethodBucketsStale", PerfData::U_Events, CHECK);
60 _perf_total_buckets_stale_acc_count =
61 PerfDataManager::create_counter(SUN_CI, "nmethodBucketsStaleAccumulated", PerfData::U_Events, CHECK);
62 }
63 }
64
65 //
66 // Walk the list of dependent nmethods searching for nmethods which
67 // are dependent on the changes that were passed in and mark them for
68 // deoptimization.
69 //
70 void DependencyContext::mark_dependent_nmethods(DeoptimizationScope* deopt_scope, DepChange& changes, InstanceKlass* context) {
71 for (nmethodBucket* b = dependencies_not_unloading(); b != nullptr; b = b->next_not_unloading()) {
72 nmethod* nm = b->get_nmethod();
73 {
74 LogStreamHandle(Trace, dependencies) log;
75 if (log.is_enabled()) {
76 log.print("Processing ");
77 if (context != nullptr) {
78 log.print(" ctx=");
79 context->name()->print_value_on(&log);
80 log.print(" ");
81 }
82 nm->print_value_on(&log);
83 }
84 }
85 if (nm->is_marked_for_deoptimization()) {
86 deopt_scope->dependent(nm);
87 } else if (nm->check_dependency_on(changes)) {
88 LogTarget(Info, dependencies) lt;
89 if (lt.is_enabled()) {
90 ResourceMark rm;
91 LogStream ls(<);
92 ls.print_cr("Marked for deoptimization");
93 changes.print_on(&ls);
94 nm->print_on(&ls);
95 nm->print_dependencies_on(&ls);
96 }
97 deopt_scope->mark(nm, !changes.is_call_site_change());
98 }
99 }
100 }
101
102 //
103 // Add an nmethod to the dependency context.
104 //
|