# HG changeset patch # User Thomas Wuerthinger # Date 1273674581 -7200 # Node ID b30a2cd5e3a2e1d9dc7493f6389a1414d218b6df # Parent 09e7826ecf01d3528220f7604c4a225d520a5eca Added methods to c1x_VMExits.cpp Some memos: - the result is not stored in a jobject, but in an oop! => (oop)get_as_jobject() - we get problems with locks hold by the user program when disabling background compilation => currently this makes an assert, we need a better solution diff -r 09e7826ecf01 -r b30a2cd5e3a2 make/windows/makefiles/makedeps.make --- a/make/windows/makefiles/makedeps.make Tue May 11 19:24:14 2010 +0200 +++ b/make/windows/makefiles/makedeps.make Wed May 12 16:29:41 2010 +0200 @@ -57,6 +57,7 @@ # This is only used internally MakeDepsIncludesPRIVATE=\ -relativeInclude src\share\vm\c1 \ + -relativeInclude src\share\vm\c1x \ -relativeInclude src\share\vm\compiler \ -relativeInclude src\share\vm\code \ -relativeInclude src\share\vm\interpreter \ diff -r 09e7826ecf01 -r b30a2cd5e3a2 make/windows/makefiles/vm.make --- a/make/windows/makefiles/vm.make Tue May 11 19:24:14 2010 +0200 +++ b/make/windows/makefiles/vm.make Wed May 12 16:29:41 2010 +0200 @@ -114,6 +114,7 @@ /I "..\generated" \ /I "..\generated\jvmtifiles" \ /I "$(WorkSpace)\src\share\vm\c1" \ + /I "$(WorkSpace)\src\share\vm\c1x" \ /I "$(WorkSpace)\src\share\vm\compiler" \ /I "$(WorkSpace)\src\share\vm\code" \ /I "$(WorkSpace)\src\share\vm\interpreter" \ @@ -144,6 +145,7 @@ VM_PATH=../generated/incls VM_PATH=$(VM_PATH);../generated/jvmtifiles VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/c1 +VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/c1x VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/compiler VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/code VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/interpreter diff -r 09e7826ecf01 -r b30a2cd5e3a2 src/share/vm/c1x/c1x_Compiler.cpp --- a/src/share/vm/c1x/c1x_Compiler.cpp Tue May 11 19:24:14 2010 +0200 +++ b/src/share/vm/c1x/c1x_Compiler.cpp Wed May 12 16:29:41 2010 +0200 @@ -1,27 +1,27 @@ -/* - * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - */ - +/* + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + # include "incls/_precompiled.incl" # include "incls/_c1x_Compiler.cpp.incl" @@ -39,30 +39,19 @@ ResourceMark rm; HandleMark hm; - TRACE_C1X_1("compile_method"); - - methodHandle method(Thread::current(), (methodOop)target->get_oop()); - TRACE_C1X_1("name = %s", method->name_and_sig_as_C_string()); - - JavaValue result(T_VOID); - symbolHandle syKlass = oopFactory::new_symbol("com/sun/hotspot/c1x/VMExits", CHECK); - - - Handle nullh; - KlassHandle k = SystemDictionary::resolve_or_null(syKlass, nullh, nullh, CHECK); - if (k.is_null()) { - tty->print_cr("not found"); - return;//fatal("Could not find class com.sun.hotspot.c1x.VMExits"); - } - symbolHandle syName = oopFactory::new_symbol("compileMethod", CHECK); - symbolHandle sySig = oopFactory::new_symbol("(Lcom/sun/cri/ri/RiMethod;I)V", CHECK); - JavaCallArguments args; - args.push_oop(method()); - args.push_int(entry_bci); - JavaCalls::call_static(&result, k, syName, sySig, &args, CHECK); + CompilerThread::current()->set_compiling(true); + oop rimethod = get_rimethod(target); + VMExits::compileMethod(rimethod, entry_bci); + CompilerThread::current()->set_compiling(false); } // Print compilation timers and statistics void C1XCompiler::print_timers() { TRACE_C1X_1("print_timers"); +} + +oop C1XCompiler::get_rimethod(ciMethod *method) { + methodOop m = (methodOop)method->get_oop(); + // TODO: implement caching + return VMExits::createRiMethod(m); } \ No newline at end of file diff -r 09e7826ecf01 -r b30a2cd5e3a2 src/share/vm/c1x/c1x_Compiler.hpp --- a/src/share/vm/c1x/c1x_Compiler.hpp Tue May 11 19:24:14 2010 +0200 +++ b/src/share/vm/c1x/c1x_Compiler.hpp Wed May 12 16:29:41 2010 +0200 @@ -1,27 +1,27 @@ -/* - * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - */ - +/* + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + class C1XCompiler : public AbstractCompiler { public: @@ -43,12 +43,14 @@ virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci); // Print compilation timers and statistics - virtual void print_timers(); -}; - - -// Tracing macros - + virtual void print_timers(); + + static oop get_rimethod(ciMethod *ciMethod); +}; + + +// Tracing macros + #define IF_TRACE_C1X_1 if (TraceC1X >= 1) #define IF_TRACE_C1X_2 if (TraceC1X >= 2) #define IF_TRACE_C1X_3 if (TraceC1X >= 3) diff -r 09e7826ecf01 -r b30a2cd5e3a2 src/share/vm/c1x/c1x_VMEntries.cpp --- a/src/share/vm/c1x/c1x_VMEntries.cpp Tue May 11 19:24:14 2010 +0200 +++ b/src/share/vm/c1x/c1x_VMEntries.cpp Wed May 12 16:29:41 2010 +0200 @@ -1,27 +1,27 @@ -/* - * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - */ - +/* + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + # include "incls/_precompiled.incl" # include "incls/_c1x_VMEntries.cpp.incl" \ No newline at end of file diff -r 09e7826ecf01 -r b30a2cd5e3a2 src/share/vm/c1x/c1x_VMExists.cpp --- a/src/share/vm/c1x/c1x_VMExists.cpp Tue May 11 19:24:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* - * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - */ - diff -r 09e7826ecf01 -r b30a2cd5e3a2 src/share/vm/c1x/c1x_VMExists.hpp --- a/src/share/vm/c1x/c1x_VMExists.hpp Tue May 11 19:24:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* - * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - */ - diff -r 09e7826ecf01 -r b30a2cd5e3a2 src/share/vm/c1x/c1x_VMExits.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/vm/c1x/c1x_VMExits.cpp Wed May 12 16:29:41 2010 +0200 @@ -0,0 +1,84 @@ +/* + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +# include "incls/_precompiled.incl" +# include "incls/_c1x_VMExits.cpp.incl" + +KlassHandle VMExits::_vmExitsKlass; + +KlassHandle &VMExits::vmExitsKlass() { + + if (_vmExitsKlass.is_null()) { + Handle nullh; + _vmExitsKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_c1x_VMExits(), nullh, nullh, Thread::current()); + if (_vmExitsKlass.is_null()) { + fatal("Could not find class com.sun.hotspot.c1x.VMExits"); + } + } + return _vmExitsKlass; +} + +void VMExits::compileMethod(oop method, int entry_bci) { + JavaValue result(T_VOID); + JavaCallArguments args; + args.push_oop(method); + args.push_int(entry_bci); + JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::compileMethod_name(), vmSymbols::compileMethod_signature(), &args, Thread::current()); +} + +oop VMExits::createRiMethod(methodOop m) { + JavaValue result(T_OBJECT); + JavaCallArguments args; + args.push_oop(m); + JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::createRiMethod_name(), vmSymbols::createRiMethod_signature(), &args, Thread::current()); + if(Thread::current()->pending_exception() != NULL) { + tty->print_cr("exc pending"); + } + return (oop)result.get_jobject(); +} + +oop VMExits::createRiField(klassOop k, int index) { + JavaValue result(T_OBJECT); + JavaCallArguments args; + args.push_oop(k); + args.push_int(index); + JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::createRiField_name(), vmSymbols::createRiField_signature(), &args, Thread::current()); + return (oop)result.get_jobject(); +} + +oop VMExits::createRiType(klassOop k) { + JavaValue result(T_OBJECT); + JavaCallArguments args; + args.push_oop(k); + JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::createRiType_name(), vmSymbols::createRiType_signature(), &args, Thread::current()); + return (oop)result.get_jobject(); +} + +oop VMExits::createRiConstantPool(constantPoolOop cp) { + JavaValue result(T_OBJECT); + JavaCallArguments args; + args.push_oop(cp); + JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::createRiConstantPool_name(), vmSymbols::createRiConstantPool_signature(), &args, Thread::current()); + return (oop)result.get_jobject(); +} \ No newline at end of file diff -r 09e7826ecf01 -r b30a2cd5e3a2 src/share/vm/c1x/c1x_VMExits.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/vm/c1x/c1x_VMExits.hpp Wed May 12 16:29:41 2010 +0200 @@ -0,0 +1,39 @@ +/* + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +class VMExits : public AllStatic { + +private: + + static KlassHandle _vmExitsKlass; + +public: + + static KlassHandle& vmExitsKlass(); + static void compileMethod(oop method, int entry_bci); + static oop createRiMethod(methodOop m); + static oop createRiField(klassOop k, int index); + static oop createRiType(klassOop k); + static oop createRiConstantPool(constantPoolOop cp); +}; \ No newline at end of file diff -r 09e7826ecf01 -r b30a2cd5e3a2 src/share/vm/classfile/systemDictionary.cpp --- a/src/share/vm/classfile/systemDictionary.cpp Tue May 11 19:24:14 2010 +0200 +++ b/src/share/vm/classfile/systemDictionary.cpp Wed May 12 16:29:41 2010 +0200 @@ -2358,8 +2358,9 @@ SymbolPropertyEntry* spe = invoke_method_table()->find_entry(index, hash, signature); if (spe == NULL || spe->property_oop() == NULL) { // Must create lots of stuff here, but outside of the SystemDictionary lock. - if (THREAD->is_Compiler_thread()) - return NULL; // do not attempt from within compiler + // (tw) May we do this? + //if (THREAD->is_Compiler_thread()) + // return NULL; // do not attempt from within compiler Handle mt = compute_method_handle_type(signature(), class_loader, protection_domain, CHECK_NULL); diff -r 09e7826ecf01 -r b30a2cd5e3a2 src/share/vm/classfile/vmSymbols.hpp --- a/src/share/vm/classfile/vmSymbols.hpp Tue May 11 19:24:14 2010 +0200 +++ b/src/share/vm/classfile/vmSymbols.hpp Wed May 12 16:29:41 2010 +0200 @@ -244,6 +244,23 @@ NOT_LP64( do_alias(machine_word_signature, int_signature) ) \ LP64_ONLY( do_alias(machine_word_signature, long_signature) ) \ \ + /* support for C1X */ \ + template(com_sun_hotspot_c1x_VMExits, "com/sun/hotspot/c1x/VMExits") \ + template(com_sun_cri_ri_RiMethod, "com/sun/cri/ri/RiMethod") \ + template(com_sun_cri_ri_RiField, "com/sun/cri/ri/RiField") \ + template(com_sun_cri_ri_RiType, "com/sun/cri/ri/RiType") \ + template(com_sun_cri_ri_RiConstantPool, "com/sun/cri/ri/RiConstantPool") \ + template(compileMethod_name, "compileMethod") \ + template(compileMethod_signature, "(Lcom/sun/cri/ri/RiMethod;I)V") \ + template(createRiMethod_name, "createRiMethod") \ + template(createRiMethod_signature, "(Ljava/lang/Object;)Lcom/sun/cri/ri/RiMethod;") \ + template(createRiField_name, "createRiField") \ + template(createRiField_signature, "(Ljava/lang/Object;I)Lcom/sun/cri/ri/RiField;") \ + template(createRiType_name, "createRiType") \ + template(createRiType_signature, "(Ljava/lang/Object;)Lcom/sun/cri/ri/RiType;") \ + template(createRiConstantPool_name, "createRiConstantPool") \ + template(createRiConstantPool_signature, "(Ljava/lang/Object;I)Lcom/sun/cri/ri/RiConstantPool;") \ + \ /* common method and field names */ \ template(object_initializer_name, "") \ template(class_initializer_name, "") \ diff -r 09e7826ecf01 -r b30a2cd5e3a2 src/share/vm/compiler/compileBroker.cpp --- a/src/share/vm/compiler/compileBroker.cpp Tue May 11 19:24:14 2010 +0200 +++ b/src/share/vm/compiler/compileBroker.cpp Wed May 12 16:29:41 2010 +0200 @@ -864,6 +864,11 @@ { MutexLocker locker(_method_queue->lock(), THREAD); + if (Thread::current()->is_Compiler_thread() && CompilerThread::current()->is_compiling()) { + TRACE_C1X_1("Recursive compile!"); + 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. diff -r 09e7826ecf01 -r b30a2cd5e3a2 src/share/vm/includeDB_compiler1 --- a/src/share/vm/includeDB_compiler1 Tue May 11 19:24:14 2010 +0200 +++ b/src/share/vm/includeDB_compiler1 Wed May 12 16:29:41 2010 +0200 @@ -449,10 +449,13 @@ c1x_Compiler.hpp abstractCompiler.hpp c1x_Compiler.cpp c1x_Compiler.hpp -c1x_Compiler.cpp c1x_VMExists.hpp +c1x_Compiler.cpp c1x_VMExits.hpp c1x_VMEntries.cpp c1x_VMEntries.hpp -c1x_VMEntries.cpp c1x_VMExists.hpp +c1x_VMEntries.cpp c1x_VMExits.hpp + +c1x_VMExits.hpp systemDictionary.hpp -c1x_VMExists.hpp systemDictionary.hpp -c1x_VMExists.hpp javaCalls.hpp +c1x_VMExits.cpp javaCalls.hpp +c1x_VMExits.cpp c1x_VMExits.hpp + diff -r 09e7826ecf01 -r b30a2cd5e3a2 src/share/vm/runtime/synchronizer.cpp --- a/src/share/vm/runtime/synchronizer.cpp Tue May 11 19:24:14 2010 +0200 +++ b/src/share/vm/runtime/synchronizer.cpp Wed May 12 16:29:41 2010 +0200 @@ -2923,6 +2923,10 @@ } ++ nWakeups ; + if (THREAD->is_Compiler_thread() && nWakeups >= 5) { + assert(false, "Compiler thread blocked by lock"); + } + // Assuming this is not a spurious wakeup we'll normally find _succ == Self. // We can defer clearing _succ until after the spin completes // TrySpin() must tolerate being called with _succ == Self. diff -r 09e7826ecf01 -r b30a2cd5e3a2 src/share/vm/runtime/thread.cpp --- a/src/share/vm/runtime/thread.cpp Tue May 11 19:24:14 2010 +0200 +++ b/src/share/vm/runtime/thread.cpp Wed May 12 16:29:41 2010 +0200 @@ -1853,7 +1853,9 @@ // Do not throw asynchronous exceptions against the compiler thread // (the compiler thread should not be a Java thread -- fix in 1.4.2) - if (is_Compiler_thread()) return; + + // (tw) May we do this? + //if (is_Compiler_thread()) return; // This is a change from JDK 1.1, but JDK 1.2 will also do it: if (java_throwable->is_a(SystemDictionary::ThreadDeath_klass())) { @@ -3741,7 +3743,9 @@ { MutexLockerEx ml(doLock ? Threads_lock : NULL); ALL_JAVA_THREADS(p) { - if (p->is_Compiler_thread()) continue; + + // (tw) May we do this? + //if (p->is_Compiler_thread()) continue; address pending = (address)p->current_pending_monitor(); if (pending == monitor) { // found a match diff -r 09e7826ecf01 -r b30a2cd5e3a2 src/share/vm/runtime/thread.hpp --- a/src/share/vm/runtime/thread.hpp Tue May 11 19:24:14 2010 +0200 +++ b/src/share/vm/runtime/thread.hpp Wed May 12 16:29:41 2010 +0200 @@ -1576,6 +1576,7 @@ CompileLog* _log; CompileTask* _task; CompileQueue* _queue; + bool _is_compiling; public: @@ -1583,6 +1584,8 @@ CompilerThread(CompileQueue* queue, CompilerCounters* counters); + bool is_compiling() const { return _is_compiling; } + void set_compiling(bool b) { _is_compiling = b; } bool is_Compiler_thread() const { return true; } // Hide this compiler thread from external view. bool is_hidden_from_external_view() const { return true; } diff -r 09e7826ecf01 -r b30a2cd5e3a2 src/share/vm/utilities/exceptions.cpp --- a/src/share/vm/utilities/exceptions.cpp Tue May 11 19:24:14 2010 +0200 +++ b/src/share/vm/utilities/exceptions.cpp Wed May 12 16:29:41 2010 +0200 @@ -62,7 +62,8 @@ } if (thread->is_VM_thread() - || thread->is_Compiler_thread() ) { + // (tw) May we do this? + /*|| thread->is_Compiler_thread()*/ ) { // We do not care what kind of exception we get for the vm-thread or a thread which // is compiling. We just install a dummy exception object thread->set_pending_exception(Universe::vm_exception(), file, line); @@ -85,7 +86,8 @@ } if (thread->is_VM_thread() - || thread->is_Compiler_thread() ) { + // (tw) May we do this? + /* || thread->is_Compiler_thread()*/ ) { // We do not care what kind of exception we get for the vm-thread or a thread which // is compiling. We just install a dummy exception object thread->set_pending_exception(Universe::vm_exception(), file, line);