8171008: Integrate AOT compiler into JDK

Co-authored-by: Christian Thalinger <cthalinger@twitter.com>
Co-authored-by: Dean Long <dean.long@oracle.com>
Co-authored-by: Dmitrij Pochepko <dmitrij.pochepko@oracle.com>
Co-authored-by: Dmitry Chuyko <dmitry.chuyko@oracle.com>
Co-authored-by: Doug Simon <doug.simon@oracle.com>
Co-authored-by: Eric Caspole <eric.caspole@oracle.com>
Co-authored-by: Igor Ignatyev <igor.ignatyev@oracle.com>
Co-authored-by: Igor Veresov <igor.veresov@oracle.com>
Co-authored-by: John Rose <john.r.rose@oracle.com>
Co-authored-by: Morris Meyer <morris.meyer@oracle.com>
Co-authored-by: Niclas Adlertz <niclas.adlertz@oracle.com>
Co-authored-by: Rickard Backman <rickard.backman@oracle.com>
Reviewed-by: erikj, mchung, psandoz, coleenp, iklam, stefank, simonis
This commit is contained in:
Bharadwaj Yadavalli 2016-12-11 19:07:04 -08:00 committed by Vladimir Kozlov
parent 3ef35612c7
commit 2841c5eb2b
262 changed files with 19625 additions and 676 deletions

View file

@ -54,6 +54,7 @@
// indicating where oops are located in instances of this klass.
// [EMBEDDED implementor of the interface] only exist for interface
// [EMBEDDED host klass ] only exist for an anonymous class (JSR 292 enabled)
// [EMBEDDED fingerprint ] only if should_store_fingerprint()==true
// forward declaration for class -- see below for definition
@ -215,10 +216,12 @@ class InstanceKlass: public Klass {
_misc_has_nonstatic_concrete_methods = 1 << 7, // class/superclass/implemented interfaces has non-static, concrete methods
_misc_declares_nonstatic_concrete_methods = 1 << 8, // directly declares non-static, concrete methods
_misc_has_been_redefined = 1 << 9, // class has been redefined
_misc_is_scratch_class = 1 << 10, // class is the redefined scratch class
_misc_is_shared_boot_class = 1 << 11, // defining class loader is boot class loader
_misc_is_shared_platform_class = 1 << 12, // defining class loader is platform class loader
_misc_is_shared_app_class = 1 << 13 // defining class loader is app class loader
_misc_has_passed_fingerprint_check = 1 << 10, // when this class was loaded, the fingerprint computed from its
// code source was found to be matching the value recorded by AOT.
_misc_is_scratch_class = 1 << 11, // class is the redefined scratch class
_misc_is_shared_boot_class = 1 << 12, // defining class loader is boot class loader
_misc_is_shared_platform_class = 1 << 13, // defining class loader is platform class loader
_misc_is_shared_app_class = 1 << 14 // defining class loader is app class loader
};
u2 loader_type_bits() {
return _misc_is_shared_boot_class|_misc_is_shared_platform_class|_misc_is_shared_app_class;
@ -732,6 +735,23 @@ class InstanceKlass: public Klass {
_misc_flags |= _misc_has_been_redefined;
}
bool has_passed_fingerprint_check() const {
return (_misc_flags & _misc_has_passed_fingerprint_check) != 0;
}
void set_has_passed_fingerprint_check(bool b) {
if (b) {
_misc_flags |= _misc_has_passed_fingerprint_check;
} else {
_misc_flags &= ~_misc_has_passed_fingerprint_check;
}
}
bool supers_have_passed_fingerprint_checks();
static bool should_store_fingerprint();
bool has_stored_fingerprint() const;
uint64_t get_stored_fingerprint() const;
void store_fingerprint(uint64_t fingerprint);
bool is_scratch_class() const {
return (_misc_flags & _misc_is_scratch_class) != 0;
}
@ -1028,19 +1048,21 @@ public:
static int size(int vtable_length, int itable_length,
int nonstatic_oop_map_size,
bool is_interface, bool is_anonymous) {
bool is_interface, bool is_anonymous, bool has_stored_fingerprint) {
return align_metadata_size(header_size() +
vtable_length +
itable_length +
nonstatic_oop_map_size +
(is_interface ? (int)sizeof(Klass*)/wordSize : 0) +
(is_anonymous ? (int)sizeof(Klass*)/wordSize : 0));
(is_anonymous ? (int)sizeof(Klass*)/wordSize : 0) +
(has_stored_fingerprint ? (int)sizeof(uint64_t*)/wordSize : 0));
}
int size() const { return size(vtable_length(),
itable_length(),
nonstatic_oop_map_size(),
is_interface(),
is_anonymous());
is_anonymous(),
has_stored_fingerprint());
}
#if INCLUDE_SERVICES
virtual void collect_statistics(KlassSizeStats *sz) const;
@ -1083,6 +1105,24 @@ public:
}
}
address adr_fingerprint() const {
if (has_stored_fingerprint()) {
InstanceKlass** adr_host = adr_host_klass();
if (adr_host != NULL) {
return (address)(adr_host + 1);
}
Klass** adr_impl = adr_implementor();
if (adr_impl != NULL) {
return (address)(adr_impl + 1);
}
return (address)end_of_nonstatic_oop_maps();
} else {
return NULL;
}
}
// Use this to return the size of an instance in heap words:
int size_helper() const {
return layout_helper_to_size_helper(layout_helper());