comparison graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalVMEventListener.java @ 21533:b118c9be1d1f

fixed regression preventing hosted CompileTheWorld from running (JBS:GRAAL-53)
author Doug Simon <doug.simon@oracle.com>
date Sun, 24 May 2015 14:44:28 +0200
parents
children c1e2fdb5fea3
comparison
equal deleted inserted replaced
21532:ee764a50af61 21533:b118c9be1d1f
1 /*
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23 package com.oracle.graal.hotspot;
24
25 import static com.oracle.graal.hotspot.CompileTheWorld.Options.*;
26
27 import com.oracle.graal.api.runtime.*;
28 import com.oracle.graal.debug.*;
29 import com.oracle.graal.hotspot.CompileTheWorld.Config;
30 import com.oracle.graal.hotspot.jvmci.*;
31
32 @ServiceProvider(HotSpotVMEventListener.class)
33 public class HotSpotGraalVMEventListener implements HotSpotVMEventListener {
34
35 @Override
36 public void notifyCompileTheWorld() throws Throwable {
37 CompilerToVM compilerToVM = HotSpotGraalRuntime.runtime().getJVMCIRuntime().getCompilerToVM();
38 int iterations = CompileTheWorld.Options.CompileTheWorldIterations.getValue();
39 for (int i = 0; i < iterations; i++) {
40 compilerToVM.resetCompilationStatistics();
41 TTY.println("CompileTheWorld : iteration " + i);
42 CompileTheWorld ctw = new CompileTheWorld(CompileTheWorldClasspath.getValue(), new Config(CompileTheWorldConfig.getValue()), CompileTheWorldStartAt.getValue(),
43 CompileTheWorldStopAt.getValue(), CompileTheWorldMethodFilter.getValue(), CompileTheWorldExcludeMethodFilter.getValue(), CompileTheWorldVerbose.getValue());
44 ctw.compile();
45 }
46 System.exit(0);
47 }
48
49 @Override
50 public void notifyShutdown() {
51 HotSpotGraalRuntime.runtime().shutdown();
52 }
53 }