Mercurial > hg > truffle
comparison src/share/vm/code/dependencies.hpp @ 14909:4ca6dc0799b6
Backout jdk9 merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Tue, 01 Apr 2014 13:57:07 +0200 |
parents | d8041d695d19 |
children | 6eda3b299460 |
comparison
equal
deleted
inserted
replaced
14908:8db6e76cb658 | 14909:4ca6dc0799b6 |
---|---|
30 #include "ci/ciMethodHandle.hpp" | 30 #include "ci/ciMethodHandle.hpp" |
31 #include "classfile/systemDictionary.hpp" | 31 #include "classfile/systemDictionary.hpp" |
32 #include "code/compressedStream.hpp" | 32 #include "code/compressedStream.hpp" |
33 #include "code/nmethod.hpp" | 33 #include "code/nmethod.hpp" |
34 #include "utilities/growableArray.hpp" | 34 #include "utilities/growableArray.hpp" |
35 #include "utilities/hashtable.hpp" | |
36 | 35 |
37 //** Dependencies represent assertions (approximate invariants) within | 36 //** Dependencies represent assertions (approximate invariants) within |
38 // the runtime system, e.g. class hierarchy changes. An example is an | 37 // the runtime system, e.g. class hierarchy changes. An example is an |
39 // assertion that a given method is not overridden; another example is | 38 // assertion that a given method is not overridden; another example is |
40 // that a type has only one concrete subtype. Compiled code which | 39 // that a type has only one concrete subtype. Compiled code which |
569 } | 568 } |
570 | 569 |
571 bool next(); | 570 bool next(); |
572 | 571 |
573 DepType type() { return _type; } | 572 DepType type() { return _type; } |
574 bool has_oop_argument() { return type() == call_site_target_value; } | |
575 uintptr_t get_identifier(int i); | |
576 | |
577 int argument_count() { return dep_args(type()); } | 573 int argument_count() { return dep_args(type()); } |
578 int argument_index(int i) { assert(0 <= i && i < argument_count(), "oob"); | 574 int argument_index(int i) { assert(0 <= i && i < argument_count(), "oob"); |
579 return _xi[i]; } | 575 return _xi[i]; } |
580 Metadata* argument(int i); // => recorded_oop_at(argument_index(i)) | 576 Metadata* argument(int i); // => recorded_oop_at(argument_index(i)) |
581 oop argument_oop(int i); // => recorded_oop_at(argument_index(i)) | 577 oop argument_oop(int i); // => recorded_oop_at(argument_index(i)) |
612 void print_dependency(Klass* witness = NULL, bool verbose = false); | 608 void print_dependency(Klass* witness = NULL, bool verbose = false); |
613 }; | 609 }; |
614 friend class Dependencies::DepStream; | 610 friend class Dependencies::DepStream; |
615 | 611 |
616 static void print_statistics() PRODUCT_RETURN; | 612 static void print_statistics() PRODUCT_RETURN; |
617 }; | |
618 | |
619 | |
620 class DependencySignature : public GenericHashtableEntry<DependencySignature, ResourceObj> { | |
621 private: | |
622 int _args_count; | |
623 uintptr_t _argument_hash[Dependencies::max_arg_count]; | |
624 Dependencies::DepType _type; | |
625 | |
626 public: | |
627 DependencySignature(Dependencies::DepStream& dep) { | |
628 _args_count = dep.argument_count(); | |
629 _type = dep.type(); | |
630 for (int i = 0; i < _args_count; i++) { | |
631 _argument_hash[i] = dep.get_identifier(i); | |
632 } | |
633 } | |
634 | |
635 bool equals(DependencySignature* sig) const; | |
636 uintptr_t key() const { return _argument_hash[0] >> 2; } | |
637 | |
638 int args_count() const { return _args_count; } | |
639 uintptr_t arg(int idx) const { return _argument_hash[idx]; } | |
640 Dependencies::DepType type() const { return _type; } | |
641 }; | 613 }; |
642 | 614 |
643 | 615 |
644 // Every particular DepChange is a sub-class of this class. | 616 // Every particular DepChange is a sub-class of this class. |
645 class DepChange : public StackObj { | 617 class DepChange : public StackObj { |