< prev index next >

src/hotspot/share/jvmci/jvmciRuntime.cpp

Print this page




  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;


 467   if (obj == NULL) {
 468     tty->print("NULL");
 469   } else if (oopDesc::is_oop_or_null(obj, true) && (!as_string || !java_lang_String::is_instance(obj))) {
 470     if (oopDesc::is_oop_or_null(obj, true)) {
 471       char buf[O_BUFLEN];
 472       tty->print("%s@" INTPTR_FORMAT, obj->klass()->name()->as_C_string(buf, O_BUFLEN), p2i(obj));
 473     } else {
 474       tty->print(INTPTR_FORMAT, p2i(obj));
 475     }
 476   } else {
 477     ResourceMark rm;
 478     assert(obj != NULL && java_lang_String::is_instance(obj), "must be");
 479     char *buf = java_lang_String::as_utf8_string(obj);
 480     tty->print_raw(buf);
 481   }
 482   if (newline) {
 483     tty->cr();
 484   }
 485 JRT_END
 486 


 487 JRT_LEAF(void, JVMCIRuntime::write_barrier_pre(JavaThread* thread, oopDesc* obj))
 488 #if INCLUDE_ALL_GCS
 489   G1ThreadLocalData::satb_mark_queue(thread).enqueue(obj);
 490 #endif // INCLUDE_ALL_GCS
 491 JRT_END
 492 
 493 JRT_LEAF(void, JVMCIRuntime::write_barrier_post(JavaThread* thread, void* card_addr))
 494 #if INCLUDE_ALL_GCS
 495   G1ThreadLocalData::dirty_card_queue(thread).enqueue(card_addr);
 496 #endif // INCLUDE_ALL_GCS
 497 JRT_END


 498 
 499 JRT_LEAF(jboolean, JVMCIRuntime::validate_object(JavaThread* thread, oopDesc* parent, oopDesc* child))
 500   bool ret = true;
 501   if(!Universe::heap()->is_in_closed_subset(parent)) {
 502     tty->print_cr("Parent Object " INTPTR_FORMAT " not in heap", p2i(parent));
 503     parent->print();
 504     ret=false;
 505   }
 506   if(!Universe::heap()->is_in_closed_subset(child)) {
 507     tty->print_cr("Child Object " INTPTR_FORMAT " not in heap", p2i(child));
 508     child->print();
 509     ret=false;
 510   }
 511   return (jint)ret;
 512 JRT_END
 513 
 514 JRT_ENTRY(void, JVMCIRuntime::vm_error(JavaThread* thread, jlong where, jlong format, jlong value))
 515   ResourceMark rm;
 516   const char *error_msg = where == 0L ? "<internal JVMCI error>" : (char*) (address) where;
 517   char *detail_msg = NULL;




  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_G1GC
  54 #include "gc/g1/g1ThreadLocalData.hpp"
  55 #endif // INCLUDE_G1GC
  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;


 467   if (obj == NULL) {
 468     tty->print("NULL");
 469   } else if (oopDesc::is_oop_or_null(obj, true) && (!as_string || !java_lang_String::is_instance(obj))) {
 470     if (oopDesc::is_oop_or_null(obj, true)) {
 471       char buf[O_BUFLEN];
 472       tty->print("%s@" INTPTR_FORMAT, obj->klass()->name()->as_C_string(buf, O_BUFLEN), p2i(obj));
 473     } else {
 474       tty->print(INTPTR_FORMAT, p2i(obj));
 475     }
 476   } else {
 477     ResourceMark rm;
 478     assert(obj != NULL && java_lang_String::is_instance(obj), "must be");
 479     char *buf = java_lang_String::as_utf8_string(obj);
 480     tty->print_raw(buf);
 481   }
 482   if (newline) {
 483     tty->cr();
 484   }
 485 JRT_END
 486 
 487 #if INCLUDE_G1GC
 488 
 489 JRT_LEAF(void, JVMCIRuntime::write_barrier_pre(JavaThread* thread, oopDesc* obj))

 490   G1ThreadLocalData::satb_mark_queue(thread).enqueue(obj);

 491 JRT_END
 492 
 493 JRT_LEAF(void, JVMCIRuntime::write_barrier_post(JavaThread* thread, void* card_addr))

 494   G1ThreadLocalData::dirty_card_queue(thread).enqueue(card_addr);

 495 JRT_END
 496 
 497 #endif // INCLUDE_G1GC
 498 
 499 JRT_LEAF(jboolean, JVMCIRuntime::validate_object(JavaThread* thread, oopDesc* parent, oopDesc* child))
 500   bool ret = true;
 501   if(!Universe::heap()->is_in_closed_subset(parent)) {
 502     tty->print_cr("Parent Object " INTPTR_FORMAT " not in heap", p2i(parent));
 503     parent->print();
 504     ret=false;
 505   }
 506   if(!Universe::heap()->is_in_closed_subset(child)) {
 507     tty->print_cr("Child Object " INTPTR_FORMAT " not in heap", p2i(child));
 508     child->print();
 509     ret=false;
 510   }
 511   return (jint)ret;
 512 JRT_END
 513 
 514 JRT_ENTRY(void, JVMCIRuntime::vm_error(JavaThread* thread, jlong where, jlong format, jlong value))
 515   ResourceMark rm;
 516   const char *error_msg = where == 0L ? "<internal JVMCI error>" : (char*) (address) where;
 517   char *detail_msg = NULL;


< prev index next >