Mercurial > hg > graal-jvmci-8
comparison src/share/vm/oops/instanceKlass.cpp @ 1144:9b9c1ee9b3f6
Merge
author | iveresov |
---|---|
date | Wed, 06 Jan 2010 22:21:39 -0800 |
parents | 933a3e806ce6 4ce7240d622c |
children | 4e6abf09f540 |
comparison
equal
deleted
inserted
replaced
1129:a5a6adfca6ec | 1144:9b9c1ee9b3f6 |
---|---|
381 { | 381 { |
382 EXCEPTION_MARK; | 382 EXCEPTION_MARK; |
383 this_oop->set_initialization_state_and_notify(initialization_error, THREAD); | 383 this_oop->set_initialization_state_and_notify(initialization_error, THREAD); |
384 CLEAR_PENDING_EXCEPTION; // ignore any exception thrown, class initialization error is thrown below | 384 CLEAR_PENDING_EXCEPTION; // ignore any exception thrown, class initialization error is thrown below |
385 } | 385 } |
386 if (e->is_a(SystemDictionary::error_klass())) { | 386 if (e->is_a(SystemDictionary::Error_klass())) { |
387 THROW_OOP(e()); | 387 THROW_OOP(e()); |
388 } else { | 388 } else { |
389 JavaCallArguments args(e); | 389 JavaCallArguments args(e); |
390 THROW_ARG(vmSymbolHandles::java_lang_ExceptionInInitializerError(), | 390 THROW_ARG(vmSymbolHandles::java_lang_ExceptionInInitializerError(), |
391 vmSymbolHandles::throwable_void_signature(), | 391 vmSymbolHandles::throwable_void_signature(), |
566 if (is_interface() || is_abstract()) { | 566 if (is_interface() || is_abstract()) { |
567 ResourceMark rm(THREAD); | 567 ResourceMark rm(THREAD); |
568 THROW_MSG(throwError ? vmSymbols::java_lang_InstantiationError() | 568 THROW_MSG(throwError ? vmSymbols::java_lang_InstantiationError() |
569 : vmSymbols::java_lang_InstantiationException(), external_name()); | 569 : vmSymbols::java_lang_InstantiationException(), external_name()); |
570 } | 570 } |
571 if (as_klassOop() == SystemDictionary::class_klass()) { | 571 if (as_klassOop() == SystemDictionary::Class_klass()) { |
572 ResourceMark rm(THREAD); | 572 ResourceMark rm(THREAD); |
573 THROW_MSG(throwError ? vmSymbols::java_lang_IllegalAccessError() | 573 THROW_MSG(throwError ? vmSymbols::java_lang_IllegalAccessError() |
574 : vmSymbols::java_lang_IllegalAccessException(), external_name()); | 574 : vmSymbols::java_lang_IllegalAccessException(), external_name()); |
575 } | 575 } |
576 } | 576 } |
2223 | 2223 |
2224 | 2224 |
2225 void instanceKlass::oop_print_on(oop obj, outputStream* st) { | 2225 void instanceKlass::oop_print_on(oop obj, outputStream* st) { |
2226 Klass::oop_print_on(obj, st); | 2226 Klass::oop_print_on(obj, st); |
2227 | 2227 |
2228 if (as_klassOop() == SystemDictionary::string_klass()) { | 2228 if (as_klassOop() == SystemDictionary::String_klass()) { |
2229 typeArrayOop value = java_lang_String::value(obj); | 2229 typeArrayOop value = java_lang_String::value(obj); |
2230 juint offset = java_lang_String::offset(obj); | 2230 juint offset = java_lang_String::offset(obj); |
2231 juint length = java_lang_String::length(obj); | 2231 juint length = java_lang_String::length(obj); |
2232 if (value != NULL && | 2232 if (value != NULL && |
2233 value->is_typeArray() && | 2233 value->is_typeArray() && |
2243 | 2243 |
2244 st->print_cr(BULLET"---- fields (total size %d words):", oop_size(obj)); | 2244 st->print_cr(BULLET"---- fields (total size %d words):", oop_size(obj)); |
2245 FieldPrinter print_nonstatic_field(st, obj); | 2245 FieldPrinter print_nonstatic_field(st, obj); |
2246 do_nonstatic_fields(&print_nonstatic_field); | 2246 do_nonstatic_fields(&print_nonstatic_field); |
2247 | 2247 |
2248 if (as_klassOop() == SystemDictionary::class_klass()) { | 2248 if (as_klassOop() == SystemDictionary::Class_klass()) { |
2249 st->print(BULLET"signature: "); | 2249 st->print(BULLET"signature: "); |
2250 java_lang_Class::print_signature(obj, st); | 2250 java_lang_Class::print_signature(obj, st); |
2251 st->cr(); | 2251 st->cr(); |
2252 klassOop mirrored_klass = java_lang_Class::as_klassOop(obj); | 2252 klassOop mirrored_klass = java_lang_Class::as_klassOop(obj); |
2253 st->print(BULLET"fake entry for mirror: "); | 2253 st->print(BULLET"fake entry for mirror: "); |
2270 | 2270 |
2271 void instanceKlass::oop_print_value_on(oop obj, outputStream* st) { | 2271 void instanceKlass::oop_print_value_on(oop obj, outputStream* st) { |
2272 st->print("a "); | 2272 st->print("a "); |
2273 name()->print_value_on(st); | 2273 name()->print_value_on(st); |
2274 obj->print_address_on(st); | 2274 obj->print_address_on(st); |
2275 if (as_klassOop() == SystemDictionary::string_klass() | 2275 if (as_klassOop() == SystemDictionary::String_klass() |
2276 && java_lang_String::value(obj) != NULL) { | 2276 && java_lang_String::value(obj) != NULL) { |
2277 ResourceMark rm; | 2277 ResourceMark rm; |
2278 int len = java_lang_String::length(obj); | 2278 int len = java_lang_String::length(obj); |
2279 int plen = (len < 24 ? len : 12); | 2279 int plen = (len < 24 ? len : 12); |
2280 char* str = java_lang_String::as_utf8_string(obj, 0, plen); | 2280 char* str = java_lang_String::as_utf8_string(obj, 0, plen); |
2281 st->print(" = \"%s\"", str); | 2281 st->print(" = \"%s\"", str); |
2282 if (len > plen) | 2282 if (len > plen) |
2283 st->print("...[%d]", len); | 2283 st->print("...[%d]", len); |
2284 } else if (as_klassOop() == SystemDictionary::class_klass()) { | 2284 } else if (as_klassOop() == SystemDictionary::Class_klass()) { |
2285 klassOop k = java_lang_Class::as_klassOop(obj); | 2285 klassOop k = java_lang_Class::as_klassOop(obj); |
2286 st->print(" = "); | 2286 st->print(" = "); |
2287 if (k != NULL) { | 2287 if (k != NULL) { |
2288 k->print_value_on(st); | 2288 k->print_value_on(st); |
2289 } else { | 2289 } else { |
2346 // Verify that java.lang.Class instances have a fake oop field added. | 2346 // Verify that java.lang.Class instances have a fake oop field added. |
2347 instanceKlass* ik = instanceKlass::cast(k); | 2347 instanceKlass* ik = instanceKlass::cast(k); |
2348 | 2348 |
2349 // Check that we have the right class | 2349 // Check that we have the right class |
2350 static bool first_time = true; | 2350 static bool first_time = true; |
2351 guarantee(k == SystemDictionary::class_klass() && first_time, "Invalid verify of maps"); | 2351 guarantee(k == SystemDictionary::Class_klass() && first_time, "Invalid verify of maps"); |
2352 first_time = false; | 2352 first_time = false; |
2353 const int extra = java_lang_Class::number_of_fake_oop_fields; | 2353 const int extra = java_lang_Class::number_of_fake_oop_fields; |
2354 guarantee(ik->nonstatic_field_size() == extra, "just checking"); | 2354 guarantee(ik->nonstatic_field_size() == extra, "just checking"); |
2355 guarantee(ik->nonstatic_oop_map_count() == 1, "just checking"); | 2355 guarantee(ik->nonstatic_oop_map_count() == 1, "just checking"); |
2356 guarantee(ik->size_helper() == align_object_size(instanceOopDesc::header_size() + extra), "just checking"); | 2356 guarantee(ik->size_helper() == align_object_size(instanceOopDesc::header_size() + extra), "just checking"); |