510 if (result != NULL) return result; 511 return check_call_site_dependency(NULL); 512 } 513 514 // A lighter version: Checks only around recent changes in a class 515 // hierarchy. (See Universe::flush_dependents_on.) 516 Klass* spot_check_dependency_at(DepChange& changes); 517 518 // Log the current dependency to xtty or compilation log. 519 void log_dependency(Klass* witness = NULL); 520 521 // Print the current dependency to tty. 522 void print_dependency(Klass* witness = NULL, bool verbose = false); 523 }; 524 friend class Dependencies::DepStream; 525 526 static void print_statistics() PRODUCT_RETURN; 527 }; 528 529 530 class DependencySignature : public GenericHashtableEntry<DependencySignature, ResourceObj> { 531 private: 532 int _args_count; 533 uintptr_t _argument_hash[Dependencies::max_arg_count]; 534 Dependencies::DepType _type; 535 536 public: 537 DependencySignature(Dependencies::DepStream& dep) { 538 _args_count = dep.argument_count(); 539 _type = dep.type(); 540 for (int i = 0; i < _args_count; i++) { 541 _argument_hash[i] = dep.get_identifier(i); 542 } 543 } 544 545 bool equals(DependencySignature* sig) const; 546 uintptr_t key() const { return _argument_hash[0] >> 2; } 547 548 int args_count() const { return _args_count; } 549 uintptr_t arg(int idx) const { return _argument_hash[idx]; } 550 Dependencies::DepType type() const { return _type; } 551 }; 552 553 554 // Every particular DepChange is a sub-class of this class. 555 class DepChange : public StackObj { 556 public: 557 // What kind of DepChange is this? 558 virtual bool is_klass_change() const { return false; } 559 virtual bool is_call_site_change() const { return false; } 560 561 // Subclass casting with assertions. 562 KlassDepChange* as_klass_change() { 563 assert(is_klass_change(), "bad cast"); 564 return (KlassDepChange*) this; 565 } 566 CallSiteDepChange* as_call_site_change() { 567 assert(is_call_site_change(), "bad cast"); 568 return (CallSiteDepChange*) this; 569 } 570 | 510 if (result != NULL) return result; 511 return check_call_site_dependency(NULL); 512 } 513 514 // A lighter version: Checks only around recent changes in a class 515 // hierarchy. (See Universe::flush_dependents_on.) 516 Klass* spot_check_dependency_at(DepChange& changes); 517 518 // Log the current dependency to xtty or compilation log. 519 void log_dependency(Klass* witness = NULL); 520 521 // Print the current dependency to tty. 522 void print_dependency(Klass* witness = NULL, bool verbose = false); 523 }; 524 friend class Dependencies::DepStream; 525 526 static void print_statistics() PRODUCT_RETURN; 527 }; 528 529 530 class DependencySignature : public ResourceObj { 531 private: 532 int _args_count; 533 uintptr_t _argument_hash[Dependencies::max_arg_count]; 534 Dependencies::DepType _type; 535 536 public: 537 DependencySignature(Dependencies::DepStream& dep) { 538 _args_count = dep.argument_count(); 539 _type = dep.type(); 540 for (int i = 0; i < _args_count; i++) { 541 _argument_hash[i] = dep.get_identifier(i); 542 } 543 } 544 545 static bool equals(DependencySignature const& s1, DependencySignature const& s2); 546 static unsigned hash (DependencySignature const& s1) { return s1.arg(0) >> 2; } 547 548 int args_count() const { return _args_count; } 549 uintptr_t arg(int idx) const { return _argument_hash[idx]; } 550 Dependencies::DepType type() const { return _type; } 551 552 }; 553 554 555 // Every particular DepChange is a sub-class of this class. 556 class DepChange : public StackObj { 557 public: 558 // What kind of DepChange is this? 559 virtual bool is_klass_change() const { return false; } 560 virtual bool is_call_site_change() const { return false; } 561 562 // Subclass casting with assertions. 563 KlassDepChange* as_klass_change() { 564 assert(is_klass_change(), "bad cast"); 565 return (KlassDepChange*) this; 566 } 567 CallSiteDepChange* as_call_site_change() { 568 assert(is_call_site_change(), "bad cast"); 569 return (CallSiteDepChange*) this; 570 } 571 |