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