Mercurial > hg > truffle
annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java @ 5138:4d8ebb0fc484
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Wed, 21 Mar 2012 13:57:30 +0100 |
parents | 09f66048738e 7b2efb5ff2ea |
children | 56909bcec047 |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
4313
79af35bd9fd7
Bootstrap with a syncrhonized method to avoid later deoptimization when the first real synchronized method is compiled.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4265
diff
changeset
|
2 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
4 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
8 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
14 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
18 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
21 * questions. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
22 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
23 |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
24 package com.oracle.graal.hotspot.bridge; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
25 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
26 import java.lang.reflect.*; |
4406
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
27 import java.util.*; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
28 import java.util.concurrent.*; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
29 |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
30 import com.oracle.graal.compiler.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
31 import com.oracle.graal.compiler.phases.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
32 import com.oracle.graal.compiler.phases.PhasePlan.PhasePosition; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
33 import com.oracle.graal.debug.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
34 import com.oracle.graal.debug.internal.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
35 import com.oracle.graal.hotspot.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
36 import com.oracle.graal.hotspot.Compiler; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
37 import com.oracle.graal.hotspot.ri.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
38 import com.oracle.graal.hotspot.server.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
39 import com.oracle.graal.hotspot.snippets.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
40 import com.oracle.graal.java.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
41 import com.oracle.graal.snippets.*; |
5114
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5109
diff
changeset
|
42 import com.oracle.max.cri.ci.*; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5109
diff
changeset
|
43 import com.oracle.max.cri.ri.*; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5109
diff
changeset
|
44 import com.oracle.max.criutils.*; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
45 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
46 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
47 * Exits from the HotSpot VM into Java code. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
48 */ |
4220
5c80ccb80036
Renaming of VMExits and VMEntries part 1.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4205
diff
changeset
|
49 public class VMToCompilerImpl implements VMToCompiler, Remote { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
50 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
51 private final Compiler compiler; |
4420
97e0fb1f4906
Make Array copy intrinsifier active again, fix format string in canonicalizer
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4410
diff
changeset
|
52 private IntrinsifyArrayCopyPhase intrinsifyArrayCopy; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
53 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
54 public final HotSpotTypePrimitive typeBoolean; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
55 public final HotSpotTypePrimitive typeChar; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
56 public final HotSpotTypePrimitive typeFloat; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
57 public final HotSpotTypePrimitive typeDouble; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
58 public final HotSpotTypePrimitive typeByte; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
59 public final HotSpotTypePrimitive typeShort; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
60 public final HotSpotTypePrimitive typeInt; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
61 public final HotSpotTypePrimitive typeLong; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
62 public final HotSpotTypePrimitive typeVoid; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
63 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
64 private ThreadPoolExecutor compileQueue; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
65 |
4220
5c80ccb80036
Renaming of VMExits and VMEntries part 1.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4205
diff
changeset
|
66 public VMToCompilerImpl(Compiler compiler) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
67 this.compiler = compiler; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
68 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
69 typeBoolean = new HotSpotTypePrimitive(compiler, CiKind.Boolean); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
70 typeChar = new HotSpotTypePrimitive(compiler, CiKind.Char); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
71 typeFloat = new HotSpotTypePrimitive(compiler, CiKind.Float); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
72 typeDouble = new HotSpotTypePrimitive(compiler, CiKind.Double); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
73 typeByte = new HotSpotTypePrimitive(compiler, CiKind.Byte); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
74 typeShort = new HotSpotTypePrimitive(compiler, CiKind.Short); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
75 typeInt = new HotSpotTypePrimitive(compiler, CiKind.Int); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
76 typeLong = new HotSpotTypePrimitive(compiler, CiKind.Long); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
77 typeVoid = new HotSpotTypePrimitive(compiler, CiKind.Void); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
78 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
79 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
80 public void startCompiler() throws Throwable { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
81 // Make sure TTY is initialized here such that the correct System.out is used for TTY. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
82 TTY.initialize(); |
4558
3706975946e4
Make graph dumping a bit more robust when there is no method, enable debug in the startCompiler method, add context and scope for snippets installation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4479
diff
changeset
|
83 if (GraalOptions.Debug) { |
3706975946e4
Make graph dumping a bit more robust when there is no method, enable debug in the startCompiler method, add context and scope for snippets installation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4479
diff
changeset
|
84 Debug.enable(); |
3706975946e4
Make graph dumping a bit more robust when there is no method, enable debug in the startCompiler method, add context and scope for snippets installation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4479
diff
changeset
|
85 HotSpotDebugConfig hotspotDebugConfig = new HotSpotDebugConfig(GraalOptions.Log, GraalOptions.Meter, GraalOptions.Time, GraalOptions.Dump, GraalOptions.MethodFilter); |
3706975946e4
Make graph dumping a bit more robust when there is no method, enable debug in the startCompiler method, add context and scope for snippets installation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4479
diff
changeset
|
86 Debug.setConfig(hotspotDebugConfig); |
3706975946e4
Make graph dumping a bit more robust when there is no method, enable debug in the startCompiler method, add context and scope for snippets installation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4479
diff
changeset
|
87 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
88 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
89 // Install intrinsics. |
4558
3706975946e4
Make graph dumping a bit more robust when there is no method, enable debug in the startCompiler method, add context and scope for snippets installation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4479
diff
changeset
|
90 final HotSpotRuntime runtime = (HotSpotRuntime) compiler.getCompiler().runtime; |
4197
b765172082ac
Move HotSpotMethod* and HotSpotType* implementations into ri subpackage.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4171
diff
changeset
|
91 if (GraalOptions.Intrinsify) { |
4558
3706975946e4
Make graph dumping a bit more robust when there is no method, enable debug in the startCompiler method, add context and scope for snippets installation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4479
diff
changeset
|
92 Debug.scope("InstallSnippets", new DebugDumpScope("InstallSnippets"), new Runnable() { |
5134
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
93 |
4558
3706975946e4
Make graph dumping a bit more robust when there is no method, enable debug in the startCompiler method, add context and scope for snippets installation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4479
diff
changeset
|
94 @Override |
3706975946e4
Make graph dumping a bit more robust when there is no method, enable debug in the startCompiler method, add context and scope for snippets installation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4479
diff
changeset
|
95 public void run() { |
3706975946e4
Make graph dumping a bit more robust when there is no method, enable debug in the startCompiler method, add context and scope for snippets installation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4479
diff
changeset
|
96 VMToCompilerImpl.this.intrinsifyArrayCopy = new IntrinsifyArrayCopyPhase(runtime); |
5109
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5105
diff
changeset
|
97 GraalIntrinsics.installIntrinsics(runtime, runtime.getCompiler().getTarget()); |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5105
diff
changeset
|
98 Snippets.install(runtime, runtime.getCompiler().getTarget(), new SystemSnippets()); |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5105
diff
changeset
|
99 Snippets.install(runtime, runtime.getCompiler().getTarget(), new UnsafeSnippets()); |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5105
diff
changeset
|
100 Snippets.install(runtime, runtime.getCompiler().getTarget(), new ArrayCopySnippets()); |
4558
3706975946e4
Make graph dumping a bit more robust when there is no method, enable debug in the startCompiler method, add context and scope for snippets installation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4479
diff
changeset
|
101 } |
3706975946e4
Make graph dumping a bit more robust when there is no method, enable debug in the startCompiler method, add context and scope for snippets installation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4479
diff
changeset
|
102 }); |
3706975946e4
Make graph dumping a bit more robust when there is no method, enable debug in the startCompiler method, add context and scope for snippets installation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4479
diff
changeset
|
103 |
4197
b765172082ac
Move HotSpotMethod* and HotSpotType* implementations into ri subpackage.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4171
diff
changeset
|
104 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
105 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
106 // Create compilation queue. |
5134
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
107 compileQueue = new ThreadPoolExecutor(GraalOptions.Threads, GraalOptions.Threads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), CompilerThread.FACTORY); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
108 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
109 // Create queue status printing thread. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
110 if (GraalOptions.PrintQueue) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
111 Thread t = new Thread() { |
4406
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
112 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
113 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
114 public void run() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
115 while (true) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
116 TTY.println(compileQueue.toString()); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
117 try { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
118 Thread.sleep(1000); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
119 } catch (InterruptedException e) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
120 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
121 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
122 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
123 }; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
124 t.setDaemon(true); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
125 t.start(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
126 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
127 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
128 |
4313
79af35bd9fd7
Bootstrap with a syncrhonized method to avoid later deoptimization when the first real synchronized method is compiled.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4265
diff
changeset
|
129 /** |
4406
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
130 * This method is the first method compiled during bootstrapping. Put any code in there that warms up compiler paths |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
131 * that are otherwise no exercised during bootstrapping and lead to later deoptimization when application code is |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
132 * compiled. |
4313
79af35bd9fd7
Bootstrap with a syncrhonized method to avoid later deoptimization when the first real synchronized method is compiled.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4265
diff
changeset
|
133 */ |
79af35bd9fd7
Bootstrap with a syncrhonized method to avoid later deoptimization when the first real synchronized method is compiled.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4265
diff
changeset
|
134 @SuppressWarnings("unused") |
79af35bd9fd7
Bootstrap with a syncrhonized method to avoid later deoptimization when the first real synchronized method is compiled.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4265
diff
changeset
|
135 @Deprecated |
79af35bd9fd7
Bootstrap with a syncrhonized method to avoid later deoptimization when the first real synchronized method is compiled.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4265
diff
changeset
|
136 private synchronized void compileWarmup() { |
79af35bd9fd7
Bootstrap with a syncrhonized method to avoid later deoptimization when the first real synchronized method is compiled.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4265
diff
changeset
|
137 // Method is synchronized to exercise the synchronization code in the compiler. |
79af35bd9fd7
Bootstrap with a syncrhonized method to avoid later deoptimization when the first real synchronized method is compiled.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4265
diff
changeset
|
138 } |
79af35bd9fd7
Bootstrap with a syncrhonized method to avoid later deoptimization when the first real synchronized method is compiled.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4265
diff
changeset
|
139 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
140 public void bootstrap() throws Throwable { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
141 TTY.print("Bootstrapping Graal"); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
142 TTY.flush(); |
4168
0bc4815d2069
Start bootstrapping in compiler threads
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4142
diff
changeset
|
143 long startTime = System.currentTimeMillis(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
144 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
145 // Initialize compile queue with a selected set of methods. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
146 Class<Object> objectKlass = Object.class; |
4313
79af35bd9fd7
Bootstrap with a syncrhonized method to avoid later deoptimization when the first real synchronized method is compiled.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4265
diff
changeset
|
147 enqueue(getClass().getDeclaredMethod("compileWarmup")); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
148 enqueue(objectKlass.getDeclaredMethod("equals", Object.class)); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
149 enqueue(objectKlass.getDeclaredMethod("toString")); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
150 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
151 // Compile until the queue is empty. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
152 int z = 0; |
4313
79af35bd9fd7
Bootstrap with a syncrhonized method to avoid later deoptimization when the first real synchronized method is compiled.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4265
diff
changeset
|
153 while (compileQueue.getCompletedTaskCount() < Math.max(3, compileQueue.getTaskCount())) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
154 Thread.sleep(100); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
155 while (z < compileQueue.getCompletedTaskCount() / 100) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
156 ++z; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
157 TTY.print("."); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
158 TTY.flush(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
159 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
160 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
161 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
162 TTY.println(" in %d ms", System.currentTimeMillis() - startTime); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
163 System.gc(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
164 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
165 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
166 private void enqueue(Method m) throws Throwable { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
167 RiMethod riMethod = compiler.getRuntime().getRiMethod(m); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
168 assert !Modifier.isAbstract(((HotSpotMethodResolved) riMethod).accessFlags()) && !Modifier.isNative(((HotSpotMethodResolved) riMethod).accessFlags()) : riMethod; |
4168
0bc4815d2069
Start bootstrapping in compiler threads
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4142
diff
changeset
|
169 compileMethod((HotSpotMethodResolved) riMethod, 0, false); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
170 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
171 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
172 public void shutdownCompiler() throws Throwable { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
173 compileQueue.shutdown(); |
4406
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
174 |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
175 if (Debug.isEnabled()) { |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
176 List<DebugValueMap> topLevelMaps = DebugValueMap.getTopLevelMaps(); |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
177 List<DebugValue> debugValues = KeyRegistry.getDebugValues(); |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
178 if (debugValues.size() > 0) { |
4553
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
179 if (GraalOptions.SummarizeDebugValues) { |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
180 printSummary(topLevelMaps, debugValues); |
5134
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
181 } else if (GraalOptions.PerThreadDebugValues) { |
4553
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
182 for (DebugValueMap map : topLevelMaps) { |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
183 TTY.println("Showing the results for thread: " + map.getName()); |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
184 map.group(); |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
185 map.normalize(); |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
186 printMap(map, debugValues, 0); |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
187 } |
5134
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
188 } else { |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
189 DebugValueMap globalMap = new DebugValueMap("Global"); |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
190 for (DebugValueMap map : topLevelMaps) { |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
191 if (GraalOptions.SummarizePerPhase) { |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
192 flattenChildren(map, globalMap); |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
193 } else { |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
194 for (DebugValueMap child : map.getChildren()) { |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
195 globalMap.addChild(child); |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
196 } |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
197 } |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
198 } |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
199 if (!GraalOptions.SummarizePerPhase) { |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
200 globalMap.group(); |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
201 } |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
202 globalMap.normalize(); |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
203 printMap(globalMap, debugValues, 0); |
4406
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
204 } |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
205 } |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
206 } |
4563
b27666ff9bd6
added compilation time statistics to product mode
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4560
diff
changeset
|
207 } |
b27666ff9bd6
added compilation time statistics to product mode
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4560
diff
changeset
|
208 |
5134
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
209 private void flattenChildren(DebugValueMap map, DebugValueMap globalMap) { |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
210 globalMap.addChild(map); |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
211 for (DebugValueMap child : map.getChildren()) { |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
212 flattenChildren(child, globalMap); |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
213 } |
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
214 map.clearChildren(); |
4406
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
215 } |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
216 |
4553
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
217 private static void printSummary(List<DebugValueMap> topLevelMaps, List<DebugValue> debugValues) { |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
218 DebugValueMap result = new DebugValueMap("Summary"); |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
219 for (int i = debugValues.size() - 1; i >= 0; i--) { |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
220 DebugValue debugValue = debugValues.get(i); |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
221 int index = debugValue.getIndex(); |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
222 long total = collectTotal(topLevelMaps, index); |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
223 result.setCurrentValue(index, total); |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
224 } |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
225 printMap(result, debugValues, 0); |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
226 } |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
227 |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
228 private static long collectTotal(List<DebugValueMap> maps, int index) { |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
229 long total = 0; |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
230 for (int i = 0; i < maps.size(); i++) { |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
231 DebugValueMap map = maps.get(i); |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
232 // the top level accumulates some counters -> do not process the children if we find a value |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
233 long value = map.getCurrentValue(index); |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
234 if (value == 0) { |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
235 total += collectTotal(map.getChildren(), index); |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
236 } else { |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
237 total += value; |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
238 } |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
239 } |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
240 return total; |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
241 } |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
242 |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4479
diff
changeset
|
243 private static void printMap(DebugValueMap map, List<DebugValue> debugValues, int level) { |
4406
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
244 |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
245 printIndent(level); |
5134
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
246 TTY.println("%s", map.getName()); |
4406
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
247 for (DebugValue value : debugValues) { |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
248 long l = map.getCurrentValue(value.getIndex()); |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
249 if (l != 0) { |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
250 printIndent(level + 1); |
5134
4eb9895d9afe
Refactoring of the debug framework. Move compiler thread implementation to its own file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5061
diff
changeset
|
251 TTY.println(value.getName() + "=" + value.toString(l)); |
4406
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
252 } |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
253 } |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
254 |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
255 for (DebugValueMap child : map.getChildren()) { |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
256 printMap(child, debugValues, level + 1); |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
257 } |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
258 } |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
259 |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
260 private static void printIndent(int level) { |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
261 for (int i = 0; i < level; ++i) { |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
262 TTY.print(" "); |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
263 } |
961895157a38
Tentative implementation of Meter and Time.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4366
diff
changeset
|
264 TTY.print("|-> "); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
265 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
266 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
267 @Override |
5018
bf63d72879aa
fixed an issue that prevented java.util.concurrent methods from being compiled
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4563
diff
changeset
|
268 public boolean compileMethod(final HotSpotMethodResolved method, final int entryBCI, boolean blocking) throws Throwable { |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5134
diff
changeset
|
269 if (Thread.currentThread() instanceof CompilerThread) { |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5134
diff
changeset
|
270 if (method.holder().name().contains("java/util/concurrent")) { |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5134
diff
changeset
|
271 // This is required to avoid deadlocking a compiler thread. The issue is that a |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5134
diff
changeset
|
272 // java.util.concurrent.BlockingQueue is used to implement the compilation worker |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5134
diff
changeset
|
273 // queues. If a compiler thread triggers a compilation, then it may be blocked trying |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5134
diff
changeset
|
274 // to add something to its own queue. |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5134
diff
changeset
|
275 return false; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
276 } |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5134
diff
changeset
|
277 } |
4345
176d60b77d31
Moved PrintCompilation logic from graal.compiler to graal.hotspot. Made bootclasspath generated from the GRAAL environment option more generic (such that adding/removing a project requires no changes in the C++ part).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4220
diff
changeset
|
278 |
5138 | 279 final OptimisticOptimizations optimisticOpts = new OptimisticOptimizations(method); |
280 Runnable task = CompilationTask.create(compiler, createHotSpotSpecificPhasePlan(optimisticOpts), optimisticOpts, method); | |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5134
diff
changeset
|
281 if (blocking) { |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5134
diff
changeset
|
282 task.run(); |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5134
diff
changeset
|
283 } else { |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5134
diff
changeset
|
284 try { |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5134
diff
changeset
|
285 compileQueue.execute(task); |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5134
diff
changeset
|
286 } catch (RejectedExecutionException e) { |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5134
diff
changeset
|
287 // The compile queue was already shut down. |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5134
diff
changeset
|
288 return false; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
289 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
290 } |
5018
bf63d72879aa
fixed an issue that prevented java.util.concurrent methods from being compiled
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4563
diff
changeset
|
291 return true; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
292 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
293 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
294 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
295 public RiMethod createRiMethodUnresolved(String name, String signature, RiType holder) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
296 return new HotSpotMethodUnresolved(compiler, name, signature, holder); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
297 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
298 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
299 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
300 public RiSignature createRiSignature(String signature) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
301 return new HotSpotSignature(compiler, signature); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
302 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
303 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
304 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
305 public RiField createRiField(RiType holder, String name, RiType type, int offset, int flags) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
306 if (offset != -1) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
307 HotSpotTypeResolved resolved = (HotSpotTypeResolved) holder; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
308 return resolved.createRiField(name, type, offset, flags); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
309 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
310 return new BaseUnresolvedField(holder, name, type); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
311 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
312 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
313 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
314 public RiType createRiType(HotSpotConstantPool pool, String name) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
315 throw new RuntimeException("not implemented"); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
316 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
317 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
318 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
319 public RiType createRiTypePrimitive(int basicType) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
320 switch (basicType) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
321 case 4: |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
322 return typeBoolean; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
323 case 5: |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
324 return typeChar; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
325 case 6: |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
326 return typeFloat; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
327 case 7: |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
328 return typeDouble; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
329 case 8: |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
330 return typeByte; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
331 case 9: |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
332 return typeShort; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
333 case 10: |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
334 return typeInt; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
335 case 11: |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
336 return typeLong; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
337 case 14: |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
338 return typeVoid; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
339 default: |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
340 throw new IllegalArgumentException("Unknown basic type: " + basicType); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
341 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
342 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
343 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
344 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
345 public RiType createRiTypeUnresolved(String name) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
346 return new HotSpotTypeUnresolved(compiler, name); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
347 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
348 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
349 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
350 public CiConstant createCiConstant(CiKind kind, long value) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
351 if (kind == CiKind.Long) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
352 return CiConstant.forLong(value); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
353 } else if (kind == CiKind.Int) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
354 return CiConstant.forInt((int) value); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
355 } else if (kind == CiKind.Short) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
356 return CiConstant.forShort((short) value); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
357 } else if (kind == CiKind.Char) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
358 return CiConstant.forChar((char) value); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
359 } else if (kind == CiKind.Byte) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
360 return CiConstant.forByte((byte) value); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
361 } else if (kind == CiKind.Boolean) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
362 return (value == 0) ? CiConstant.FALSE : CiConstant.TRUE; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
363 } else { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
364 throw new IllegalArgumentException(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
365 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
366 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
367 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
368 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
369 public CiConstant createCiConstantFloat(float value) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
370 return CiConstant.forFloat(value); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
371 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
372 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
373 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
374 public CiConstant createCiConstantDouble(double value) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
375 return CiConstant.forDouble(value); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
376 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
377 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
378 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
379 public CiConstant createCiConstantObject(Object object) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
380 return CiConstant.forObject(object); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
381 } |
4420
97e0fb1f4906
Make Array copy intrinsifier active again, fix format string in canonicalizer
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4410
diff
changeset
|
382 |
5138 | 383 |
5114
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5109
diff
changeset
|
384 private PhasePlan createHotSpotSpecificPhasePlan(OptimisticOptimizations optimisticOpts) { |
4420
97e0fb1f4906
Make Array copy intrinsifier active again, fix format string in canonicalizer
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4410
diff
changeset
|
385 PhasePlan phasePlan = new PhasePlan(); |
5114
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5109
diff
changeset
|
386 GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(compiler.getRuntime(), GraphBuilderConfiguration.getDefault(), optimisticOpts); |
5109
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5105
diff
changeset
|
387 phasePlan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase); |
4463 | 388 if (GraalOptions.Intrinsify) { |
389 phasePlan.addPhase(PhasePosition.HIGH_LEVEL, intrinsifyArrayCopy); | |
390 } | |
4420
97e0fb1f4906
Make Array copy intrinsifier active again, fix format string in canonicalizer
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4410
diff
changeset
|
391 return phasePlan; |
97e0fb1f4906
Make Array copy intrinsifier active again, fix format string in canonicalizer
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4410
diff
changeset
|
392 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
393 } |