changeset 1458:dc114f680d9c

Merge.
author Doug Simon <doug.simon@oracle.com>
date Sat, 13 Nov 2010 08:15:52 +0100
parents 572d4c6d6ce6 (current diff) 7cf1952ec5fb (diff)
children 1ffaf7819f91
files c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java src/share/vm/c1x/c1x_CodeInstaller.cpp src/share/vm/c1x/c1x_TargetMethod.hpp
diffstat 18 files changed, 137 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotTest/src/JavaTester.java	Sat Nov 13 07:54:30 2010 +0100
+++ b/c1x4hotspotsrc/HotSpotTest/src/JavaTester.java	Sat Nov 13 08:15:52 2010 +0100
@@ -1809,7 +1809,7 @@
 			jtt_jdk_Class_getName();
 			break;
 		case 581:
-			//jtt_jdk_EnumMap01();
+			jtt_jdk_EnumMap01();
 			break;
 		case 582:
 			jtt_jdk_EnumMap02();
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java	Sat Nov 13 07:54:30 2010 +0100
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java	Sat Nov 13 08:15:52 2010 +0100
@@ -160,7 +160,6 @@
         C1XOptions.NullCheckUniquePc = true;
         C1XOptions.invokeinterfaceTemplatePos = true;
         C1XOptions.StackShadowPages = config.stackShadowPages;
-
     }
 
     public CiCompiler getCompiler() {
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotConstantPool.java	Sat Nov 13 07:54:30 2010 +0100
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotConstantPool.java	Sat Nov 13 08:15:52 2010 +0100
@@ -64,7 +64,7 @@
 
     @Override
     public RiField lookupField(int cpi, int opcode) {
-        return Compiler.getVMEntries().RiConstantPool_lookupField(vmId, cpi);
+        return Compiler.getVMEntries().RiConstantPool_lookupField(vmId, cpi, (byte) opcode);
     }
 
 }
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotXirGenerator.java	Sat Nov 13 07:54:30 2010 +0100
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotXirGenerator.java	Sat Nov 13 08:15:52 2010 +0100
@@ -307,11 +307,11 @@
                 asm.mark(MARK_IMPLICIT_NULL);
                 asm.pload(CiKind.Word, asm.createTemp("temp", CiKind.Word), object, true);
             }
-/*
+
             useRegisters(asm, AMD64.rbx, AMD64.rsi, AMD64.rdx);
             useRegisters(asm, AMD64.rax);
             asm.callRuntime(config.monitorEnterStub, null, object, lock);
-*/
+
             return asm.finishTemplate("monitorEnter");
         }
     };
@@ -323,11 +323,11 @@
             asm.restart(CiKind.Void);
             XirParameter object = asm.createInputParameter("object", CiKind.Object);
             XirParameter lock = asm.createInputParameter("lock", CiKind.Word);
-/*
+
             useRegisters(asm, AMD64.rbx, AMD64.rsi, AMD64.rdx);
             useRegisters(asm, AMD64.rax);
             asm.callRuntime(config.monitorExitStub, null, object, lock);
-*/
+
             return asm.finishTemplate("monitorExit");
         }
     };
@@ -813,7 +813,7 @@
 
     @Override
     public XirSnippet genResolveClass(XirSite site, RiType type, Representation rep) {
-        assert rep == Representation.ObjectHub || rep == Representation.StaticFields : "unexpected representation: " + rep;
+        assert rep == Representation.ObjectHub || rep == Representation.StaticFields || rep == Representation.JavaClass : "unexpected representation: " + rep;
         if (type instanceof HotSpotTypeResolved) {
             return new XirSnippet(resolveClassTemplates.get(site), XirArgument.forObject(type));
         }
@@ -995,6 +995,8 @@
             asm.mark(MARK_DUMMY_OOP_RELOCATION);
             asm.jmp(patchStub);
 
+            // TODO(tw): Need a safepoint here?
+
             // TODO: make this more generic & safe - this is needed to create space for patching
             asm.nop(5);
 
@@ -1059,8 +1061,8 @@
             asm.mark(MARK_DUMMY_OOP_RELOCATION);
             if (nullCheck) {
                 asm.mark(MARK_IMPLICIT_NULL);
-                asm.safepoint();
             }
+            asm.safepoint();
             asm.jmp(patchStub);
 
             // TODO: make this more generic & safe - this is needed to create space for patching
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntries.java	Sat Nov 13 07:54:30 2010 +0100
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntries.java	Sat Nov 13 08:15:52 2010 +0100
@@ -55,7 +55,7 @@
 
     RiType RiConstantPool_lookupType(long vmId, int cpi);
 
-    RiField RiConstantPool_lookupField(long vmId, int cpi);
+    RiField RiConstantPool_lookupField(long vmId, int cpi, byte byteCode);
 
     RiConstantPool RiType_constantPool(long vmId);
 
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntriesNative.java	Sat Nov 13 07:54:30 2010 +0100
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntriesNative.java	Sat Nov 13 08:15:52 2010 +0100
@@ -66,7 +66,7 @@
     public native RiType RiConstantPool_lookupType(long vmId, int cpi);
 
     @Override
-    public native RiField RiConstantPool_lookupField(long vmId, int cpi);
+    public native RiField RiConstantPool_lookupField(long vmId, int cpi, byte byteCode);
 
     @Override
     public native RiConstantPool RiType_constantPool(long vmId);
--- a/runscimark.sh	Sat Nov 13 07:54:30 2010 +0100
+++ b/runscimark.sh	Sat Nov 13 08:15:52 2010 +0100
@@ -11,8 +11,12 @@
   echo "C1X is not defined. It must point to a c1x4hotspot directory."
   exit 1;
 fi
-for (( i = 1; i <= 4000; i++ ))      ### Outer for loop ###
+if [ -z "${SCIMARK}" ]; then
+  echo "SCIMARK is not defined. It must point to a SciMark benchmark directory."
+  exit 1;
+fi
+for (( i = 1; i <= 5000; i++ ))      ### Outer for loop ###
 do
   echo "$i "
-  ${JRE7}/bin/java -client -esa -ea -XX:+UseC1X -Xms32m -Xmx100m -Xbootclasspath/p:${MAXINE}/C1X/bin:${MAXINE}/CRI/bin:${MAXINE}/Base/bin:${MAXINE}/Assembler/bin:${C1X}/c1x4hotspotsrc/HotSpotVM/bin -Xbootclasspath/a:/home/tw/Benchmarks/scimark/ -classpath "${SCIMARK}" -C1X:+PrintTimers  jnt.scimark2.commandline -large
+  ${JRE7}/bin/java -client -esa -ea -XX:+UseC1X -Xms32m -Xmx100m -Xbootclasspath/p:${MAXINE}/C1X/bin:${MAXINE}/CRI/bin:${MAXINE}/Base/bin:${MAXINE}/Assembler/bin:${C1X}/c1x4hotspotsrc/HotSpotVM/bin -Xbootclasspath/a:${SCIMARK} -C1X:+PrintTimers  jnt.scimark2.commandline -large
 done
--- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Sat Nov 13 07:54:30 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Sat Nov 13 08:15:52 2010 +0100
@@ -268,7 +268,7 @@
           if (thread->thread_state() == _thread_in_Java) {
             // Throw a stack overflow exception.  Guard pages will be reenabled
             // while unwinding the stack.
-            tty->print("implicit: %08x%08x\n", ((long)pc) >> 32, pc);
+            if (WizardMode) tty->print("implicit: %08x%08x\n", ((long)pc) >> 32, pc);
             stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW);
           } else {
             // Thread was in the vm or native code.  Return and try to finish.
--- a/src/share/vm/c1/c1_globals.hpp	Sat Nov 13 07:54:30 2010 +0100
+++ b/src/share/vm/c1/c1_globals.hpp	Sat Nov 13 08:15:52 2010 +0100
@@ -35,6 +35,8 @@
                                                                             \
   product(bool, UseC1X, false,                                              \
           "Use C1X instead of C1")                                          \
+  product(bool, BootstrapC1X, false,                                        \
+          "Bootstrap C1X before running Java main method")                  \
   product(intx, TraceC1X, 0,                                                \
           "Trace level for C1X")                                            \
   /* Printing */                                                            \
--- a/src/share/vm/c1x/c1x_CodeInstaller.cpp	Sat Nov 13 07:54:30 2010 +0100
+++ b/src/share/vm/c1x/c1x_CodeInstaller.cpp	Sat Nov 13 08:15:52 2010 +0100
@@ -66,7 +66,7 @@
   }
 
   if (frame_size > 0) {
-    assert(frame_map->length() == ((frame_size / HeapWordSize) + 7) / 8, "unexpected register_map length");
+    assert(frame_map->length() == ((frame_size / HeapWordSize) + 7) / 8, "unexpected frame_map length");
 
     for (jint i = 0; i < frame_size / HeapWordSize; i++) {
       unsigned char byte = ((unsigned char*) frame_map->base(T_BYTE))[i / 8];
@@ -327,7 +327,6 @@
     reexecute = Interpreter::bytecode_should_reexecute(code);
   }
 
-
   if (frame != NULL) {
     jint local_count = CiDebugInfo_Frame::numLocals(frame);
     jint expression_count = CiDebugInfo_Frame::numStack(frame);
@@ -350,8 +349,9 @@
       } else {
         assert(value->is_location(), "invalid monitor location");
         LocationValue* loc = (LocationValue*)value;
-        LocationValue* obj = new LocationValue(Location::new_stk_loc(Location::oop, loc->location().stack_offset() + HeapWordSize));
-        monitors->append(new MonitorValue(obj, Location::new_stk_loc(Location::normal, loc->location().stack_offset())));
+        int monitor_offset = loc->location().stack_offset();
+        LocationValue* obj = new LocationValue(Location::new_stk_loc(Location::oop, monitor_offset + BasicObjectLock::obj_offset_in_bytes()));
+        monitors->append(new MonitorValue(obj, Location::new_stk_loc(Location::normal, monitor_offset  + BasicObjectLock::lock_offset_in_bytes())));
       }
     }
     DebugToken* locals_token = _debug_recorder->create_scope_values(locals);
@@ -385,8 +385,6 @@
   oop global_stub = CiTargetMethod_Call::globalStubID(site);
 
   oop debug_info = CiTargetMethod_Call::debugInfo(site);
-  arrayOop stack_map = (arrayOop) CiTargetMethod_Call::stackMap(site);
-  arrayOop register_map = (arrayOop) CiTargetMethod_Call::registerMap(site);
 
   assert((runtime_call ? 1 : 0) + (hotspot_method ? 1 : 0) + (symbol ? 1 : 0) + (global_stub ? 1 : 0) == 1, "Call site needs exactly one type");
 
--- a/src/share/vm/c1x/c1x_Compiler.cpp	Sat Nov 13 07:54:30 2010 +0100
+++ b/src/share/vm/c1x/c1x_Compiler.cpp	Sat Nov 13 08:15:52 2010 +0100
@@ -45,7 +45,10 @@
   assert(klass != NULL, "c1x VMEntries class not found");
   env->RegisterNatives(klass, VMEntries_methods, VMEntries_methods_count());
 
-  check_pending_exception("Could not register natives");
+  {
+    VM_ENTRY_MARK;
+    check_pending_exception("Could not register natives");
+  }
 
   c1x_compute_offsets();
 
@@ -83,7 +86,7 @@
   TRACE_C1X_1("C1XCompiler::print_timers");
 }
 
-oop C1XCompiler::get_RiType(ciType *type, klassOop accessor, TRAPS) {
+oop C1XCompiler::get_RiType(ciType *type, KlassHandle accessor, TRAPS) {
   if (type->is_loaded()) {
     if (type->is_primitive_type()) {
       return VMExits::createRiTypePrimitive((int) type->basic_type(), THREAD);
@@ -93,15 +96,23 @@
     return createHotSpotTypeResolved(klass, name, CHECK_NULL);
   } else {
     symbolOop name = ((ciKlass *) type)->name()->get_symbolOop();
-    return VMExits::createRiTypeUnresolved(VmIds::toString<Handle>(name, THREAD), VmIds::add<klassOop>(accessor), THREAD);
+    return VMExits::createRiTypeUnresolved(VmIds::toString<Handle>(name, THREAD), VmIds::add<klassOop>(accessor()), THREAD);
   }
 }
 
-oop C1XCompiler::get_RiField(ciField *field, klassOop accessor, TRAPS) {
+oop C1XCompiler::get_RiField(ciField *field, KlassHandle accessor, Bytecodes::Code byteCode, TRAPS) {
   Handle field_holder = get_RiType(field->holder(), accessor, CHECK_0);
   Handle field_type = get_RiType(field->type(), accessor, CHECK_0);
   Handle field_name = VmIds::toString<Handle>(field->name()->get_symbolOop(), CHECK_0);
-  int offset = field->holder()->is_loaded() ? field->offset() : -1;
+
+  ciInstanceKlass* accessor_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(accessor());
+  bool will_link;
+  {
+    ThreadToNativeFromVM trans((JavaThread*)THREAD);
+    will_link = field->will_link(accessor_klass, byteCode);
+  }
+
+  int offset = (field->holder()->is_loaded() && will_link) ? field->offset() : -1;
 
   // TODO: implement caching
   return VMExits::createRiField(field_holder, field_name, field_type, offset, THREAD);
--- a/src/share/vm/c1x/c1x_Compiler.hpp	Sat Nov 13 07:54:30 2010 +0100
+++ b/src/share/vm/c1x/c1x_Compiler.hpp	Sat Nov 13 08:15:52 2010 +0100
@@ -56,8 +56,8 @@
   // Print compilation timers and statistics
   virtual void print_timers();
 
-  static oop get_RiType(ciType *klass, klassOop accessor, TRAPS);
-  static oop get_RiField(ciField *ciField, klassOop accessor, TRAPS);
+  static oop get_RiType(ciType *klass, KlassHandle accessor, TRAPS);
+  static oop get_RiField(ciField *ciField, KlassHandle accessor, Bytecodes::Code byteCode, TRAPS);
 
   static oop createHotSpotTypeResolved(KlassHandle klass, Handle name, TRAPS);
 
--- a/src/share/vm/c1x/c1x_TargetMethod.hpp	Sat Nov 13 07:54:30 2010 +0100
+++ b/src/share/vm/c1x/c1x_TargetMethod.hpp	Sat Nov 13 08:15:52 2010 +0100
@@ -89,8 +89,6 @@
     oop_field(CiTargetMethod_Call, symbol, "Ljava/lang/String;")                        \
     oop_field(CiTargetMethod_Call, globalStubID, "Ljava/lang/Object;")                  \
     oop_field(CiTargetMethod_Call, debugInfo, "Lcom/sun/cri/ci/CiDebugInfo;")           \
-    oop_field(CiTargetMethod_Call, stackMap, "[B")                                      \
-    oop_field(CiTargetMethod_Call, registerMap, "[B")                                   \
   end_class                                                                             \
   start_class(CiTargetMethod_DataPatch)                                                 \
     oop_field(CiTargetMethod_DataPatch, constant, "Lcom/sun/cri/ci/CiConstant;")        \
--- a/src/share/vm/c1x/c1x_VMEntries.cpp	Sat Nov 13 07:54:30 2010 +0100
+++ b/src/share/vm/c1x/c1x_VMEntries.cpp	Sat Nov 13 08:15:52 2010 +0100
@@ -248,14 +248,15 @@
 }
 
 // public RiField RiConstantPool_lookupField(long vmId, int cpi);
-JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupField(JNIEnv *env, jobject, jlong vmId, jint index) {
+JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupField(JNIEnv *env, jobject, jlong vmId, jint index, jbyte byteCode) {
   VM_ENTRY_MARK;
 
   constantPoolOop cp = VmIds::get<constantPoolOop>(vmId);
 
   ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder());
   ciField *field = CURRENT_ENV->get_field_by_index(loading_klass, index);
-  return JNIHandles::make_local(THREAD, C1XCompiler::get_RiField(field, cp->pool_holder(), THREAD));
+  Bytecodes::Code code = (Bytecodes::Code)(((int) byteCode) & 0xFF);
+  return JNIHandles::make_local(THREAD, C1XCompiler::get_RiField(field, cp->pool_holder(), code, THREAD));
 }
 
 // public RiConstantPool RiType_constantPool(long vmId);
@@ -319,7 +320,7 @@
   BasicType type = C1XCompiler::kindToBasicType(CiKind::typeChar(kind));
   assert(type != T_OBJECT, "primitive type expecteds");
   ciKlass* klass = ciTypeArrayKlass::make(type);
-  return JNIHandles::make_local(THREAD, C1XCompiler::get_RiType(klass, NULL, THREAD));
+  return JNIHandles::make_local(THREAD, C1XCompiler::get_RiType(klass, KlassHandle(NULL, THREAD), THREAD));
 }
 
 // public RiType getType(Class<?> javaClass);
@@ -494,7 +495,7 @@
   {CC"RiConstantPool_lookupMethod",     CC"("PROXY"IB)"METHOD,              FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupMethod)},
   {CC"RiConstantPool_lookupSignature",  CC"("PROXY"I)"SIGNATURE,            FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupSignature)},
   {CC"RiConstantPool_lookupType",       CC"("PROXY"I)"TYPE,                 FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupType)},
-  {CC"RiConstantPool_lookupField",      CC"("PROXY"I)"FIELD,                FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupField)},
+  {CC"RiConstantPool_lookupField",      CC"("PROXY"IB)"FIELD,               FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupField)},
   {CC"RiType_constantPool",             CC"("PROXY")"CONSTANT_POOL,         FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1constantPool)},
   {CC"RiType_resolveMethodImpl",        CC"("PROXY STRING STRING")"METHOD,  FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_3resolveMethodImpl)},
   {CC"RiType_isSubtypeOf",              CC"("PROXY TYPE")Z",                FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_2isSubtypeOf)},
--- a/src/share/vm/compiler/compileBroker.cpp	Sat Nov 13 07:54:30 2010 +0100
+++ b/src/share/vm/compiler/compileBroker.cpp	Sat Nov 13 08:15:52 2010 +0100
@@ -320,7 +320,10 @@
   if (is_osr) tty->print(" @ %d", osr_bci());
 
   // print method size
-  tty->print_cr(" (%d bytes)", method->code_size());
+  tty->print(" (%d bytes)", method->code_size());
+
+  // invocation count
+  tty->print_cr(" %d invocations", _hot_count);
 }
 
 
@@ -477,6 +480,9 @@
     _last = NULL;
   }
 
+  // (tw) Immediately set compiling flag.
+  JavaThread::current()->as_CompilerThread()->set_compiling(true);
+
   return task;
 
 }
@@ -532,6 +538,69 @@
   }
 }
 
+// Bootstrap the C1X compiler. Compiles all methods until compile queue is empty and no compilation is active.
+void CompileBroker::bootstrap_c1x() {
+  Thread* THREAD = Thread::current();
+  tty->print_cr("Bootstrapping C1X...");
+
+  C1XCompiler* compiler = C1XCompiler::instance();
+  if (compiler == NULL) fatal("must use flag -XX:+UseC1X");
+
+  jlong start = os::javaTimeMillis();
+  {
+    HandleMark hm;
+    instanceKlass* klass = (instanceKlass*)SystemDictionary::Object_klass()->klass_part();
+    methodOop method = klass->find_method(vmSymbols::object_initializer_name(), vmSymbols::void_method_signature());
+    CompileBroker::compile_method(method, -1, method, 0, "initial compile of object initializer", THREAD);
+    if (HAS_PENDING_EXCEPTION) {
+      CLEAR_PENDING_EXCEPTION;
+      fatal("error inserting object initializer into compile queue");
+    }
+  }
+  int z = 0;
+  while (true) {
+    {
+      HandleMark hm;
+      ResourceMark rm;
+      MutexLocker locker(_method_queue->lock(), Thread::current());
+      if (_method_queue->is_empty()) {
+        MutexLocker mu(Threads_lock); // grab Threads_lock
+        JavaThread* current = Threads::first();
+        bool compiling = false;
+        while (current != NULL) {
+          if (current->is_Compiler_thread()) {
+            CompilerThread* comp_thread = current->as_CompilerThread();
+            if (comp_thread->is_compiling()) {
+              if (TraceC1X >= 4) {
+                tty->print_cr("Compile queue empty, but following thread is still compiling:");
+                comp_thread->print();
+              }
+              compiling = true;
+            }
+          }
+          current = current->next();
+        }
+        if (!compiling) {
+          break;
+        }
+      }
+      if (TraceC1X >= 4) {
+        _method_queue->print();
+      }
+    }
+
+    {
+      ThreadToNativeFromVM trans(JavaThread::current());
+      usleep(1000);
+    }
+    ++z;
+  }
+  jlong diff = os::javaTimeMillis() - start;
+  tty->print_cr("Finished bootstrap in %d ms", diff);
+  if (CITime) CompileBroker::print_times();
+  tty->print_cr("===========================================================================");
+}
+
 
 // ------------------------------------------------------------------
 // CompileBroker::compilation_init
@@ -863,14 +932,14 @@
   // Acquire our lock.
   {
     MutexLocker locker(_method_queue->lock(), THREAD);
-/*
-	if (Thread::current()->is_Compiler_thread() && CompilerThread::current()->is_compiling()) {
-    
-		TRACE_C1X_1("Recursive compile %s!", method->name_and_sig_as_C_string());
-    //method->set_not_compilable();
-		return;
-	}
-*/
+
+    if (Thread::current()->is_Compiler_thread() && CompilerThread::current()->is_compiling() && !BackgroundCompilation) {
+
+      TRACE_C1X_1("Recursive compile %s!", method->name_and_sig_as_C_string());
+      method->set_not_compilable();
+      return;
+    }
+
     // Make sure the method has not slipped into the queues since
     // last we checked; note that those checks were "fast bail-outs".
     // Here we need to be more careful, see 14012000 below.
@@ -1352,6 +1421,9 @@
 
   while (true) {
     {
+      // Unset compiling flag.
+      thread->set_compiling(false);
+
       // We need this HandleMark to avoid leaking VM handles.
       HandleMark hm(thread);
 
--- a/src/share/vm/compiler/compileBroker.hpp	Sat Nov 13 07:54:30 2010 +0100
+++ b/src/share/vm/compiler/compileBroker.hpp	Sat Nov 13 08:15:52 2010 +0100
@@ -358,4 +358,6 @@
   static void print_last_compile();
 
   static void print_compiler_threads_on(outputStream* st);
+
+  static void bootstrap_c1x();
 };
--- a/src/share/vm/prims/jni.cpp	Sat Nov 13 07:54:30 2010 +0100
+++ b/src/share/vm/prims/jni.cpp	Sat Nov 13 08:15:52 2010 +0100
@@ -3295,6 +3295,11 @@
     }
     // Check if we should compile all classes on bootclasspath
     NOT_PRODUCT(if (CompileTheWorld) ClassLoader::compile_the_world();)
+
+    if (BootstrapC1X) {
+      CompileBroker::bootstrap_c1x();
+    }
+
     // 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 {
--- a/src/share/vm/runtime/thread.cpp	Sat Nov 13 07:54:30 2010 +0100
+++ b/src/share/vm/runtime/thread.cpp	Sat Nov 13 08:15:52 2010 +0100
@@ -2799,6 +2799,7 @@
   _task  = NULL;
   _queue = queue;
   _counters = counters;
+  _is_compiling = false;
 
 #ifndef PRODUCT
   _ideal_graph_printer = NULL;