--- old/make/Makefile 2015-01-08 11:49:02.381330720 +0100 +++ new/make/Makefile 2015-01-08 11:49:02.315330501 +0100 @@ -560,7 +560,7 @@ # Unix $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo): $(SHARK_BUILD_DIR)/%.debuginfo +$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(SHARK_BUILD_DIR)/%.debuginfo $(install-file) $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(SHARK_BUILD_DIR)/%.diz $(install-file) --- old/src/share/vm/ci/ciTypeFlow.cpp 2015-01-08 11:49:03.389334041 +0100 +++ new/src/share/vm/ci/ciTypeFlow.cpp 2015-01-08 11:49:03.327333837 +0100 @@ -35,8 +35,10 @@ #include "interpreter/bytecode.hpp" #include "interpreter/bytecodes.hpp" #include "memory/allocation.inline.hpp" +#ifdef COMPILER2 #include "opto/compile.hpp" #include "opto/node.hpp" +#endif // COMPILER2 #include "runtime/deoptimization.hpp" #include "utilities/growableArray.hpp" @@ -2647,7 +2649,7 @@ // forward arc in graph assert (!blk->has_pre_order(), ""); blk->set_next_pre_order(); - +#ifdef COMPILER2 if (_next_pre_order >= (int)Compile::current()->max_node_limit() / 2) { // Too many basic blocks. Bail out. // This can happen when try/finally constructs are nested to depth N, @@ -2657,6 +2659,7 @@ record_failure("too many basic blocks"); return; } +#endif if (do_flow) { flow_block(blk, temp_vector, temp_set); if (failing()) return; // Watch for bailouts. --- old/src/share/vm/classfile/systemDictionary.cpp 2015-01-08 11:49:03.648334895 +0100 +++ new/src/share/vm/classfile/systemDictionary.cpp 2015-01-08 11:49:03.584334684 +0100 @@ -2272,6 +2272,7 @@ spe = NULL; // Must create lots of stuff here, but outside of the SystemDictionary lock. m = Method::make_method_handle_intrinsic(iid, signature, CHECK_(empty)); +#ifndef SHARK if (!Arguments::is_interpreter_only()) { // Generate a compiled form of the MH intrinsic. AdapterHandlerLibrary::create_native_wrapper(m); @@ -2281,6 +2282,7 @@ "out of space in CodeCache for method handle intrinsic", empty); } } +#endif // SHARK // Now grab the lock. We might have to throw away the new method, // if a racing thread has managed to install one at the same time. { @@ -2294,9 +2296,11 @@ } assert(spe != NULL && spe->method() != NULL, ""); +#ifndef SHARK assert(Arguments::is_interpreter_only() || (spe->method()->has_compiled_code() && spe->method()->code()->entry_point() == spe->method()->from_compiled_entry()), "MH intrinsic invariant"); +#endif // SHARK return spe->method(); } --- old/src/share/vm/memory/allocation.cpp 2015-01-08 11:49:03.906335745 +0100 +++ new/src/share/vm/memory/allocation.cpp 2015-01-08 11:49:03.843335538 +0100 @@ -664,6 +664,7 @@ // Non-product code #ifndef PRODUCT +#ifndef SHARK // The global operator new should never be called since it will usually indicate // a memory leak. Use CHeapObj as the base class of such objects to make it explicit // that they're allocated on the C heap. @@ -722,6 +723,8 @@ fatal("Should not call global delete []"); } +#endif // SHARK + void AllocatedObj::print() const { print_on(tty); } void AllocatedObj::print_value() const { print_value_on(tty); } --- old/src/share/vm/runtime/handles.hpp 2015-01-08 11:49:04.140336516 +0100 +++ new/src/share/vm/runtime/handles.hpp 2015-01-08 11:49:04.075336302 +0100 @@ -149,7 +149,7 @@ name##Handle (type* obj); \ name##Handle (Thread* thread, type* obj); \ \ - name##Handle (const name##Handle &h); \ + name##Handle (const name##Handle &h, bool check_in_stack = true); \ name##Handle& operator=(const name##Handle &s); \ \ /* Destructor */ \ --- old/src/share/vm/runtime/handles.inline.hpp 2015-01-08 11:49:04.368337267 +0100 +++ new/src/share/vm/runtime/handles.inline.hpp 2015-01-08 11:49:04.305337060 +0100 @@ -69,7 +69,7 @@ _thread->metadata_handles()->push((Metadata*)obj); \ } \ } \ -inline name##Handle::name##Handle(const name##Handle &h) { \ +inline name##Handle::name##Handle(const name##Handle &h, bool check_in_stack) { \ _value = h._value; \ if (_value != NULL) { \ assert(_value->is_valid(), "obj is valid"); \ @@ -79,7 +79,7 @@ } else { \ _thread = Thread::current(); \ } \ - assert (_thread->is_in_stack((address)this), "not on stack?"); \ + assert (! check_in_stack || _thread->is_in_stack((address)this), "not on stack?"); \ _thread->metadata_handles()->push((Metadata*)_value); \ } else { \ _thread = NULL; \ --- old/src/share/vm/shark/sharkCompiler.cpp 2015-01-08 11:49:04.597338022 +0100 +++ new/src/share/vm/shark/sharkCompiler.cpp 2015-01-08 11:49:04.531337804 +0100 @@ -61,7 +61,15 @@ : AbstractCompiler(shark) { // Create the lock to protect the memory manager and execution engine _execution_engine_lock = new Monitor(Mutex::leaf, "SharkExecutionEngineLock"); - MutexLocker locker(execution_engine_lock()); + { + MutexLocker locker(execution_engine_lock()); + init_llvm(); + } + // All done + set_state(initialized); +} + +void SharkCompiler::init_llvm() { // Make LLVM safe for multithreading if (!llvm_start_multithreaded()) @@ -134,9 +142,6 @@ } execution_engine()->addModule(_native_context->module()); - - // All done - set_state(initialized); } void SharkCompiler::initialize() { @@ -165,7 +170,7 @@ } // Create the recorders - Arena arena; + Arena arena(mtCompiler); env->set_oop_recorder(new OopRecorder(&arena)); OopMapSet oopmaps; env->set_debug_info(new DebugInformationRecorder(env->oop_recorder())); --- old/src/share/vm/shark/sharkCompiler.hpp 2015-01-08 11:49:04.833338799 +0100 +++ new/src/share/vm/shark/sharkCompiler.hpp 2015-01-08 11:49:04.764338572 +0100 @@ -40,6 +40,8 @@ // Creation SharkCompiler(); + void init_llvm(); + // Name of this compiler const char *name() { return "shark"; } --- old/src/share/vm/shark/sharkNativeWrapper.hpp 2015-01-08 11:49:05.063339557 +0100 +++ new/src/share/vm/shark/sharkNativeWrapper.hpp 2015-01-08 11:49:04.994339330 +0100 @@ -56,7 +56,7 @@ BasicType* arg_types, BasicType return_type) : SharkCompileInvariants(NULL, builder), - _target(target), + _target(target, false), _arg_types(arg_types), _return_type(return_type), _lock_slot_offset(0) { initialize(name); } --- old/src/share/vm/shark/sharkRuntime.cpp 2015-01-08 11:49:05.283340282 +0100 +++ new/src/share/vm/shark/sharkRuntime.cpp 2015-01-08 11:49:05.221340078 +0100 @@ -40,7 +40,7 @@ int* indexes, int num_indexes)) constantPoolHandle pool(thread, method(thread)->constants()); - KlassHandle exc_klass(thread, ((oop) tos_at(thread, 0))->klass()); + KlassHandle exc_klass(thread, (oop((void*) tos_at(thread, 0)))->klass()); for (int i = 0; i < num_indexes; i++) { Klass* tmp = pool->klass_at(indexes[i], CHECK_0); @@ -185,7 +185,7 @@ // Nothing in these must ever GC! void SharkRuntime::dump(const char *name, intptr_t value) { - oop valueOop = (oop) value; + oop valueOop = oop((void*) value); tty->print("%s = ", name); if (valueOop->is_oop(true)) valueOop->print_on(tty);