115 check_ctxk(ctxk); |
115 check_ctxk(ctxk); |
116 assert_common_1(no_finalizable_subclasses, ctxk); |
116 assert_common_1(no_finalizable_subclasses, ctxk); |
117 } |
117 } |
118 |
118 |
119 void Dependencies::assert_call_site_target_value(ciCallSite* call_site, ciMethodHandle* method_handle) { |
119 void Dependencies::assert_call_site_target_value(ciCallSite* call_site, ciMethodHandle* method_handle) { |
120 ciKlass* ctxk = call_site->get_context(); |
120 assert_common_2(call_site_target_value, call_site, method_handle); |
121 check_ctxk(ctxk); |
|
122 assert_common_3(call_site_target_value, ctxk, call_site, method_handle); |
|
123 } |
121 } |
124 |
122 |
125 // Helper function. If we are adding a new dep. under ctxk2, |
123 // Helper function. If we are adding a new dep. under ctxk2, |
126 // try to find an old dep. under a broader* ctxk1. If there is |
124 // try to find an old dep. under a broader* ctxk1. If there is |
127 // |
125 // |
173 } |
171 } |
174 } |
172 } |
175 } |
173 } |
176 } |
174 } |
177 } else { |
175 } else { |
178 assert(dep_implicit_context_arg(dept) == 0, "sanity"); |
|
179 if (note_dep_seen(dept, x0) && note_dep_seen(dept, x1)) { |
176 if (note_dep_seen(dept, x0) && note_dep_seen(dept, x1)) { |
180 // look in this bucket for redundant assertions |
177 // look in this bucket for redundant assertions |
181 const int stride = 2; |
178 const int stride = 2; |
182 for (int i = deps->length(); (i -= stride) >= 0; ) { |
179 for (int i = deps->length(); (i -= stride) >= 0; ) { |
183 ciBaseObject* y0 = deps->at(i+0); |
180 ciBaseObject* y0 = deps->at(i+0); |
387 1, // concrete_with_no_concrete_subtype ctxk |
384 1, // concrete_with_no_concrete_subtype ctxk |
388 2, // unique_concrete_method ctxk, m |
385 2, // unique_concrete_method ctxk, m |
389 3, // unique_concrete_subtypes_2 ctxk, k1, k2 |
386 3, // unique_concrete_subtypes_2 ctxk, k1, k2 |
390 3, // unique_concrete_methods_2 ctxk, m1, m2 |
387 3, // unique_concrete_methods_2 ctxk, m1, m2 |
391 1, // no_finalizable_subclasses ctxk |
388 1, // no_finalizable_subclasses ctxk |
392 3 // call_site_target_value ctxk, call_site, method_handle |
389 2 // call_site_target_value call_site, method_handle |
393 }; |
390 }; |
394 |
391 |
395 const char* Dependencies::dep_name(Dependencies::DepType dept) { |
392 const char* Dependencies::dep_name(Dependencies::DepType dept) { |
396 if (!dept_in_mask(dept, all_types)) return "?bad-dep?"; |
393 if (!dept_in_mask(dept, all_types)) return "?bad-dep?"; |
397 return _dep_name[dept]; |
394 return _dep_name[dept]; |
1513 if (changes != NULL) |
1510 if (changes != NULL) |
1514 search_at = changes->new_type(); // just look at the new bit |
1511 search_at = changes->new_type(); // just look at the new bit |
1515 return find_finalizable_subclass(search_at); |
1512 return find_finalizable_subclass(search_at); |
1516 } |
1513 } |
1517 |
1514 |
1518 Klass* Dependencies::check_call_site_target_value(Klass* recorded_ctxk, oop call_site, oop method_handle, CallSiteDepChange* changes) { |
1515 Klass* Dependencies::check_call_site_target_value(oop call_site, oop method_handle, CallSiteDepChange* changes) { |
|
1516 assert(!oopDesc::is_null(call_site), "sanity"); |
|
1517 assert(!oopDesc::is_null(method_handle), "sanity"); |
1519 assert(call_site->is_a(SystemDictionary::CallSite_klass()), "sanity"); |
1518 assert(call_site->is_a(SystemDictionary::CallSite_klass()), "sanity"); |
1520 assert(!oopDesc::is_null(method_handle), "sanity"); |
1519 |
1521 |
|
1522 Klass* call_site_ctxk = MethodHandles::get_call_site_context(call_site); |
|
1523 assert(!Klass::is_null(call_site_ctxk), "call site context should be initialized already"); |
|
1524 if (recorded_ctxk != call_site_ctxk) { |
|
1525 // Stale context |
|
1526 return recorded_ctxk; |
|
1527 } |
|
1528 if (changes == NULL) { |
1520 if (changes == NULL) { |
1529 // Validate all CallSites |
1521 // Validate all CallSites |
1530 if (java_lang_invoke_CallSite::target(call_site) != method_handle) |
1522 if (java_lang_invoke_CallSite::target(call_site) != method_handle) |
1531 return call_site->klass(); // assertion failed |
1523 return call_site->klass(); // assertion failed |
1532 } else { |
1524 } else { |
1597 Dependencies::check_valid_dependency_type(type()); |
1589 Dependencies::check_valid_dependency_type(type()); |
1598 |
1590 |
1599 Klass* witness = NULL; |
1591 Klass* witness = NULL; |
1600 switch (type()) { |
1592 switch (type()) { |
1601 case call_site_target_value: |
1593 case call_site_target_value: |
1602 witness = check_call_site_target_value(context_type(), argument_oop(1), argument_oop(2), changes); |
1594 witness = check_call_site_target_value(argument_oop(0), argument_oop(1), changes); |
1603 break; |
1595 break; |
1604 default: |
1596 default: |
1605 witness = NULL; |
1597 witness = NULL; |
1606 break; |
1598 break; |
1607 } |
1599 } |