hotspot/src/share/vm/jvmci/jvmciRuntime.cpp
changeset 35232 76aed99c0ddd
parent 35216 71c463a17b3b
parent 35160 acae4975b367
child 35499 b79827ea1b9f
--- a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp	Mon Jan 04 13:57:34 2016 -0800
+++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp	Thu Jan 07 21:10:28 2016 +0000
@@ -51,15 +51,10 @@
 bool JVMCIRuntime::_HotSpotJVMCIRuntime_initialized = false;
 bool JVMCIRuntime::_well_known_classes_initialized = false;
 const char* JVMCIRuntime::_compiler = NULL;
-int JVMCIRuntime::_options_count = 0;
-SystemProperty** JVMCIRuntime::_options = NULL;
 int JVMCIRuntime::_trivial_prefixes_count = 0;
 char** JVMCIRuntime::_trivial_prefixes = NULL;
 bool JVMCIRuntime::_shutdown_called = false;
 
-static const char* OPTION_PREFIX = "jvmci.option.";
-static const size_t OPTION_PREFIX_LEN = strlen(OPTION_PREFIX);
-
 BasicType JVMCIRuntime::kindToBasicType(Handle kind, TRAPS) {
   if (kind.is_null()) {
     THROW_(vmSymbols::java_lang_NullPointerException(), T_ILLEGAL);
@@ -636,16 +631,6 @@
   return Handle((oop)result.get_jobject());
 }
 
-static bool jvmci_options_file_exists() {
-  const char* home = Arguments::get_java_home();
-  size_t path_len = strlen(home) + strlen("/lib/jvmci.options") + 1;
-  char path[JVM_MAXPATHLEN];
-  char sep = os::file_separator()[0];
-  jio_snprintf(path, JVM_MAXPATHLEN, "%s%clib%cjvmci.options", home, sep, sep);
-  struct stat st;
-  return os::stat(path, &st) == 0;
-}
-
 void JVMCIRuntime::initialize_HotSpotJVMCIRuntime(TRAPS) {
   if (JNIHandles::resolve(_HotSpotJVMCIRuntime_instance) == NULL) {
 #ifdef ASSERT
@@ -657,30 +642,6 @@
            "HotSpotJVMCIRuntime initialization should only be triggered through JVMCI initialization");
 #endif
 
-    bool parseOptionsFile = jvmci_options_file_exists();
-    if (_options != NULL || parseOptionsFile) {
-      JavaCallArguments args;
-      objArrayOop options;
-      if (_options != NULL) {
-        options = oopFactory::new_objArray(SystemDictionary::String_klass(), _options_count * 2, CHECK);
-        for (int i = 0; i < _options_count; i++) {
-          SystemProperty* prop = _options[i];
-          oop name = java_lang_String::create_oop_from_str(prop->key() + OPTION_PREFIX_LEN, CHECK);
-          const char* prop_value = prop->value() != NULL ? prop->value() : "";
-          oop value = java_lang_String::create_oop_from_str(prop_value, CHECK);
-          options->obj_at_put(i * 2, name);
-          options->obj_at_put((i * 2) + 1, value);
-        }
-      } else {
-        options = NULL;
-      }
-      args.push_oop(options);
-      args.push_int(parseOptionsFile);
-      callStatic("jdk/vm/ci/options/OptionsParser",
-                 "parseOptionsFromVM",
-                 "([Ljava/lang/String;Z)Ljava/lang/Boolean;", &args, CHECK);
-    }
-
     if (_compiler != NULL) {
       JavaCallArguments args;
       oop compiler = java_lang_String::create_oop_from_str(_compiler, CHECK);
@@ -818,10 +779,6 @@
 
   {
     ThreadToNativeFromVM trans(thread);
-
-    // Ensure _non_oop_bits is initialized
-    Universe::non_oop_word();
-
     env->RegisterNatives(c2vmClass, CompilerToVM::methods, CompilerToVM::methods_count());
   }
 JVM_END
@@ -902,58 +859,15 @@
   _compiler = compiler;
 }
 
-void JVMCIRuntime::maybe_print_flags(TRAPS) {
-  if (_options != NULL) {
-    for (int i = 0; i < _options_count; i++) {
-      SystemProperty* p = _options[i];
-      const char* name = p->key() + OPTION_PREFIX_LEN;
-      if (strcmp(name, "PrintFlags") == 0 || strcmp(name, "ShowFlags") == 0) {
-        JVMCIRuntime::initialize_well_known_classes(CHECK);
-        HandleMark hm;
-        ResourceMark rm;
-        JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK);
-        return;
-      }
-    }
-  }
-}
-
-void JVMCIRuntime::save_options(SystemProperty* props) {
-  int count = 0;
-  SystemProperty* first = NULL;
-  for (SystemProperty* p = props; p != NULL; p = p->next()) {
-    if (strncmp(p->key(), OPTION_PREFIX, OPTION_PREFIX_LEN) == 0) {
-      if (first == NULL) {
-        first = p;
-      }
-      count++;
-    }
-  }
-  if (count != 0) {
-    _options_count = count;
-    _options = NEW_C_HEAP_ARRAY(SystemProperty*, count, mtCompiler);
-    _options[0] = first;
-    SystemProperty** insert_pos = _options + 1;
-    for (SystemProperty* p = first->next(); p != NULL; p = p->next()) {
-      if (strncmp(p->key(), OPTION_PREFIX, OPTION_PREFIX_LEN) == 0) {
-        *insert_pos = p;
-        insert_pos++;
-      }
-    }
-    assert (insert_pos - _options == count, "must be");
-  }
-}
-
-void JVMCIRuntime::shutdown() {
+void JVMCIRuntime::shutdown(TRAPS) {
   if (_HotSpotJVMCIRuntime_instance != NULL) {
     _shutdown_called = true;
-    JavaThread* THREAD = JavaThread::current();
     HandleMark hm(THREAD);
-    Handle receiver = get_HotSpotJVMCIRuntime(CHECK_ABORT);
+    Handle receiver = get_HotSpotJVMCIRuntime(CHECK);
     JavaValue result(T_VOID);
     JavaCallArguments args;
     args.push_oop(receiver);
-    JavaCalls::call_special(&result, receiver->klass(), vmSymbols::shutdown_method_name(), vmSymbols::void_method_signature(), &args, CHECK_ABORT);
+    JavaCalls::call_special(&result, receiver->klass(), vmSymbols::shutdown_method_name(), vmSymbols::void_method_signature(), &args, CHECK);
   }
 }
 
@@ -971,32 +885,6 @@
   return false;
 }
 
-void JVMCIRuntime::call_printStackTrace(Handle exception, Thread* thread) {
-  assert(exception->is_a(SystemDictionary::Throwable_klass()), "Throwable instance expected");
-  JavaValue result(T_VOID);
-  JavaCalls::call_virtual(&result,
-                          exception,
-                          KlassHandle(thread,
-                          SystemDictionary::Throwable_klass()),
-                          vmSymbols::printStackTrace_name(),
-                          vmSymbols::void_method_signature(),
-                          thread);
-}
-
-void JVMCIRuntime::abort_on_pending_exception(Handle exception, const char* message, bool dump_core) {
-  Thread* THREAD = Thread::current();
-  CLEAR_PENDING_EXCEPTION;
-  tty->print_raw_cr(message);
-  call_printStackTrace(exception, THREAD);
-
-  // Give other aborting threads to also print their stack traces.
-  // This can be very useful when debugging class initialization
-  // failures.
-  os::sleep(THREAD, 200, false);
-
-  vm_abort(dump_core);
-}
-
 void JVMCIRuntime::parse_lines(char* path, ParseClosure* closure, bool warnStatFailure) {
   struct stat st;
   if (::stat(path, &st) == 0 && (st.st_mode & S_IFREG) == S_IFREG) { // exists & is regular file