Mon, 12 Aug 2019 18:30:40 +0300
8223147: JFR Backport
8199712: Flight Recorder
8203346: JFR: Inconsistent signature of jfr_add_string_constant
8195817: JFR.stop should require name of recording
8195818: JFR.start should increase autogenerated name by one
8195819: Remove recording=x from jcmd JFR.check output
8203921: JFR thread sampling is missing fixes from JDK-8194552
8203929: Limit amount of data for JFR.dump
8203664: JFR start failure after AppCDS archive created with JFR StartFlightRecording
8003209: JFR events for network utilization
8207392: [PPC64] Implement JFR profiling
8202835: jfr/event/os/TestSystemProcess.java fails on missing events
Summary: Backport JFR from JDK11. Initial integration
Reviewed-by: neugens
duke@435 | 1 | /* |
dbuck@8716 | 2 | * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
duke@435 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | * |
duke@435 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | * published by the Free Software Foundation. |
duke@435 | 8 | * |
duke@435 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | * accompanied this code). |
duke@435 | 14 | * |
duke@435 | 15 | * You should have received a copy of the GNU General Public License version |
duke@435 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | * |
trims@1907 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | * or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | * questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
stefank@2314 | 25 | #ifndef SHARE_VM_OOPS_ARRAYKLASS_HPP |
stefank@2314 | 26 | #define SHARE_VM_OOPS_ARRAYKLASS_HPP |
stefank@2314 | 27 | |
stefank@2314 | 28 | #include "memory/universe.hpp" |
stefank@2314 | 29 | #include "oops/klass.hpp" |
coleenp@4037 | 30 | |
lfoltan@6818 | 31 | class fieldDescriptor; |
coleenp@4037 | 32 | class klassVtable; |
stefank@2314 | 33 | |
coleenp@4142 | 34 | // ArrayKlass is the abstract baseclass for all array classes |
duke@435 | 35 | |
coleenp@4142 | 36 | class ArrayKlass: public Klass { |
duke@435 | 37 | friend class VMStructs; |
duke@435 | 38 | private: |
duke@435 | 39 | int _dimension; // This is n'th-dimensional array. |
coleenp@4037 | 40 | Klass* volatile _higher_dimension; // Refers the (n+1)'th-dimensional array (if present). |
coleenp@4037 | 41 | Klass* volatile _lower_dimension; // Refers the (n-1)'th-dimensional array (if present). |
duke@435 | 42 | int _vtable_len; // size of vtable for this klass |
duke@435 | 43 | oop _component_mirror; // component type, as a java/lang/Class |
duke@435 | 44 | |
coleenp@4037 | 45 | protected: |
coleenp@4037 | 46 | // Constructors |
coleenp@4037 | 47 | // The constructor with the Symbol argument does the real array |
coleenp@4037 | 48 | // initialization, the other is a dummy |
coleenp@4142 | 49 | ArrayKlass(Symbol* name); |
coleenp@4142 | 50 | ArrayKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for cds"); } |
coleenp@4037 | 51 | |
duke@435 | 52 | public: |
duke@435 | 53 | // Testing operation |
coleenp@4037 | 54 | bool oop_is_array_slow() const { return true; } |
duke@435 | 55 | |
duke@435 | 56 | // Instance variables |
duke@435 | 57 | int dimension() const { return _dimension; } |
duke@435 | 58 | void set_dimension(int dimension) { _dimension = dimension; } |
duke@435 | 59 | |
coleenp@4037 | 60 | Klass* higher_dimension() const { return _higher_dimension; } |
coleenp@4037 | 61 | void set_higher_dimension(Klass* k) { _higher_dimension = k; } |
coleenp@4037 | 62 | Klass** adr_higher_dimension() { return (Klass**)&this->_higher_dimension;} |
duke@435 | 63 | |
coleenp@4037 | 64 | Klass* lower_dimension() const { return _lower_dimension; } |
coleenp@4037 | 65 | void set_lower_dimension(Klass* k) { _lower_dimension = k; } |
coleenp@4037 | 66 | Klass** adr_lower_dimension() { return (Klass**)&this->_lower_dimension;} |
duke@435 | 67 | |
duke@435 | 68 | // offset of first element, including any padding for the sake of alignment |
duke@435 | 69 | int array_header_in_bytes() const { return layout_helper_header_size(layout_helper()); } |
duke@435 | 70 | int log2_element_size() const { return layout_helper_log2_element_size(layout_helper()); } |
duke@435 | 71 | // type of elements (T_OBJECT for both oop arrays and array-arrays) |
duke@435 | 72 | BasicType element_type() const { return layout_helper_element_type(layout_helper()); } |
duke@435 | 73 | |
duke@435 | 74 | oop component_mirror() const { return _component_mirror; } |
coleenp@4037 | 75 | void set_component_mirror(oop m) { klass_oop_store(&_component_mirror, m); } |
duke@435 | 76 | oop* adr_component_mirror() { return (oop*)&this->_component_mirror;} |
duke@435 | 77 | |
duke@435 | 78 | // Compiler/Interpreter offset |
coleenp@4142 | 79 | static ByteSize component_mirror_offset() { return in_ByteSize(offset_of(ArrayKlass, _component_mirror)); } |
duke@435 | 80 | |
coleenp@4037 | 81 | virtual Klass* java_super() const;//{ return SystemDictionary::Object_klass(); } |
duke@435 | 82 | |
duke@435 | 83 | // Allocation |
duke@435 | 84 | // Sizes points to the first dimension of the array, subsequent dimensions |
duke@435 | 85 | // are always in higher memory. The callers of these set that up. |
duke@435 | 86 | virtual oop multi_allocate(int rank, jint* sizes, TRAPS); |
duke@435 | 87 | objArrayOop allocate_arrayArray(int n, int length, TRAPS); |
duke@435 | 88 | |
lfoltan@6818 | 89 | // find field according to JVM spec 5.4.3.2, returns the klass in which the field is defined |
lfoltan@6818 | 90 | Klass* find_field(Symbol* name, Symbol* sig, fieldDescriptor* fd) const; |
lfoltan@6818 | 91 | |
duke@435 | 92 | // Lookup operations |
dbuck@8716 | 93 | Method* uncached_lookup_method(Symbol* name, Symbol* signature, OverpassLookupMode overpass_mode) const; |
duke@435 | 94 | |
coleenp@4037 | 95 | // Casting from Klass* |
coleenp@4142 | 96 | static ArrayKlass* cast(Klass* k) { |
coleenp@4142 | 97 | assert(k->oop_is_array(), "cast to ArrayKlass"); |
coleenp@4142 | 98 | return (ArrayKlass*) k; |
duke@435 | 99 | } |
duke@435 | 100 | |
coleenp@4037 | 101 | GrowableArray<Klass*>* compute_secondary_supers(int num_extra_slots); |
coleenp@4037 | 102 | bool compute_is_subtype_of(Klass* k); |
duke@435 | 103 | |
duke@435 | 104 | // Sizing |
coleenp@4142 | 105 | static int header_size() { return sizeof(ArrayKlass)/HeapWordSize; } |
coleenp@4037 | 106 | static int static_size(int header_size); |
duke@435 | 107 | |
acorn@4497 | 108 | #if INCLUDE_SERVICES |
acorn@4497 | 109 | virtual void collect_statistics(KlassSizeStats *sz) const { |
acorn@4497 | 110 | Klass::collect_statistics(sz); |
acorn@4497 | 111 | // Do nothing for now, but remember to modify if you add new |
acorn@4497 | 112 | // stuff to ArrayKlass. |
acorn@4497 | 113 | } |
acorn@4497 | 114 | #endif |
acorn@4497 | 115 | |
duke@435 | 116 | // Java vtable |
duke@435 | 117 | klassVtable* vtable() const; // return new klassVtable |
duke@435 | 118 | int vtable_length() const { return _vtable_len; } |
duke@435 | 119 | static int base_vtable_length() { return Universe::base_vtable_size(); } |
duke@435 | 120 | void set_vtable_length(int len) { assert(len == base_vtable_length(), "bad length"); _vtable_len = len; } |
duke@435 | 121 | protected: |
duke@435 | 122 | inline intptr_t* start_of_vtable() const; |
duke@435 | 123 | |
duke@435 | 124 | public: |
duke@435 | 125 | // Iterators |
coleenp@4037 | 126 | void array_klasses_do(void f(Klass* k)); |
coleenp@4037 | 127 | void array_klasses_do(void f(Klass* k, TRAPS), TRAPS); |
duke@435 | 128 | |
coleenp@4037 | 129 | // GC support |
coleenp@4037 | 130 | virtual void oops_do(OopClosure* cl); |
coleenp@4037 | 131 | |
duke@435 | 132 | // Return a handle. |
coleenp@4142 | 133 | static void complete_create_array_klass(ArrayKlass* k, KlassHandle super_klass, TRAPS); |
coleenp@4037 | 134 | |
duke@435 | 135 | |
bobv@2036 | 136 | // jvm support |
bobv@2036 | 137 | jint compute_modifier_flags(TRAPS) const; |
duke@435 | 138 | |
bobv@2036 | 139 | // JVMTI support |
bobv@2036 | 140 | jint jvmti_class_status() const; |
duke@435 | 141 | |
coleenp@4037 | 142 | // CDS support - remove and restore oops from metadata. Oops are not shared. |
coleenp@4037 | 143 | virtual void remove_unshareable_info(); |
iklam@7089 | 144 | virtual void restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS); |
coleenp@4037 | 145 | |
duke@435 | 146 | // Printing |
coleenp@4037 | 147 | void print_on(outputStream* st) const; |
coleenp@4037 | 148 | void print_value_on(outputStream* st) const; |
coleenp@4037 | 149 | |
duke@435 | 150 | void oop_print_on(oop obj, outputStream* st); |
bobv@2036 | 151 | |
duke@435 | 152 | // Verification |
coleenp@6316 | 153 | void verify_on(outputStream* st); |
coleenp@4037 | 154 | |
duke@435 | 155 | void oop_verify_on(oop obj, outputStream* st); |
duke@435 | 156 | }; |
stefank@2314 | 157 | |
stefank@2314 | 158 | #endif // SHARE_VM_OOPS_ARRAYKLASS_HPP |