# HG changeset patch # User Christian Haeubl # Date 1328897779 28800 # Node ID ef00461e29af9768412be281f5c0b67d7862bab0 # Parent 35ca3ade314d5e0b62b78b28697c81cd3adeaac5# Parent e43d36482d127f3e2d155c914c051d76c1510ea1 Merge diff -r 35ca3ade314d -r ef00461e29af graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiUtil.java --- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiUtil.java Fri Feb 10 10:07:48 2012 -0800 +++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiUtil.java Fri Feb 10 10:16:19 2012 -0800 @@ -577,6 +577,8 @@ } else { sb.append(CiUtil.format("%H.%n(%p)", method)); } + } else { + sb.append("Null method"); } return sb.append(" [bci: ").append(bci).append(']'); } diff -r 35ca3ade314d -r ef00461e29af graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/bridge/VMToCompilerImpl.java --- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/bridge/VMToCompilerImpl.java Fri Feb 10 10:07:48 2012 -0800 +++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/bridge/VMToCompilerImpl.java Fri Feb 10 10:16:19 2012 -0800 @@ -108,15 +108,26 @@ public void startCompiler() throws Throwable { // Make sure TTY is initialized here such that the correct System.out is used for TTY. TTY.initialize(); + if (GraalOptions.Debug) { + Debug.enable(); + HotSpotDebugConfig hotspotDebugConfig = new HotSpotDebugConfig(GraalOptions.Log, GraalOptions.Meter, GraalOptions.Time, GraalOptions.Dump, GraalOptions.MethodFilter); + Debug.setConfig(hotspotDebugConfig); + } // Install intrinsics. - HotSpotRuntime runtime = (HotSpotRuntime) compiler.getCompiler().runtime; + final HotSpotRuntime runtime = (HotSpotRuntime) compiler.getCompiler().runtime; if (GraalOptions.Intrinsify) { - this.intrinsifyArrayCopy = new IntrinsifyArrayCopyPhase(runtime); - GraalIntrinsics.installIntrinsics(runtime, runtime.getCompiler().getTarget(), PhasePlan.DEFAULT); - Snippets.install(runtime, runtime.getCompiler().getTarget(), new SystemSnippets(), PhasePlan.DEFAULT); - Snippets.install(runtime, runtime.getCompiler().getTarget(), new UnsafeSnippets(), PhasePlan.DEFAULT); - Snippets.install(runtime, runtime.getCompiler().getTarget(), new ArrayCopySnippets(), PhasePlan.DEFAULT); + Debug.scope("InstallSnippets", new DebugDumpScope("InstallSnippets"), new Runnable() { + @Override + public void run() { + VMToCompilerImpl.this.intrinsifyArrayCopy = new IntrinsifyArrayCopyPhase(runtime); + GraalIntrinsics.installIntrinsics(runtime, runtime.getCompiler().getTarget(), PhasePlan.DEFAULT); + Snippets.install(runtime, runtime.getCompiler().getTarget(), new SystemSnippets(), PhasePlan.DEFAULT); + Snippets.install(runtime, runtime.getCompiler().getTarget(), new UnsafeSnippets(), PhasePlan.DEFAULT); + Snippets.install(runtime, runtime.getCompiler().getTarget(), new ArrayCopySnippets(), PhasePlan.DEFAULT); + } + }); + } // Create compilation queue. diff -r 35ca3ade314d -r ef00461e29af graal/com.oracle.max.graal.lir/src/com/oracle/max/graal/lir/asm/TargetMethodAssembler.java --- a/graal/com.oracle.max.graal.lir/src/com/oracle/max/graal/lir/asm/TargetMethodAssembler.java Fri Feb 10 10:07:48 2012 -0800 +++ b/graal/com.oracle.max.graal.lir/src/com/oracle/max/graal/lir/asm/TargetMethodAssembler.java Fri Feb 10 10:16:19 2012 -0800 @@ -97,7 +97,7 @@ Debug.metric("DataPatches").add(targetMethod.dataReferences.size()); Debug.metric("ExceptionHandlersEmitted").add(targetMethod.exceptionHandlers.size()); - Debug.log("Finished target method %s, isStub %d", name, isStub); + Debug.log("Finished target method %s, isStub %b", name, isStub); /* if (GraalOptions.PrintAssembly && !TTY.isSuppressed() && !isStub) { Util.printSection("Target Method", Util.SECTION_CHARACTER); diff -r 35ca3ade314d -r ef00461e29af graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/FrameState.java --- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/FrameState.java Fri Feb 10 10:07:48 2012 -0800 +++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/FrameState.java Fri Feb 10 10:16:19 2012 -0800 @@ -592,6 +592,8 @@ properties.put("bci", bci); if (method != null) { properties.put("method", CiUtil.format("%H.%n(%p):%r", method)); + } else { + properties.put("method", "None"); } StringBuilder str = new StringBuilder(); for (int i = 0; i < localsSize(); i++) { diff -r 35ca3ade314d -r ef00461e29af graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/CFGPrinterObserver.java --- a/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/CFGPrinterObserver.java Fri Feb 10 10:07:48 2012 -0800 +++ b/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/CFGPrinterObserver.java Fri Feb 10 10:16:19 2012 -0800 @@ -66,9 +66,6 @@ } else if (object instanceof SchedulePhase) { schedule = (SchedulePhase) object; return; - } else if (object instanceof LIRGenerator) { - cfgPrinter.lirGenerator = (LIRGenerator) object; - return; } if (compiler == null) { @@ -86,7 +83,9 @@ } RiRuntime runtime = cfgPrinter.runtime; - if (object instanceof RiResolvedMethod) { + if (object instanceof LIRGenerator) { + cfgPrinter.lirGenerator = (LIRGenerator) object; + } else if (object instanceof RiResolvedMethod) { method = (RiResolvedMethod) object; cfgPrinter.printCompilation(method); diff -r 35ca3ade314d -r ef00461e29af graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/IdealGraphPrinter.java --- a/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/IdealGraphPrinter.java Fri Feb 10 10:07:48 2012 -0800 +++ b/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/IdealGraphPrinter.java Fri Feb 10 10:16:19 2012 -0800 @@ -94,7 +94,7 @@ schedule = new SchedulePhase(); schedule.apply((StructuredGraph) graph); } catch (Throwable t) { - // nothing to do here... + schedule = null; } } diff -r 35ca3ade314d -r ef00461e29af graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/Snippets.java --- a/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/Snippets.java Fri Feb 10 10:07:48 2012 -0800 +++ b/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/Snippets.java Fri Feb 10 10:16:19 2012 -0800 @@ -23,6 +23,7 @@ package com.oracle.max.graal.snippets; import java.lang.reflect.*; +import java.util.concurrent.*; import com.oracle.max.cri.ci.*; import com.oracle.max.cri.ri.*; @@ -86,47 +87,53 @@ } } - private static StructuredGraph buildSnippetGraph(RiResolvedMethod snippetRiMethod, GraalRuntime runtime, CiTarget target, BoxingMethodPool pool, PhasePlan plan) { + private static StructuredGraph buildSnippetGraph(final RiResolvedMethod snippetRiMethod, final GraalRuntime runtime, final CiTarget target, final BoxingMethodPool pool, final PhasePlan plan) { + return Debug.scope("BuildSnippetGraph", snippetRiMethod, new Callable() { - GraphBuilderConfiguration config = GraphBuilderConfiguration.getSnippetDefault(); - GraphBuilderPhase graphBuilder = new GraphBuilderPhase(runtime, config); - StructuredGraph graph = new StructuredGraph(snippetRiMethod); - graphBuilder.apply(graph); + @Override + public StructuredGraph call() throws Exception { + GraphBuilderConfiguration config = GraphBuilderConfiguration.getSnippetDefault(); + GraphBuilderPhase graphBuilder = new GraphBuilderPhase(runtime, config); + StructuredGraph graph = new StructuredGraph(snippetRiMethod); + graphBuilder.apply(graph); - Debug.dump(graph, "%s: %s", snippetRiMethod.name(), GraphBuilderPhase.class.getSimpleName()); + Debug.dump(graph, "%s: %s", snippetRiMethod.name(), GraphBuilderPhase.class.getSimpleName()); - new SnippetIntrinsificationPhase(runtime, pool).apply(graph); + new SnippetIntrinsificationPhase(runtime, pool).apply(graph); - for (Invoke invoke : graph.getInvokes()) { - MethodCallTargetNode callTarget = invoke.callTarget(); - RiResolvedMethod targetMethod = callTarget.targetMethod(); - RiResolvedType holder = targetMethod.holder(); - if (holder.isSubtypeOf(runtime.getType(SnippetsInterface.class))) { - StructuredGraph targetGraph = (StructuredGraph) targetMethod.compilerStorage().get(Graph.class); - if (targetGraph == null) { - targetGraph = buildSnippetGraph(targetMethod, runtime, target, pool, plan); + for (Invoke invoke : graph.getInvokes()) { + MethodCallTargetNode callTarget = invoke.callTarget(); + RiResolvedMethod targetMethod = callTarget.targetMethod(); + RiResolvedType holder = targetMethod.holder(); + if (holder.isSubtypeOf(runtime.getType(SnippetsInterface.class))) { + StructuredGraph targetGraph = (StructuredGraph) targetMethod.compilerStorage().get(Graph.class); + if (targetGraph == null) { + targetGraph = buildSnippetGraph(targetMethod, runtime, target, pool, plan); + } + InliningUtil.inline(invoke, targetGraph, true); + new CanonicalizerPhase(target, runtime, null).apply(graph); + } } - InliningUtil.inline(invoke, targetGraph, true); - new CanonicalizerPhase(target, runtime, null).apply(graph); - } - } + + new SnippetIntrinsificationPhase(runtime, pool).apply(graph); - new SnippetIntrinsificationPhase(runtime, pool).apply(graph); - - Debug.dump(graph, "%s: %s", snippetRiMethod.name(), GraphBuilderPhase.class.getSimpleName()); - new DeadCodeEliminationPhase().apply(graph); - new CanonicalizerPhase(target, runtime, null).apply(graph); + Debug.dump(graph, "%s: %s", snippetRiMethod.name(), GraphBuilderPhase.class.getSimpleName()); + new DeadCodeEliminationPhase().apply(graph); + new CanonicalizerPhase(target, runtime, null).apply(graph); - // TODO (gd) remove when we have safepoint polling elimination - for (LoopEndNode end : graph.getNodes(LoopEndNode.class)) { - end.setSafepointPolling(false); - } - new InsertStateAfterPlaceholderPhase().apply(graph); + // TODO (gd) remove when we have safepoint polling elimination + for (LoopEndNode end : graph.getNodes(LoopEndNode.class)) { + end.setSafepointPolling(false); + } + new InsertStateAfterPlaceholderPhase().apply(graph); - Debug.dump(graph, "%s: Final", snippetRiMethod.name()); + Debug.dump(graph, "%s: Final", snippetRiMethod.name()); + + snippetRiMethod.compilerStorage().put(Graph.class, graph); - snippetRiMethod.compilerStorage().put(Graph.class, graph); + return graph; + } + }); - return graph; } } diff -r 35ca3ade314d -r ef00461e29af make/linux/makefiles/vm.make --- a/make/linux/makefiles/vm.make Fri Feb 10 10:07:48 2012 -0800 +++ b/make/linux/makefiles/vm.make Fri Feb 10 10:16:19 2012 -0800 @@ -133,7 +133,7 @@ LIBJVM_DEBUGINFO = lib$(JVM).debuginfo LIBJVM_G_DEBUGINFO = lib$(JVM)$(G_SUFFIX).debuginfo -SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt +SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt graal SOURCE_PATHS=\ $(shell find $(HS_COMMON_SRC)/share/vm/* -type d \! \ diff -r 35ca3ade314d -r ef00461e29af mx/commands.py --- a/mx/commands.py Fri Feb 10 10:07:48 2012 -0800 +++ b/mx/commands.py Fri Feb 10 10:16:19 2012 -0800 @@ -289,21 +289,6 @@ mx.abort('Host JDK directory is missing: ' + src) shutil.copytree(src, dst) - jvmCfg = join(jdk, 'jre', 'lib', 'amd64', 'jvm.cfg') - found = False - if not exists(jvmCfg): - mx.abort(jvmCfg + ' does not exist') - - with open(jvmCfg) as f: - for line in f: - if '-graal KNOWN' in line: - found = True - break - if not found: - mx.log('Appending "-graal KNOWN" to ' + jvmCfg) - with open(jvmCfg, 'a') as f: - f.write('-graal KNOWN\n') - if build == 'product': return jdk elif build in ['debug', 'fastdebug']: @@ -361,28 +346,24 @@ """builds the GraalVM binary and compiles the Graal classes The optional last argument specifies what type of VM to build.""" - - - parser = ArgumentParser(prog='mx build'); - parser.add_argument('--vm', action='store', dest='vm', default='graal', choices=['graal', 'server', 'client'], help='the VM to be built') # Call mx.build to compile the Java sources - opts = mx.build(['--source', '1.7'] + args, parser=parser) + opts2 = mx.build(['--source', '1.7'] + args, parser=ArgumentParser(prog='mx build')) - if not _vmSourcesAvailable or not opts.native: + if not _vmSourcesAvailable or not opts2.native: return - builds = opts.remainder + builds = opts2.remainder if len(builds) == 0: builds = ['product'] - vm = opts.vm + vm = _vm if vm == 'server': buildSuffix = '' elif vm == 'client': buildSuffix = '1' else: - assert vm is 'graal' + assert vm == 'graal', vm buildSuffix = 'graal' for build in builds: @@ -424,6 +405,28 @@ env['ALT_BOOTDIR'] = jdk env.setdefault('INSTALL', 'y') mx.run([mx.gmake_cmd(), build + buildSuffix], cwd=join(_graal_home, 'make'), err=filterXusage) + + jvmCfg = join(jdk, 'jre', 'lib', 'amd64', 'jvm.cfg') + found = False + if not exists(jvmCfg): + mx.abort(jvmCfg + ' does not exist') + + prefix = '-' + vm + vmKnown = prefix + ' KNOWN\n' + lines = [] + with open(jvmCfg) as f: + for line in f: + if vmKnown in line: + found = True + break + if not line.startswith(prefix): + lines.append(line) + if not found: + mx.log('Appending "' + prefix + ' KNOWN" to ' + jvmCfg) + lines.append(vmKnown) + with open(jvmCfg, 'w') as f: + for line in lines: + f.write(line) def vm(args, vm=None, nonZeroIsFatal=True, out=None, err=None, cwd=None, timeout=None, vmbuild=None): """run the GraalVM""" @@ -605,15 +608,7 @@ del args[index] else: mx.abort('-resultfile must be followed by a file name') - vm = 'graal' - if '-vm' in args: - index = args.index('-vm') - if index + 1 < len(args): - vm = args[index + 1] - del args[index] - del args[index] - else: - mx.abort('-vm must be followed by a vm name (graal, server, client..)') + vm = _vm if len(args) is 0: args += ['all'] @@ -715,7 +710,7 @@ 'example': [example, '[-v] example names...'], 'gate' : [gate, ''], 'gv' : [gv, ''], - 'bench' : [bench, '[-vm vm] [-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'], + 'bench' : [bench, '[-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'], 'unittest' : [unittest, '[filters...]'], 'vm': [vm, '[-options] class [args...]'] } @@ -743,8 +738,9 @@ mx.abort('Requires Java version 1.7 or greater, got version ' + version) if (_vmSourcesAvailable): - global _vm - _vm = opts.vm + if hasattr(opts, 'vm') and opts.vm is not None: + global _vm + _vm = opts.vm if hasattr(opts, 'vmbuild') and opts.vmbuild is not None: global _vmbuild _vmbuild = opts.vmbuild diff -r 35ca3ade314d -r ef00461e29af src/cpu/x86/vm/c1_Runtime1_x86.cpp --- a/src/cpu/x86/vm/c1_Runtime1_x86.cpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/cpu/x86/vm/c1_Runtime1_x86.cpp Fri Feb 10 10:16:19 2012 -0800 @@ -593,7 +593,7 @@ OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address target, bool has_argument) { OopMapSet* oop_maps = new OopMapSet(); - if (UseGraal) { +#ifdef GRAAL // graal passes the argument in r10 OopMap* oop_map = save_live_registers(sasm, 1); @@ -611,7 +611,7 @@ int call_offset = __ call_RT(noreg, noreg, target, has_argument ? 1 : 0); oop_maps->add_gc_map(call_offset, oop_map); - } else { +#else // preserve all registers int num_rt_args = has_argument ? 2 : 1; OopMap* oop_map = save_live_registers(sasm, num_rt_args); @@ -635,7 +635,7 @@ int call_offset = __ call_RT(noreg, noreg, target, num_rt_args - 1); oop_maps->add_gc_map(call_offset, oop_map); - } +#endif __ stop("should not reach here"); @@ -1372,8 +1372,13 @@ // will be place in C abi locations #ifdef _LP64 - __ verify_oop((UseGraal) ? j_rarg0 : c_rarg0); - __ mov(rax, (UseGraal) ? j_rarg0 : c_rarg0); +#ifdef GRAAL + __ verify_oop(j_rarg0); + __ mov(rax, j_rarg0); +#else + __ verify_oop(c_rarg0); + __ mov(rax, c_rarg0); +#endif #else // The object is passed on the stack and we haven't pushed a // frame yet so it's one work away from top of stack. @@ -1506,10 +1511,10 @@ Label success; Label miss; - if (UseGraal) { +#ifdef GRAAL // TODO this should really be within the XirSnippets __ check_klass_subtype_fast_path(rsi, rax, rcx, &success, &miss, NULL); - }; +#endif __ check_klass_subtype_slow_path(rsi, rax, rcx, rdi, NULL, &miss); diff -r 35ca3ade314d -r ef00461e29af src/cpu/x86/vm/interp_masm_x86_64.cpp --- a/src/cpu/x86/vm/interp_masm_x86_64.cpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/cpu/x86/vm/interp_masm_x86_64.cpp Fri Feb 10 10:16:19 2012 -0800 @@ -1126,8 +1126,12 @@ Register receiver, Register mdp, Register reg2, int start_row, Label& done, bool is_virtual_call) { +#ifdef GRAAL // change for GRAAL (use counter to indicate polymorphic case instead of failed typechecks) - bool use_counter_for_polymorphic_case = is_virtual_call || UseGraal; + bool use_counter_for_polymorphic_case = true; +#else + bool use_counter_for_polymorphic_case = is_virtual_call; +#endif if (TypeProfileWidth == 0) { if (use_counter_for_polymorphic_case) { @@ -1300,8 +1304,9 @@ void InterpreterMacroAssembler::profile_typecheck_failed(Register mdp) { - // changed for GRAAL (use counter to indicate polymorphism instead of failed typechecks) - if (ProfileInterpreter && TypeProfileCasts && !UseGraal) { +// changed for GRAAL (use counter to indicate polymorphism instead of failed typechecks) +#ifndef GRAAL + if (ProfileInterpreter && TypeProfileCasts) { Label profile_continue; // If no method data exists, go to profile_continue. @@ -1316,6 +1321,7 @@ bind (profile_continue); } +#endif } diff -r 35ca3ade314d -r ef00461e29af src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Diagram.java --- a/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Diagram.java Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Diagram.java Fri Feb 10 10:16:19 2012 -0800 @@ -128,9 +128,9 @@ int to = e.getTo(); Figure fromFigure = figureHash.get(from); Figure toFigure = figureHash.get(to); - assert fromFigure != null && toFigure != null; if(fromFigure == null || toFigure == null) continue; + assert fromFigure != null && toFigure != null; int fromIndex = e.getFromIndex(); while (fromFigure.getOutputSlots().size() <= fromIndex) { diff -r 35ca3ade314d -r ef00461e29af src/share/vm/c1/c1_Runtime1.cpp --- a/src/share/vm/c1/c1_Runtime1.cpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/c1/c1_Runtime1.cpp Fri Feb 10 10:16:19 2012 -0800 @@ -462,9 +462,11 @@ thread->set_is_method_handle_return(false); Handle exception(thread, ex); - if (UseGraal && exception.is_null()) { +#ifdef GRAAL + if (exception.is_null()) { exception = Exceptions::new_exception(thread, vmSymbols::java_lang_NullPointerException(), NULL); } +#endif nm = CodeCache::find_nmethod(pc); assert(nm != NULL, "this is not an nmethod"); // Adjust the pc as needed/ diff -r 35ca3ade314d -r ef00461e29af src/share/vm/c1/c1_globals.hpp --- a/src/share/vm/c1/c1_globals.hpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/c1/c1_globals.hpp Fri Feb 10 10:16:19 2012 -0800 @@ -56,8 +56,6 @@ // #define C1_FLAGS(develop, develop_pd, product, product_pd, notproduct) \ \ - product(bool, UseGraal, true, \ - "Use graal instead of C1") \ product(bool, DebugGraal, true, \ "Enable JVMTI for the compiler thread") \ product(bool, BootstrapGraal, true, \ diff -r 35ca3ade314d -r ef00461e29af src/share/vm/classfile/classLoader.cpp --- a/src/share/vm/classfile/classLoader.cpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/classfile/classLoader.cpp Fri Feb 10 10:16:19 2012 -0800 @@ -184,7 +184,6 @@ ClassPathEntry::ClassPathEntry() { set_next(NULL); - _compiler_thread_only = false; } @@ -443,17 +442,23 @@ void ClassLoader::setup_bootstrap_search_path() { assert(_first_entry == NULL, "should not setup bootstrap class search path twice"); char* sys_class_path = os::strdup(Arguments::get_sysclasspath()); +#ifdef GRAAL char* compiler_class_path = os::strdup(Arguments::get_compilerclasspath()); +#endif if (TraceClassLoading && Verbose) { tty->print_cr("[Bootstrap loader class path=%s]", sys_class_path); +#ifdef GRAAL tty->print_cr("[Compiler loader class path=%s]", compiler_class_path); +#endif } - setup_bootstrap_search_path(sys_class_path, false); - setup_bootstrap_search_path(compiler_class_path, true); + setup_bootstrap_search_path(sys_class_path); +#ifdef GRAAL + setup_bootstrap_search_path(compiler_class_path); +#endif } -void ClassLoader::setup_bootstrap_search_path(char* sys_class_path, bool compiler_cp) { +void ClassLoader::setup_bootstrap_search_path(char* sys_class_path) { int len = (int)strlen(sys_class_path); int end = 0; @@ -465,7 +470,7 @@ char* path = NEW_C_HEAP_ARRAY(char, end-start+1); strncpy(path, &sys_class_path[start], end-start); path[end-start] = '\0'; - update_class_path_entry_list(path, false, compiler_cp); + update_class_path_entry_list(path, false); FREE_C_HEAP_ARRAY(char, path); while (sys_class_path[end] == os::path_separator()[0]) { end++; @@ -561,7 +566,7 @@ ClassPathEntry* e = _first_entry; while (e != NULL) { // assume zip entries have been canonicalized - if (e->compiler_thread_only() == entry->compiler_thread_only() && strcmp(entry->name(), e->name()) == 0) { + if (strcmp(entry->name(), e->name()) == 0) { return true; } e = e->next(); @@ -581,14 +586,12 @@ } void ClassLoader::update_class_path_entry_list(const char *path, - bool check_for_duplicates, - bool compiler_cp) { + bool check_for_duplicates) { struct stat st; if (os::stat((char *)path, &st) == 0) { // File or directory found ClassPathEntry* new_entry = NULL; create_class_path_entry((char *)path, st, &new_entry, LazyBootClassLoader); - //new_entry->set_compiler_thread_only(compiler_cp); // The kernel VM adds dynamically to the end of the classloader path and // doesn't reorder the bootclasspath which would break java.lang.Package // (see PackageInfo). @@ -905,9 +908,7 @@ PerfClassTraceTime::CLASS_LOAD); ClassPathEntry* e = _first_entry; while (e != NULL) { - if (THREAD->is_Compiler_thread() || !Universe::_fully_initialized || !e->compiler_thread_only()) { - stream = e->open_stream(name); - } + stream = e->open_stream(name); if (stream != NULL) { break; } diff -r 35ca3ade314d -r ef00461e29af src/share/vm/classfile/classLoader.hpp --- a/src/share/vm/classfile/classLoader.hpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/classfile/classLoader.hpp Fri Feb 10 10:16:19 2012 -0800 @@ -49,7 +49,6 @@ class ClassPathEntry: public CHeapObj { private: ClassPathEntry* _next; - bool _compiler_thread_only; public: // Next entry in class path ClassPathEntry* next() { return _next; } @@ -60,8 +59,6 @@ virtual bool is_jar_file() = 0; virtual const char* name() = 0; virtual bool is_lazy(); - bool compiler_thread_only() const { return _compiler_thread_only; } - void set_compiler_thread_only(bool b) { _compiler_thread_only = b; } // Constructor ClassPathEntry(); // Attempt to locate file_name through this class path entry. @@ -209,7 +206,7 @@ // Initialization static void setup_meta_index(); static void setup_bootstrap_search_path(); - static void setup_bootstrap_search_path(char* sys_class_path, bool compiler_cp); + static void setup_bootstrap_search_path(char* sys_class_path); static void load_zip_library(); static void create_class_path_entry(char *path, struct stat st, ClassPathEntry **new_entry, bool lazy); @@ -219,8 +216,7 @@ public: // Used by the kernel jvm. static void update_class_path_entry_list(const char *path, - bool check_for_duplicates, - bool compiler_cp); + bool check_for_duplicates); static void print_bootclasspath(); // Timing diff -r 35ca3ade314d -r ef00461e29af src/share/vm/code/compiledIC.cpp --- a/src/share/vm/code/compiledIC.cpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/code/compiledIC.cpp Fri Feb 10 10:16:19 2012 -0800 @@ -529,7 +529,10 @@ NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); assert(method_holder->data() == 0 || method_holder->data() == (intptr_t)callee(), "a) MT-unsafe modification of inline cache"); - assert(UseGraal || jump->jump_destination() == (address)-1 || jump->jump_destination() == entry, "b) MT-unsafe modification of inline cache"); +// XXX GRAAL : ?? +#ifndef GRAAL + assert(jump->jump_destination() == (address)-1 || jump->jump_destination() == entry, "b) MT-unsafe modification of inline cache"); +#endif // Update stub method_holder->set_data((intptr_t)callee()); diff -r 35ca3ade314d -r ef00461e29af src/share/vm/code/nmethod.cpp --- a/src/share/vm/code/nmethod.cpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/code/nmethod.cpp Fri Feb 10 10:16:19 2012 -0800 @@ -837,7 +837,7 @@ // Exception handler and deopt handler are in the stub section assert(offsets->value(CodeOffsets::Exceptions) != -1, "must be set"); assert(offsets->value(CodeOffsets::Deopt ) != -1, "must be set"); - if (UseGraal) { +#ifdef GRAAL // graal produces no (!) stub section _exception_offset = code_offset() + offsets->value(CodeOffsets::Exceptions); _deoptimize_offset = code_offset() + offsets->value(CodeOffsets::Deopt); @@ -846,7 +846,7 @@ } else { _deoptimize_mh_offset = -1; } - } else { +#else _exception_offset = _stub_offset + offsets->value(CodeOffsets::Exceptions); _deoptimize_offset = _stub_offset + offsets->value(CodeOffsets::Deopt); if (offsets->value(CodeOffsets::DeoptMH) != -1) { @@ -854,7 +854,7 @@ } else { _deoptimize_mh_offset = -1; } - } +#endif if (offsets->value(CodeOffsets::UnwindHandler) != -1) { _unwind_handler_offset = code_offset() + offsets->value(CodeOffsets::UnwindHandler); } else { @@ -2353,7 +2353,9 @@ // information in a table. break; } - assert(UseGraal || stub == NULL || stub_contains(stub), "static call stub outside stub section"); +#ifndef GRAAL + assert(stub == NULL || stub_contains(stub), "static call stub outside stub section"); +#endif } } diff -r 35ca3ade314d -r ef00461e29af src/share/vm/code/nmethod.hpp --- a/src/share/vm/code/nmethod.hpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/code/nmethod.hpp Fri Feb 10 10:16:19 2012 -0800 @@ -592,7 +592,7 @@ // (tw) When using graal, the address might be off by 5 (because this is the size of the call instruction. // (tw) TODO: Replace this by a more general mechanism. - bool is_deopt_entry (address pc) { return pc == deopt_handler_begin() || (UseGraal && pc == deopt_handler_begin() + 5); } + bool is_deopt_entry (address pc) { return pc == deopt_handler_begin() IS_GRAAL( || pc == deopt_handler_begin() + 5); } bool is_deopt_mh_entry(address pc) { return pc == deopt_mh_handler_begin(); } // Accessor/mutator for the original pc of a frame before a frame was deopted. address get_original_pc(const frame* fr) { return *orig_pc_addr(fr); } diff -r 35ca3ade314d -r ef00461e29af src/share/vm/compiler/compileBroker.cpp --- a/src/share/vm/compiler/compileBroker.cpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/compiler/compileBroker.cpp Fri Feb 10 10:16:19 2012 -0800 @@ -44,7 +44,9 @@ #include "runtime/sharedRuntime.hpp" #include "runtime/sweeper.hpp" #include "utilities/dtrace.hpp" +#ifdef GRAAL #include "graal/graalCompiler.hpp" +#endif #ifdef COMPILER1 #include "c1/c1_Compiler.hpp" #endif @@ -680,13 +682,15 @@ // Set the interface to the current compiler(s). int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple); int c2_count = CompilationPolicy::policy()->compiler_count(CompLevel_full_optimization); +#ifdef GRAAL + _compilers[0] = new GraalCompiler(); +#else #ifdef COMPILER1 - if (UseGraal) { - _compilers[0] = new GraalCompiler(); - } else if (c1_count > 0) { - _compilers[0] = new Compiler(); + if (c1_count > 0) { + _compilers[0] = new Compiler(); } #endif // COMPILER1 +#endif #ifdef COMPILER2 if (c2_count > 0) { @@ -936,6 +940,7 @@ // ------------------------------------------------------------------ // CompileBroker::is_idle bool CompileBroker::is_idle() { +#ifndef GRAAL if (_c2_method_queue != NULL && !_c2_method_queue->is_empty()) { return false; } else if (_c1_method_queue != NULL && !_c1_method_queue->is_empty()) { @@ -947,10 +952,10 @@ return false; } } - - // No pending or active compilations. - return true; } +#endif + // No pending or active compilations. + return true; } @@ -1043,8 +1048,9 @@ MutexLocker locker(queue->lock(), THREAD); if (JavaThread::current()->is_compiling() && !BackgroundCompilation) { - +#ifdef GRAAL TRACE_graal_1("Recursive compile %s!", method->name_and_sig_as_C_string()); +#endif method->set_not_compilable(); return; } @@ -1113,11 +1119,13 @@ // and in that case it's best to protect both the testing (here) of // these bits, and their updating (here and elsewhere) under a // common lock. - /*task = create_compile_task(queue, +#ifndef GRAAL + task = create_compile_task(queue, compile_id, method, osr_bci, comp_level, hot_method, hot_count, comment, - blocking);*/ + blocking); +#endif } #ifdef GRAAL @@ -1128,10 +1136,11 @@ // Recursive compile request => ignore. } #endif - - /*if (blocking) { +#ifndef GRAAL + if (blocking) { wait_for_completion(task); - }*/ + } +#endif } diff -r 35ca3ade314d -r ef00461e29af src/share/vm/interpreter/rewriter.cpp --- a/src/share/vm/interpreter/rewriter.cpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/interpreter/rewriter.cpp Fri Feb 10 10:16:19 2012 -0800 @@ -118,7 +118,11 @@ while (!bcs.is_last_bytecode()) { Bytecodes::Code opcode = bcs.raw_next(); switch (opcode) { - case Bytecodes::_return: if (!UseGraal) { *bcs.bcp() = Bytecodes::_return_register_finalizer; } break; + case Bytecodes::_return: +#ifndef GRAAL + *bcs.bcp() = Bytecodes::_return_register_finalizer; +#endif + break; case Bytecodes::_istore: case Bytecodes::_lstore: @@ -273,14 +277,14 @@ switch (c) { case Bytecodes::_lookupswitch : { #ifndef CC_INTERP - if (!UseGraal) { +#ifndef GRAAL Bytecode_lookupswitch bc(method, bcp); (*bcp) = ( bc.number_of_pairs() < BinarySwitchThreshold ? Bytecodes::_fast_linearswitch : Bytecodes::_fast_binaryswitch ); - } +#endif #endif break; } diff -r 35ca3ade314d -r ef00461e29af src/share/vm/prims/jni.cpp --- a/src/share/vm/prims/jni.cpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/prims/jni.cpp Fri Feb 10 10:16:19 2012 -0800 @@ -29,7 +29,9 @@ #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" #include "interpreter/linkResolver.hpp" +#ifdef GRAAL #include "graal/graalCompiler.hpp" +#endif #ifndef SERIALGC #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" #endif // SERIALGC @@ -5125,11 +5127,9 @@ *(JNIEnv**)penv = thread->jni_environment(); #ifdef GRAAL - if (UseGraal) { GraalCompiler* compiler = GraalCompiler::instance(); ciObjectFactory::initialize(); compiler->initialize(); - } #endif // Tracks the time application was running before GC diff -r 35ca3ade314d -r ef00461e29af src/share/vm/runtime/arguments.cpp --- a/src/share/vm/runtime/arguments.cpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/runtime/arguments.cpp Fri Feb 10 10:16:19 2012 -0800 @@ -61,8 +61,10 @@ int Arguments::_num_jvm_flags = 0; char** Arguments::_jvm_args_array = NULL; int Arguments::_num_jvm_args = 0; +#ifdef GRAAL char** Arguments::_graal_args_array = NULL; int Arguments::_num_graal_args = 0; +#endif char* Arguments::_java_command = NULL; SystemProperty* Arguments::_system_properties = NULL; const char* Arguments::_gc_log_filename = NULL; @@ -100,7 +102,9 @@ SystemProperty *Arguments::_java_home = NULL; SystemProperty *Arguments::_java_class_path = NULL; SystemProperty *Arguments::_sun_boot_class_path = NULL; +#ifdef GRAAL SystemProperty *Arguments::_compiler_class_path = NULL; +#endif char* Arguments::_meta_index_path = NULL; char* Arguments::_meta_index_dir = NULL; @@ -164,7 +168,9 @@ _java_library_path = new SystemProperty("java.library.path", NULL, true); _java_home = new SystemProperty("java.home", NULL, true); _sun_boot_class_path = new SystemProperty("sun.boot.class.path", NULL, true); +#ifdef GRAAL _compiler_class_path = new SystemProperty("compiler.class.path", NULL, true); +#endif _java_class_path = new SystemProperty("java.class.path", "", true); @@ -176,7 +182,9 @@ PropertyList_add(&_system_properties, _java_home); PropertyList_add(&_system_properties, _java_class_path); PropertyList_add(&_system_properties, _sun_boot_class_path); +#ifdef GRAAL PropertyList_add(&_system_properties, _compiler_class_path); +#endif // Set OS specific system properties values os::init_system_properties_values(); @@ -756,10 +764,11 @@ void Arguments::build_jvm_flags(const char* arg) { add_string(&_jvm_flags_array, &_num_jvm_flags, arg); } - +#ifdef GRAAL void Arguments::add_graal_arg(const char* arg) { add_string(&_graal_args_array, &_num_graal_args, arg); } +#endif // utility function to return a string that concatenates all // strings in a given char** array @@ -1931,6 +1940,19 @@ status = status && verify_object_alignment(); +#ifdef GRAAL + if (UseCompressedOops) { + jio_fprintf(defaultStream::error_stream(), + "CompressedOops are not supported in Graal at the moment\n"); + status = false; + } + if (UseG1GC) { + jio_fprintf(defaultStream::error_stream(), + "G1 is not supported in Graal at the moment\n"); + status = false; + } +#endif + return status; } @@ -2010,7 +2032,7 @@ } // Parse JavaVMInitArgs structure - +#ifdef GRAAL static void prepend_to_graal_classpath(SysClassPath &cp, const char* graal_dir, const char* project) { const int BUFFER_SIZE = 1024; char path[BUFFER_SIZE]; @@ -2056,6 +2078,7 @@ } return false; } +#endif jint Arguments::parse_vm_init_args(const JavaVMInitArgs* args) { // For components of the system classpath. @@ -2083,7 +2106,7 @@ return result; } - if (UseGraal) { +#ifdef GRAAL if (PrintVMOptions) { tty->print_cr("Running Graal VM... "); } @@ -2103,7 +2126,7 @@ errno = 0; DIR* graal_dir_handle = os::opendir(graal_dir); while ((dentry = os::readdir(graal_dir_handle, (struct dirent *)tdbuf)) != NULL) { - if (strcmp(dentry->d_name, ".") != 0 && strcmp(dentry->d_name, "..")) { + if (strcmp(dentry->d_name, ".") != 0 && strcmp(dentry->d_name, "..") != 0 && strcmp(dentry->d_name, "com.oracle.max.graal.tests") != 0) { prepend_to_graal_classpath(scp_compiler, graal_dir, dentry->d_name); if (PrintVMOptions) { tty->print_cr("Adding project directory %s to bootclasspath", dentry->d_name); @@ -2115,7 +2138,7 @@ scp_compiler.expand_endorsed(); Arguments::set_compilerclasspath(scp_compiler.combined_path()); - } +#endif if (AggressiveOpts) { // Insert alt-rt.jar between user-specified bootclasspath @@ -2777,7 +2800,9 @@ return JNI_EINVAL; } } - } else if (match_option(option, "-G:", &tail)) { // -G:XXX + } +#ifdef GRAAL + else if (match_option(option, "-G:", &tail)) { // -G:XXX // Option for the graal compiler. if (PrintVMOptions) { tty->print_cr("graal option %s", tail); @@ -2785,7 +2810,9 @@ Arguments::add_graal_arg(tail); // Unknown option - } else if (is_bad_option(option, args->ignoreUnrecognized)) { + } +#endif + else if (is_bad_option(option, args->ignoreUnrecognized)) { return JNI_ERR; } } diff -r 35ca3ade314d -r ef00461e29af src/share/vm/runtime/arguments.hpp --- a/src/share/vm/runtime/arguments.hpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/runtime/arguments.hpp Fri Feb 10 10:16:19 2012 -0800 @@ -245,7 +245,9 @@ static SystemProperty *_java_home; static SystemProperty *_java_class_path; static SystemProperty *_sun_boot_class_path; +#ifdef GRAAL static SystemProperty *_compiler_class_path; +#endif // Meta-index for knowing what packages are in the boot class path static char* _meta_index_path; @@ -370,7 +372,9 @@ // methods to build strings from individual args static void build_jvm_args(const char* arg); static void build_jvm_flags(const char* arg); +#ifdef GRAAL static void add_graal_arg(const char* arg); +#endif static void add_string(char*** bldarray, int* count, const char* arg); static const char* build_resource_string(char** args, int count); @@ -426,7 +430,9 @@ // return a char* array containing all options static char** jvm_flags_array() { return _jvm_flags_array; } static char** jvm_args_array() { return _jvm_args_array; } +#ifdef GRAAL static char** graal_args_array() { return _graal_args_array; } +#endif static int num_jvm_flags() { return _num_jvm_flags; } static int num_graal_args() { return _num_graal_args; } static int num_jvm_args() { return _num_jvm_args; } @@ -526,7 +532,9 @@ static void set_ext_dirs(char *value) { _java_ext_dirs->set_value(value); } static void set_endorsed_dirs(char *value) { _java_endorsed_dirs->set_value(value); } static void set_sysclasspath(char *value) { _sun_boot_class_path->set_value(value); } +#ifdef GRAAL static void set_compilerclasspath(char *value) { _compiler_class_path->set_value(value); } +#endif static void append_sysclasspath(const char *value) { _sun_boot_class_path->append_value(value); } static void set_meta_index_path(char* meta_index_path, char* meta_index_dir) { _meta_index_path = meta_index_path; @@ -537,7 +545,9 @@ static char *get_dll_dir() { return _sun_boot_library_path->value(); } static char *get_endorsed_dir() { return _java_endorsed_dirs->value(); } static char *get_sysclasspath() { return _sun_boot_class_path->value(); } +#ifdef GRAAL static char *get_compilerclasspath() { return _compiler_class_path->value(); } +#endif static char* get_meta_index_path() { return _meta_index_path; } static char* get_meta_index_dir() { return _meta_index_dir; } diff -r 35ca3ade314d -r ef00461e29af src/share/vm/runtime/java.cpp --- a/src/share/vm/runtime/java.cpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/runtime/java.cpp Fri Feb 10 10:16:19 2012 -0800 @@ -30,7 +30,9 @@ #include "compiler/compileBroker.hpp" #include "compiler/compilerOracle.hpp" #include "interpreter/bytecodeHistogram.hpp" +#ifdef GRAAL #include "graal/graalCompiler.hpp" +#endif #include "memory/genCollectedHeap.hpp" #include "memory/oopFactory.hpp" #include "memory/universe.hpp" @@ -432,9 +434,7 @@ static jint volatile _before_exit_status = BEFORE_EXIT_NOT_RUN; #ifdef GRAAL - if (UseGraal) { - GraalCompiler::instance()->exit(); - } + GraalCompiler::instance()->exit(); #endif // Note: don't use a Mutex to guard the entire before_exit(), as diff -r 35ca3ade314d -r ef00461e29af src/share/vm/runtime/reflectionUtils.cpp --- a/src/share/vm/runtime/reflectionUtils.cpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/runtime/reflectionUtils.cpp Fri Feb 10 10:16:19 2012 -0800 @@ -79,12 +79,10 @@ _filtered_fields->append(new FilteredField(SystemDictionary::reflect_UnsafeStaticFieldAccessorImpl_klass(), offset)); } #ifdef GRAAL - if (UseGraal) { - compute_offset(offset, SystemDictionary::HotSpotMethodResolved_klass(), "javaMirror", "Ljava/lang/Object;", false); - _filtered_fields->append(new FilteredField(SystemDictionary::HotSpotMethodResolved_klass(), offset)); - compute_offset(offset, SystemDictionary::HotSpotMethodData_klass(), "hotspotMirror", "Ljava/lang/Object;", false); - _filtered_fields->append(new FilteredField(SystemDictionary::HotSpotMethodData_klass(), offset)); - } + compute_offset(offset, SystemDictionary::HotSpotMethodResolved_klass(), "javaMirror", "Ljava/lang/Object;", false); + _filtered_fields->append(new FilteredField(SystemDictionary::HotSpotMethodResolved_klass(), offset)); + compute_offset(offset, SystemDictionary::HotSpotMethodData_klass(), "hotspotMirror", "Ljava/lang/Object;", false); + _filtered_fields->append(new FilteredField(SystemDictionary::HotSpotMethodData_klass(), offset)); #endif } diff -r 35ca3ade314d -r ef00461e29af src/share/vm/runtime/sharedRuntime.cpp --- a/src/share/vm/runtime/sharedRuntime.cpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/runtime/sharedRuntime.cpp Fri Feb 10 10:16:19 2012 -0800 @@ -714,15 +714,15 @@ #ifdef COMPILER1 if (t == NULL && nm->is_compiled_by_c1()) { - if (UseGraal) { - nm->make_not_entrant(); - JavaThread::current()->set_exception_pc(ret_pc); - JavaThread::current()->set_exception_oop(exception()); - return SharedRuntime::deopt_blob()->unpack_with_exception_in_tls(); - } else { - assert(nm->unwind_handler_begin() != NULL, ""); - return nm->unwind_handler_begin(); - } +#ifdef GRAAL + nm->make_not_entrant(); + JavaThread::current()->set_exception_pc(ret_pc); + JavaThread::current()->set_exception_oop(exception()); + return SharedRuntime::deopt_blob()->unpack_with_exception_in_tls(); +#else + assert(nm->unwind_handler_begin() != NULL, ""); + return nm->unwind_handler_begin(); +#endif } #endif @@ -877,11 +877,11 @@ #ifndef PRODUCT _implicit_null_throws++; #endif - if (UseGraal) { - target_pc = deoptimization_continuation(thread, pc, nm); - } else { - target_pc = nm->continuation_for_implicit_exception(pc); - } +#ifdef GRAAL + target_pc = deoptimization_continuation(thread, pc, nm); +#else + target_pc = nm->continuation_for_implicit_exception(pc); +#endif // If there's an unexpected fault, target_pc might be NULL, // in which case we want to fall through into the normal // error handling code. @@ -897,14 +897,14 @@ #ifndef PRODUCT _implicit_div0_throws++; #endif - if (UseGraal) { - if (TraceSignals) { - tty->print_cr("graal implicit div0"); - } - target_pc = deoptimization_continuation(thread, pc, nm); - } else { - target_pc = nm->continuation_for_implicit_exception(pc); +#ifdef GRAAL + if (TraceSignals) { + tty->print_cr("graal implicit div0"); } + target_pc = deoptimization_continuation(thread, pc, nm); +#else + target_pc = nm->continuation_for_implicit_exception(pc); +#endif // If there's an unexpected fault, target_pc might be NULL, // in which case we want to fall through into the normal // error handling code. diff -r 35ca3ade314d -r ef00461e29af src/share/vm/runtime/thread.cpp --- a/src/share/vm/runtime/thread.cpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/runtime/thread.cpp Fri Feb 10 10:16:19 2012 -0800 @@ -29,7 +29,9 @@ #include "classfile/vmSymbols.hpp" #include "code/scopeDesc.hpp" #include "compiler/compileBroker.hpp" +#ifdef GRAAL #include "graal/graalCompiler.hpp" +#endif #include "interpreter/interpreter.hpp" #include "interpreter/linkResolver.hpp" #include "interpreter/oopMapCache.hpp" @@ -3017,7 +3019,10 @@ static void compiler_thread_entry(JavaThread* thread, TRAPS) { assert(thread->is_Compiler_thread(), "must be compiler thread"); - //CompileBroker::compiler_thread_loop(); +// XXX (gd) currently we still start c1 compiler threads even with Graal, they just die immediately, more compileBroker cleanup is needed to eliminate that +#ifndef GRAAL + CompileBroker::compiler_thread_loop(); +#endif } // Create a CompilerThread diff -r 35ca3ade314d -r ef00461e29af src/share/vm/runtime/thread.hpp --- a/src/share/vm/runtime/thread.hpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/runtime/thread.hpp Fri Feb 10 10:16:19 2012 -0800 @@ -1748,7 +1748,13 @@ bool is_Compiler_thread() const { return true; } // Hide this compiler thread from external view. // (tw) For Graal, the compiler thread should be visible. - bool is_hidden_from_external_view() const { return !UseGraal || !DebugGraal; } + bool is_hidden_from_external_view() const { +#ifdef GRAAL + return !DebugGraal; +#else + return true; +#endif + } CompileQueue* queue() { return _queue; } CompilerCounters* counters() { return _counters; } diff -r 35ca3ade314d -r ef00461e29af src/share/vm/runtime/vm_version.cpp --- a/src/share/vm/runtime/vm_version.cpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/runtime/vm_version.cpp Fri Feb 10 10:16:19 2012 -0800 @@ -119,8 +119,12 @@ #define VMTYPE "Zero" #endif // SHARK #else // ZERO - #define VMTYPE COMPILER1_PRESENT("Graal") \ +#ifdef GRAAL + #define VMTYPE "Graal" +#else // GRAAL + #define VMTYPE COMPILER1_PRESENT("Client") \ COMPILER2_PRESENT("Server") +#endif // GRAAL #endif // ZERO #endif // TIERED #endif // KERNEL diff -r 35ca3ade314d -r ef00461e29af src/share/vm/utilities/macros.hpp --- a/src/share/vm/utilities/macros.hpp Fri Feb 10 10:07:48 2012 -0800 +++ b/src/share/vm/utilities/macros.hpp Fri Feb 10 10:16:19 2012 -0800 @@ -74,6 +74,12 @@ #define NOT_COMPILER2(code) code #endif // COMPILER2 +#ifdef GRAAL +#define IS_GRAAL(code) code +#else +#define IS_GRAAL(code) +#endif + #ifdef TIERED #define TIERED_ONLY(code) code #define NOT_TIERED(code)