33 #include "jvmci/jvmciCompilerToVM.hpp" 34 #include "jvmci/jvmciCompiler.hpp" 35 #include "jvmci/jvmciJavaClasses.hpp" 36 #include "jvmci/jvmciEnv.hpp" 37 #include "logging/log.hpp" 38 #include "memory/allocation.inline.hpp" 39 #include "memory/oopFactory.hpp" 40 #include "memory/resourceArea.hpp" 41 #include "oops/oop.inline.hpp" 42 #include "oops/objArrayOop.inline.hpp" 43 #include "runtime/biasedLocking.hpp" 44 #include "runtime/frame.inline.hpp" 45 #include "runtime/interfaceSupport.inline.hpp" 46 #include "runtime/jniHandles.inline.hpp" 47 #include "runtime/reflection.hpp" 48 #include "runtime/sharedRuntime.hpp" 49 #include "runtime/threadSMR.hpp" 50 #include "utilities/debug.hpp" 51 #include "utilities/defaultStream.hpp" 52 #include "utilities/macros.hpp" 53 54 #if defined(_MSC_VER) 55 #define strtoll _strtoi64 56 #endif 57 58 jobject JVMCIRuntime::_HotSpotJVMCIRuntime_instance = NULL; 59 bool JVMCIRuntime::_HotSpotJVMCIRuntime_initialized = false; 60 bool JVMCIRuntime::_well_known_classes_initialized = false; 61 int JVMCIRuntime::_trivial_prefixes_count = 0; 62 char** JVMCIRuntime::_trivial_prefixes = NULL; 63 JVMCIRuntime::CompLevelAdjustment JVMCIRuntime::_comp_level_adjustment = JVMCIRuntime::none; 64 bool JVMCIRuntime::_shutdown_called = false; 65 66 BasicType JVMCIRuntime::kindToBasicType(Handle kind, TRAPS) { 67 if (kind.is_null()) { 68 THROW_(vmSymbols::java_lang_NullPointerException(), T_ILLEGAL); 69 } 70 jchar ch = JavaKind::typeChar(kind); 71 switch(ch) { 72 case 'Z': return T_BOOLEAN; 437 tty->print("NULL"); 438 } else if (oopDesc::is_oop_or_null(obj, true) && (!as_string || !java_lang_String::is_instance(obj))) { 439 if (oopDesc::is_oop_or_null(obj, true)) { 440 char buf[O_BUFLEN]; 441 tty->print("%s@" INTPTR_FORMAT, obj->klass()->name()->as_C_string(buf, O_BUFLEN), p2i(obj)); 442 } else { 443 tty->print(INTPTR_FORMAT, p2i(obj)); 444 } 445 } else { 446 ResourceMark rm; 447 assert(obj != NULL && java_lang_String::is_instance(obj), "must be"); 448 char *buf = java_lang_String::as_utf8_string(obj); 449 tty->print_raw(buf); 450 } 451 if (newline) { 452 tty->cr(); 453 } 454 JRT_END 455 456 JRT_LEAF(void, JVMCIRuntime::write_barrier_pre(JavaThread* thread, oopDesc* obj)) 457 thread->satb_mark_queue().enqueue(obj); 458 JRT_END 459 460 JRT_LEAF(void, JVMCIRuntime::write_barrier_post(JavaThread* thread, void* card_addr)) 461 thread->dirty_card_queue().enqueue(card_addr); 462 JRT_END 463 464 JRT_LEAF(jboolean, JVMCIRuntime::validate_object(JavaThread* thread, oopDesc* parent, oopDesc* child)) 465 bool ret = true; 466 if(!Universe::heap()->is_in_closed_subset(parent)) { 467 tty->print_cr("Parent Object " INTPTR_FORMAT " not in heap", p2i(parent)); 468 parent->print(); 469 ret=false; 470 } 471 if(!Universe::heap()->is_in_closed_subset(child)) { 472 tty->print_cr("Child Object " INTPTR_FORMAT " not in heap", p2i(child)); 473 child->print(); 474 ret=false; 475 } 476 return (jint)ret; 477 JRT_END 478 479 JRT_ENTRY(void, JVMCIRuntime::vm_error(JavaThread* thread, jlong where, jlong format, jlong value)) 480 ResourceMark rm; 481 const char *error_msg = where == 0L ? "<internal JVMCI error>" : (char*) (address) where; | 33 #include "jvmci/jvmciCompilerToVM.hpp" 34 #include "jvmci/jvmciCompiler.hpp" 35 #include "jvmci/jvmciJavaClasses.hpp" 36 #include "jvmci/jvmciEnv.hpp" 37 #include "logging/log.hpp" 38 #include "memory/allocation.inline.hpp" 39 #include "memory/oopFactory.hpp" 40 #include "memory/resourceArea.hpp" 41 #include "oops/oop.inline.hpp" 42 #include "oops/objArrayOop.inline.hpp" 43 #include "runtime/biasedLocking.hpp" 44 #include "runtime/frame.inline.hpp" 45 #include "runtime/interfaceSupport.inline.hpp" 46 #include "runtime/jniHandles.inline.hpp" 47 #include "runtime/reflection.hpp" 48 #include "runtime/sharedRuntime.hpp" 49 #include "runtime/threadSMR.hpp" 50 #include "utilities/debug.hpp" 51 #include "utilities/defaultStream.hpp" 52 #include "utilities/macros.hpp" 53 #if INCLUDE_ALL_GCS 54 #include "gc/g1/g1ThreadLocalData.hpp" 55 #endif // INCLUDE_ALL_GCS 56 57 #if defined(_MSC_VER) 58 #define strtoll _strtoi64 59 #endif 60 61 jobject JVMCIRuntime::_HotSpotJVMCIRuntime_instance = NULL; 62 bool JVMCIRuntime::_HotSpotJVMCIRuntime_initialized = false; 63 bool JVMCIRuntime::_well_known_classes_initialized = false; 64 int JVMCIRuntime::_trivial_prefixes_count = 0; 65 char** JVMCIRuntime::_trivial_prefixes = NULL; 66 JVMCIRuntime::CompLevelAdjustment JVMCIRuntime::_comp_level_adjustment = JVMCIRuntime::none; 67 bool JVMCIRuntime::_shutdown_called = false; 68 69 BasicType JVMCIRuntime::kindToBasicType(Handle kind, TRAPS) { 70 if (kind.is_null()) { 71 THROW_(vmSymbols::java_lang_NullPointerException(), T_ILLEGAL); 72 } 73 jchar ch = JavaKind::typeChar(kind); 74 switch(ch) { 75 case 'Z': return T_BOOLEAN; 440 tty->print("NULL"); 441 } else if (oopDesc::is_oop_or_null(obj, true) && (!as_string || !java_lang_String::is_instance(obj))) { 442 if (oopDesc::is_oop_or_null(obj, true)) { 443 char buf[O_BUFLEN]; 444 tty->print("%s@" INTPTR_FORMAT, obj->klass()->name()->as_C_string(buf, O_BUFLEN), p2i(obj)); 445 } else { 446 tty->print(INTPTR_FORMAT, p2i(obj)); 447 } 448 } else { 449 ResourceMark rm; 450 assert(obj != NULL && java_lang_String::is_instance(obj), "must be"); 451 char *buf = java_lang_String::as_utf8_string(obj); 452 tty->print_raw(buf); 453 } 454 if (newline) { 455 tty->cr(); 456 } 457 JRT_END 458 459 JRT_LEAF(void, JVMCIRuntime::write_barrier_pre(JavaThread* thread, oopDesc* obj)) 460 #if INCLUDE_ALL_GCS 461 G1ThreadLocalData::satb_mark_queue(thread).enqueue(obj); 462 #endif // INCLUDE_ALL_GCS 463 JRT_END 464 465 JRT_LEAF(void, JVMCIRuntime::write_barrier_post(JavaThread* thread, void* card_addr)) 466 #if INCLUDE_ALL_GCS 467 G1ThreadLocalData::dirty_card_queue(thread).enqueue(card_addr); 468 #endif // INCLUDE_ALL_GCS 469 JRT_END 470 471 JRT_LEAF(jboolean, JVMCIRuntime::validate_object(JavaThread* thread, oopDesc* parent, oopDesc* child)) 472 bool ret = true; 473 if(!Universe::heap()->is_in_closed_subset(parent)) { 474 tty->print_cr("Parent Object " INTPTR_FORMAT " not in heap", p2i(parent)); 475 parent->print(); 476 ret=false; 477 } 478 if(!Universe::heap()->is_in_closed_subset(child)) { 479 tty->print_cr("Child Object " INTPTR_FORMAT " not in heap", p2i(child)); 480 child->print(); 481 ret=false; 482 } 483 return (jint)ret; 484 JRT_END 485 486 JRT_ENTRY(void, JVMCIRuntime::vm_error(JavaThread* thread, jlong where, jlong format, jlong value)) 487 ResourceMark rm; 488 const char *error_msg = where == 0L ? "<internal JVMCI error>" : (char*) (address) where; |