121 122 // Testers 123 static bool is_instance(oop obj) { 124 return obj != NULL && obj->klass() == SystemDictionary::String_klass(); 125 } 126 127 // Debugging 128 static void print(Handle java_string, outputStream* st); 129 friend class JavaClasses; 130 }; 131 132 133 // Interface to java.lang.Class objects 134 135 class java_lang_Class : AllStatic { 136 friend class VMStructs; 137 private: 138 // The fake offsets are added by the class loader when java.lang.Class is loaded 139 140 enum { 141 hc_klass_offset = 0, 142 hc_array_klass_offset = 1, 143 hc_resolved_constructor_offset = 2, 144 hc_size_offset = 3, 145 hc_static_oop_field_size = 4, 146 hc_number_of_fake_oop_fields = 3, 147 hc_number_of_fake_int_fields = 2 148 }; 149 150 static int klass_offset; 151 static int resolved_constructor_offset; 152 static int array_klass_offset; 153 static int number_of_fake_oop_fields; 154 155 static int oop_size_offset; 156 static int static_oop_field_size_offset; 157 158 static void compute_offsets(); 159 static bool offsets_computed; 160 static int classRedefinedCount_offset; 161 static int parallelCapable_offset; 162 163 public: 164 // Instance creation 165 static oop create_mirror(KlassHandle k, TRAPS); | 121 122 // Testers 123 static bool is_instance(oop obj) { 124 return obj != NULL && obj->klass() == SystemDictionary::String_klass(); 125 } 126 127 // Debugging 128 static void print(Handle java_string, outputStream* st); 129 friend class JavaClasses; 130 }; 131 132 133 // Interface to java.lang.Class objects 134 135 class java_lang_Class : AllStatic { 136 friend class VMStructs; 137 private: 138 // The fake offsets are added by the class loader when java.lang.Class is loaded 139 140 enum { 141 hc_number_of_fake_oop_fields = 3, 142 hc_number_of_fake_int_fields = 2 143 }; 144 145 static int klass_offset; 146 static int resolved_constructor_offset; 147 static int array_klass_offset; 148 static int number_of_fake_oop_fields; 149 150 static int oop_size_offset; 151 static int static_oop_field_size_offset; 152 153 static void compute_offsets(); 154 static bool offsets_computed; 155 static int classRedefinedCount_offset; 156 static int parallelCapable_offset; 157 158 public: 159 // Instance creation 160 static oop create_mirror(KlassHandle k, TRAPS); |