changeset 1481:fe69dec9a1ed

Added support for CompileTheWorld.
author Thomas Wuerthinger <wuerthinger@ssw.jku.at>
date Mon, 29 Nov 2010 12:01:45 +0100
parents 2fe369533fed
children 2bae90a3deb9
files c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java src/share/vm/c1x/c1x_VMEntries.cpp src/share/vm/c1x/c1x_VMExits.cpp src/share/vm/prims/jni.cpp
diffstat 4 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java	Sat Nov 27 16:43:53 2010 +0100
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java	Mon Nov 29 12:01:45 2010 +0100
@@ -20,7 +20,6 @@
  */
 package com.sun.hotspot.c1x;
 
-import java.lang.management.*;
 import java.lang.reflect.Proxy;
 import java.net.*;
 
--- a/src/share/vm/c1x/c1x_VMEntries.cpp	Sat Nov 27 16:43:53 2010 +0100
+++ b/src/share/vm/c1x/c1x_VMEntries.cpp	Mon Nov 29 12:01:45 2010 +0100
@@ -148,6 +148,10 @@
         protectionDomain = VmIds::get<klassOop>(accessingClassVmId)->klass_part()->protection_domain();
       }
       resolved_type = SystemDictionary::resolve_or_null(nameSymbol, classloader, protectionDomain, THREAD);
+      if (HAS_PENDING_EXCEPTION) {
+        CLEAR_PENDING_EXCEPTION;
+        resolved_type = NULL;
+      }
     }
     if (resolved_type != NULL) {
       result = C1XCompiler::createHotSpotTypeResolved(resolved_type, name, CHECK_NULL);
--- a/src/share/vm/c1x/c1x_VMExits.cpp	Sat Nov 27 16:43:53 2010 +0100
+++ b/src/share/vm/c1x/c1x_VMExits.cpp	Mon Nov 29 12:01:45 2010 +0100
@@ -43,6 +43,9 @@
 Handle VMExits::instance() {
   if (JNIHandles::resolve(_vmExitsPermObject) == NULL) {
     KlassHandle compiler_klass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_c1x_Compiler(), SystemDictionary::java_system_loader(), NULL, Thread::current());
+    if (compiler_klass.is_null()) {
+      fatal("Could not find class com.sun.hotspot.c1x.Compiler");
+    }
     JavaValue result(T_OBJECT);
     JavaCallArguments args;
     JavaCalls::call_static(&result, compiler_klass(), vmSymbols::getVMExits_name(), vmSymbols::getVMExits_signature(), &args, Thread::current());
--- a/src/share/vm/prims/jni.cpp	Sat Nov 27 16:43:53 2010 +0100
+++ b/src/share/vm/prims/jni.cpp	Mon Nov 29 12:01:45 2010 +0100
@@ -3293,13 +3293,14 @@
     if (JvmtiExport::should_post_thread_life()) {
        JvmtiExport::post_thread_start(thread);
     }
-    // Check if we should compile all classes on bootclasspath
-    NOT_PRODUCT(if (CompileTheWorld) ClassLoader::compile_the_world();)
 
     if (BootstrapC1X) {
       CompileBroker::bootstrap_c1x();
     }
 
+    // Check if we should compile all classes on bootclasspath
+    NOT_PRODUCT(if (CompileTheWorld) ClassLoader::compile_the_world();)
+
     // Since this is not a JVM_ENTRY we have to set the thread state manually before leaving.
     ThreadStateTransition::transition_and_fence(thread, _thread_in_vm, _thread_in_native);
   } else {