Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java @ 9914:84890660eefb
cleaner implementation of stable options
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 06 Jun 2013 17:29:08 +0200 |
parents | fbad7372eccd |
children | 44fcf49b746f |
rev | line source |
---|---|
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
4 * |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
8 * |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
14 * |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
18 * |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
21 * questions. |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
22 */ |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
23 package com.oracle.graal.hotspot; |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
9612
66db0353f55a
compilation is explicitly given a CallingConvention for the graph being compiled instead of deriving it from a method
Doug Simon <doug.simon@oracle.com>
parents:
9041
diff
changeset
|
25 import static com.oracle.graal.api.code.CodeUtil.*; |
8636
ac4dbfecec8f
passed a Replacements object to inlining utility methods that need one instead of the GraalRuntime API
Doug Simon <doug.simon@oracle.com>
parents:
8627
diff
changeset
|
26 import static com.oracle.graal.nodes.StructuredGraph.*; |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
27 import static com.oracle.graal.phases.GraalOptions.*; |
7361
b79ad92d5a26
compile the intrinsic graph for a method if the method is scheduled for compilation (in addition to intrinsifiying it when it is called)
Doug Simon <doug.simon@oracle.com>
parents:
6963
diff
changeset
|
28 |
9813
c010c12ab682
put disassembling of installed code under the control of Debug.log(); use -G:Log=CodeInstall to show disassembly for all installed code
Doug Simon <doug.simon@oracle.com>
parents:
9807
diff
changeset
|
29 import java.lang.reflect.*; |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
30 import java.util.concurrent.*; |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
31 |
5510
426c605c9d3c
Move cri.ci to api.code.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5507
diff
changeset
|
32 import com.oracle.graal.api.code.*; |
9813
c010c12ab682
put disassembling of installed code under the control of Debug.log(); use -G:Log=CodeInstall to show disassembly for all installed code
Doug Simon <doug.simon@oracle.com>
parents:
9807
diff
changeset
|
33 import com.oracle.graal.api.code.CallingConvention.Type; |
5507
dc71b06d09f8
Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5432
diff
changeset
|
34 import com.oracle.graal.api.meta.*; |
7837
46005f68fc6c
Make methods in GraalCompiler static.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7836
diff
changeset
|
35 import com.oracle.graal.compiler.*; |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
36 import com.oracle.graal.debug.*; |
7558
223f645acb9b
added compilation rate measurements on top of existing metric/timer facility - enabled with -Dgraal.benchmark.compilation=true
Doug Simon <doug.simon@oracle.com>
parents:
7552
diff
changeset
|
37 import com.oracle.graal.debug.internal.*; |
5548
8872bc0eebdf
Renaming hotspot.ri => hotspot.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
38 import com.oracle.graal.hotspot.meta.*; |
5138 | 39 import com.oracle.graal.nodes.*; |
8637
ce5750014c3d
moved Replacements and MacroSubstitution from the graal.api.replacements project to graal.nodes project and reversed the dependency between these two projects (the latter now/again depends on the former)
Doug Simon <doug.simon@oracle.com>
parents:
8636
diff
changeset
|
40 import com.oracle.graal.nodes.spi.*; |
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9813
diff
changeset
|
41 import com.oracle.graal.options.*; |
6525
2c913b643422
rename packages in graal.phases to match project name
Doug Simon <doug.simon@oracle.com>
parents:
6500
diff
changeset
|
42 import com.oracle.graal.phases.*; |
9699
9529ab567367
Drafted version of an inlining policy that uses the callee graph size as its metric.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9041
diff
changeset
|
43 import com.oracle.graal.phases.common.*; |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
44 |
5176
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
45 public final class CompilationTask implements Runnable, Comparable<CompilationTask> { |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
46 |
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9813
diff
changeset
|
47 //@formatter:off |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9813
diff
changeset
|
48 @Option(help = "") |
9914
84890660eefb
cleaner implementation of stable options
Doug Simon <doug.simon@oracle.com>
parents:
9912
diff
changeset
|
49 public static final OptionValue<Integer> SlowQueueCutoff = new OptionValue<>(100000); |
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9813
diff
changeset
|
50 //@formatter:on |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9813
diff
changeset
|
51 |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7382
diff
changeset
|
52 public static final ThreadLocal<Boolean> withinEnqueue = new ThreadLocal<Boolean>() { |
5183
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
53 |
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
54 @Override |
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
55 protected Boolean initialValue() { |
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
56 return Boolean.valueOf(Thread.currentThread() instanceof CompilerThread); |
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
57 } |
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
58 }; |
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
59 |
5176
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
60 private volatile boolean cancelled; |
6721
98d691bc23da
make osr compilations asynchronous
Lukas Stadler <lukas.stadler@jku.at>
parents:
6684
diff
changeset
|
61 private volatile boolean inProgress; |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
62 |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5719
diff
changeset
|
63 private final HotSpotGraalRuntime graalRuntime; |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
64 private final PhasePlan plan; |
6677
3dddb311395f
hotspot infrastructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6676
diff
changeset
|
65 private final OptimisticOptimizations optimisticOpts; |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5548
diff
changeset
|
66 private final HotSpotResolvedJavaMethod method; |
6677
3dddb311395f
hotspot infrastructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6676
diff
changeset
|
67 private final int entryBCI; |
5176
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
68 private final int id; |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
69 private final int priority; |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
70 |
9813
c010c12ab682
put disassembling of installed code under the control of Debug.log(); use -G:Log=CodeInstall to show disassembly for all installed code
Doug Simon <doug.simon@oracle.com>
parents:
9807
diff
changeset
|
71 private StructuredGraph graph; |
c010c12ab682
put disassembling of installed code under the control of Debug.log(); use -G:Log=CodeInstall to show disassembly for all installed code
Doug Simon <doug.simon@oracle.com>
parents:
9807
diff
changeset
|
72 |
6721
98d691bc23da
make osr compilations asynchronous
Lukas Stadler <lukas.stadler@jku.at>
parents:
6684
diff
changeset
|
73 public static CompilationTask create(HotSpotGraalRuntime graalRuntime, PhasePlan plan, OptimisticOptimizations optimisticOpts, HotSpotResolvedJavaMethod method, int entryBCI, int id, int priority) { |
98d691bc23da
make osr compilations asynchronous
Lukas Stadler <lukas.stadler@jku.at>
parents:
6684
diff
changeset
|
74 return new CompilationTask(graalRuntime, plan, optimisticOpts, method, entryBCI, id, priority); |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
75 } |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
76 |
6721
98d691bc23da
make osr compilations asynchronous
Lukas Stadler <lukas.stadler@jku.at>
parents:
6684
diff
changeset
|
77 private CompilationTask(HotSpotGraalRuntime graalRuntime, PhasePlan plan, OptimisticOptimizations optimisticOpts, HotSpotResolvedJavaMethod method, int entryBCI, int id, int priority) { |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5719
diff
changeset
|
78 this.graalRuntime = graalRuntime; |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
79 this.plan = plan; |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
80 this.method = method; |
5138 | 81 this.optimisticOpts = optimisticOpts; |
6677
3dddb311395f
hotspot infrastructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6676
diff
changeset
|
82 this.entryBCI = entryBCI; |
5176
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
83 this.id = id; |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
84 this.priority = priority; |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
85 } |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
86 |
6721
98d691bc23da
make osr compilations asynchronous
Lukas Stadler <lukas.stadler@jku.at>
parents:
6684
diff
changeset
|
87 public ResolvedJavaMethod getMethod() { |
5176
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
88 return method; |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
89 } |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
90 |
6721
98d691bc23da
make osr compilations asynchronous
Lukas Stadler <lukas.stadler@jku.at>
parents:
6684
diff
changeset
|
91 public int getPriority() { |
5176
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
92 return priority; |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
93 } |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
94 |
5176
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
95 public void cancel() { |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
96 cancelled = true; |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
97 } |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
98 |
6721
98d691bc23da
make osr compilations asynchronous
Lukas Stadler <lukas.stadler@jku.at>
parents:
6684
diff
changeset
|
99 public boolean isInProgress() { |
98d691bc23da
make osr compilations asynchronous
Lukas Stadler <lukas.stadler@jku.at>
parents:
6684
diff
changeset
|
100 return inProgress; |
98d691bc23da
make osr compilations asynchronous
Lukas Stadler <lukas.stadler@jku.at>
parents:
6684
diff
changeset
|
101 } |
98d691bc23da
make osr compilations asynchronous
Lukas Stadler <lukas.stadler@jku.at>
parents:
6684
diff
changeset
|
102 |
8525
54f0a88e4523
Be a little bit more careful around compilation task queuing
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8508
diff
changeset
|
103 public boolean isCancelled() { |
54f0a88e4523
Be a little bit more careful around compilation task queuing
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8508
diff
changeset
|
104 return cancelled; |
54f0a88e4523
Be a little bit more careful around compilation task queuing
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8508
diff
changeset
|
105 } |
54f0a88e4523
Be a little bit more careful around compilation task queuing
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8508
diff
changeset
|
106 |
6721
98d691bc23da
make osr compilations asynchronous
Lukas Stadler <lukas.stadler@jku.at>
parents:
6684
diff
changeset
|
107 public int getEntryBCI() { |
98d691bc23da
make osr compilations asynchronous
Lukas Stadler <lukas.stadler@jku.at>
parents:
6684
diff
changeset
|
108 return entryBCI; |
98d691bc23da
make osr compilations asynchronous
Lukas Stadler <lukas.stadler@jku.at>
parents:
6684
diff
changeset
|
109 } |
98d691bc23da
make osr compilations asynchronous
Lukas Stadler <lukas.stadler@jku.at>
parents:
6684
diff
changeset
|
110 |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
111 public void run() { |
5183
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
112 withinEnqueue.set(Boolean.FALSE); |
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
113 try { |
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
114 if (cancelled) { |
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
115 return; |
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
116 } |
6721
98d691bc23da
make osr compilations asynchronous
Lukas Stadler <lukas.stadler@jku.at>
parents:
6684
diff
changeset
|
117 inProgress = true; |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
118 if (DynamicCompilePriority.getValue()) { |
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9813
diff
changeset
|
119 int threadPriority = priority < SlowQueueCutoff.getValue() ? Thread.NORM_PRIORITY : Thread.MIN_PRIORITY; |
5183
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
120 if (Thread.currentThread().getPriority() != threadPriority) { |
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
121 Thread.currentThread().setPriority(threadPriority); |
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
122 } |
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
123 } |
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
124 runCompilation(); |
8525
54f0a88e4523
Be a little bit more careful around compilation task queuing
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8508
diff
changeset
|
125 } finally { |
54f0a88e4523
Be a little bit more careful around compilation task queuing
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8508
diff
changeset
|
126 if (method.currentTask() == this) { |
5183
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
127 method.setCurrentTask(null); |
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
128 } |
8527
8a526d8b4604
Always clear 'queued for compilation' flag at the end of a compilation task
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8525
diff
changeset
|
129 graalRuntime.getCompilerToVM().clearQueuedForCompilation(method); |
6721
98d691bc23da
make osr compilations asynchronous
Lukas Stadler <lukas.stadler@jku.at>
parents:
6684
diff
changeset
|
130 inProgress = false; |
5183
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
131 withinEnqueue.set(Boolean.TRUE); |
5176
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
132 } |
5183
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
133 } |
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
134 |
7558
223f645acb9b
added compilation rate measurements on top of existing metric/timer facility - enabled with -Dgraal.benchmark.compilation=true
Doug Simon <doug.simon@oracle.com>
parents:
7552
diff
changeset
|
135 /** |
223f645acb9b
added compilation rate measurements on top of existing metric/timer facility - enabled with -Dgraal.benchmark.compilation=true
Doug Simon <doug.simon@oracle.com>
parents:
7552
diff
changeset
|
136 * Time spent in compilation. |
223f645acb9b
added compilation rate measurements on top of existing metric/timer facility - enabled with -Dgraal.benchmark.compilation=true
Doug Simon <doug.simon@oracle.com>
parents:
7552
diff
changeset
|
137 */ |
223f645acb9b
added compilation rate measurements on top of existing metric/timer facility - enabled with -Dgraal.benchmark.compilation=true
Doug Simon <doug.simon@oracle.com>
parents:
7552
diff
changeset
|
138 public static final DebugTimer CompilationTime = Debug.timer("CompilationTime"); |
223f645acb9b
added compilation rate measurements on top of existing metric/timer facility - enabled with -Dgraal.benchmark.compilation=true
Doug Simon <doug.simon@oracle.com>
parents:
7552
diff
changeset
|
139 |
5183
e1e681a5558e
fix PriorityQueue, enable PriorityQueue and CacheGraphs
Lukas Stadler <lukas.stadler@jku.at>
parents:
5177
diff
changeset
|
140 public void runCompilation() { |
7549
5512fae3683b
added memory usage to CompilationStatistics
Doug Simon <doug.simon@oracle.com>
parents:
7382
diff
changeset
|
141 CompilationStatistics stats = CompilationStatistics.create(method, entryBCI != StructuredGraph.INVOCATION_ENTRY_BCI); |
7558
223f645acb9b
added compilation rate measurements on top of existing metric/timer facility - enabled with -Dgraal.benchmark.compilation=true
Doug Simon <doug.simon@oracle.com>
parents:
7552
diff
changeset
|
142 try (TimerCloseable a = CompilationTime.start()) { |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
143 final boolean printCompilation = PrintCompilation.getValue() && !TTY.isSuppressed(); |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
144 if (printCompilation) { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7382
diff
changeset
|
145 TTY.println(String.format("%-6d Graal %-70s %-45s %-50s %s...", id, method.getDeclaringClass().getName(), method.getName(), method.getSignature(), |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7382
diff
changeset
|
146 entryBCI == StructuredGraph.INVOCATION_ENTRY_BCI ? "" : "(OSR@" + entryBCI + ") ")); |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
147 } |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
148 if (HotSpotPrintCompilation.getValue()) { |
8996
6d86ce1297bc
GRAAL-213: add HotSpot-style PrintCompilation and PrintInlining
twisti
parents:
8637
diff
changeset
|
149 printCompilation(); |
6d86ce1297bc
GRAAL-213: add HotSpot-style PrintCompilation and PrintInlining
twisti
parents:
8637
diff
changeset
|
150 } |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
151 |
5546
e42c0df7212a
Rename CiTargetMethod => CompilationResult.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5541
diff
changeset
|
152 CompilationResult result = null; |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
153 TTY.Filter filter = new TTY.Filter(PrintFilter.getValue(), method); |
6684
28a158024338
Add OSR marker in -G:+PrintCompilation output
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6679
diff
changeset
|
154 long start = System.currentTimeMillis(); |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
155 try { |
5546
e42c0df7212a
Rename CiTargetMethod => CompilationResult.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5541
diff
changeset
|
156 result = Debug.scope("Compiling", new DebugDumpScope(String.valueOf(id), true), new Callable<CompilationResult>() { |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
157 |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
158 @Override |
5546
e42c0df7212a
Rename CiTargetMethod => CompilationResult.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5541
diff
changeset
|
159 public CompilationResult call() throws Exception { |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5719
diff
changeset
|
160 graalRuntime.evictDeoptedGraphs(); |
8636
ac4dbfecec8f
passed a Replacements object to inlining utility methods that need one instead of the GraalRuntime API
Doug Simon <doug.simon@oracle.com>
parents:
8627
diff
changeset
|
161 Replacements replacements = graalRuntime.getReplacements(); |
9813
c010c12ab682
put disassembling of installed code under the control of Debug.log(); use -G:Log=CodeInstall to show disassembly for all installed code
Doug Simon <doug.simon@oracle.com>
parents:
9807
diff
changeset
|
162 graph = replacements.getMethodSubstitution(method); |
7361
b79ad92d5a26
compile the intrinsic graph for a method if the method is scheduled for compilation (in addition to intrinsifiying it when it is called)
Doug Simon <doug.simon@oracle.com>
parents:
6963
diff
changeset
|
163 if (graph == null || entryBCI != INVOCATION_ENTRY_BCI) { |
b79ad92d5a26
compile the intrinsic graph for a method if the method is scheduled for compilation (in addition to intrinsifiying it when it is called)
Doug Simon <doug.simon@oracle.com>
parents:
6963
diff
changeset
|
164 graph = new StructuredGraph(method, entryBCI); |
b79ad92d5a26
compile the intrinsic graph for a method if the method is scheduled for compilation (in addition to intrinsifiying it when it is called)
Doug Simon <doug.simon@oracle.com>
parents:
6963
diff
changeset
|
165 } else { |
8411 | 166 // Compiling method substitution - must clone the graph |
7377
53d5f5fc4dd9
an intrinsic graph must be cloned before being compiled
Doug Simon <doug.simon@oracle.com>
parents:
7361
diff
changeset
|
167 graph = graph.copy(); |
7361
b79ad92d5a26
compile the intrinsic graph for a method if the method is scheduled for compilation (in addition to intrinsifiying it when it is called)
Doug Simon <doug.simon@oracle.com>
parents:
6963
diff
changeset
|
168 } |
9699
9529ab567367
Drafted version of an inlining policy that uses the callee graph size as its metric.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9041
diff
changeset
|
169 InliningUtil.InlinedBytecodes.add(method.getCodeSize()); |
9612
66db0353f55a
compilation is explicitly given a CallingConvention for the graph being compiled instead of deriving it from a method
Doug Simon <doug.simon@oracle.com>
parents:
9041
diff
changeset
|
170 HotSpotRuntime runtime = graalRuntime.getRuntime(); |
66db0353f55a
compilation is explicitly given a CallingConvention for the graph being compiled instead of deriving it from a method
Doug Simon <doug.simon@oracle.com>
parents:
9041
diff
changeset
|
171 CallingConvention cc = getCallingConvention(runtime, Type.JavaCallee, graph.method(), false); |
9621
e97dc9bbfedc
introduced installedCodeOwner parameter of type ResolvedJavaMethod to GraalCompiler.compileGraph to properly distinguish the source method of a graph from the method under which the code compiled for the graph will be installed
Doug Simon <doug.simon@oracle.com>
parents:
9615
diff
changeset
|
172 return GraalCompiler.compileGraph(graph, cc, method, runtime, replacements, graalRuntime.getBackend(), graalRuntime.getTarget(), graalRuntime.getCache(), plan, optimisticOpts, |
9615
1089d63ef168
removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents:
9612
diff
changeset
|
173 method.getSpeculationLog()); |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
174 } |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
175 }); |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
176 } finally { |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
177 filter.remove(); |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
178 if (printCompilation) { |
6684
28a158024338
Add OSR marker in -G:+PrintCompilation output
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6679
diff
changeset
|
179 TTY.println(String.format("%-6d Graal %-70s %-45s %-50s | %4dms %5dB", id, "", "", "", System.currentTimeMillis() - start, (result != null ? result.getTargetCodeSize() : -1))); |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
180 } |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
181 } |
5275
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5226
diff
changeset
|
182 |
9813
c010c12ab682
put disassembling of installed code under the control of Debug.log(); use -G:Log=CodeInstall to show disassembly for all installed code
Doug Simon <doug.simon@oracle.com>
parents:
9807
diff
changeset
|
183 installMethod(result); |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5546
diff
changeset
|
184 } catch (BailoutException bailout) { |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
185 Debug.metric("Bailouts").increment(); |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
186 if (ExitVMOnBailout.getValue()) { |
5719
429accae15aa
moved some methods from CodeUtil to MetaUtil
Doug Simon <doug.simon@oracle.com>
parents:
5603
diff
changeset
|
187 TTY.cachedOut.println(MetaUtil.format("Bailout in %H.%n(%p)", method)); |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
188 bailout.printStackTrace(TTY.cachedOut); |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
189 System.exit(-1); |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
190 } else if (PrintBailout.getValue()) { |
5719
429accae15aa
moved some methods from CodeUtil to MetaUtil
Doug Simon <doug.simon@oracle.com>
parents:
5603
diff
changeset
|
191 TTY.cachedOut.println(MetaUtil.format("Bailout in %H.%n(%p)", method)); |
5201
891399c54706
Add a PrintBailout option
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5188
diff
changeset
|
192 bailout.printStackTrace(TTY.cachedOut); |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
193 } |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
194 } catch (Throwable t) { |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
195 if (PrintStackTraceOnException.getValue() || ExitVMOnException.getValue()) { |
9802
9dcd6f8a843b
CompileTask: add option to print exception on compile error
Bernhard Urban <bernhard.urban@jku.at>
parents:
9790
diff
changeset
|
196 t.printStackTrace(TTY.cachedOut); |
9dcd6f8a843b
CompileTask: add option to print exception on compile error
Bernhard Urban <bernhard.urban@jku.at>
parents:
9790
diff
changeset
|
197 } |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
198 if (ExitVMOnException.getValue()) { |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
199 System.exit(-1); |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
200 } |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
201 } |
5176
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
202 stats.finish(method); |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
203 } |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
204 |
8996
6d86ce1297bc
GRAAL-213: add HotSpot-style PrintCompilation and PrintInlining
twisti
parents:
8637
diff
changeset
|
205 /** |
6d86ce1297bc
GRAAL-213: add HotSpot-style PrintCompilation and PrintInlining
twisti
parents:
8637
diff
changeset
|
206 * Print a HotSpot-style compilation message to the console. |
6d86ce1297bc
GRAAL-213: add HotSpot-style PrintCompilation and PrintInlining
twisti
parents:
8637
diff
changeset
|
207 */ |
6d86ce1297bc
GRAAL-213: add HotSpot-style PrintCompilation and PrintInlining
twisti
parents:
8637
diff
changeset
|
208 private void printCompilation() { |
6d86ce1297bc
GRAAL-213: add HotSpot-style PrintCompilation and PrintInlining
twisti
parents:
8637
diff
changeset
|
209 final boolean isOSR = entryBCI != StructuredGraph.INVOCATION_ENTRY_BCI; |
6d86ce1297bc
GRAAL-213: add HotSpot-style PrintCompilation and PrintInlining
twisti
parents:
8637
diff
changeset
|
210 final int mod = method.getModifiers(); |
6d86ce1297bc
GRAAL-213: add HotSpot-style PrintCompilation and PrintInlining
twisti
parents:
8637
diff
changeset
|
211 TTY.println(String.format("%7d %4d %c%c%c%c%c %s %s(%d bytes)", 0, id, isOSR ? '%' : ' ', Modifier.isSynchronized(mod) ? 's' : ' ', ' ', ' ', Modifier.isNative(mod) ? 'n' : ' ', |
6d86ce1297bc
GRAAL-213: add HotSpot-style PrintCompilation and PrintInlining
twisti
parents:
8637
diff
changeset
|
212 MetaUtil.format("%H::%n(%p)", method), isOSR ? "@ " + entryBCI + " " : "", method.getCodeSize())); |
6d86ce1297bc
GRAAL-213: add HotSpot-style PrintCompilation and PrintInlining
twisti
parents:
8637
diff
changeset
|
213 } |
6d86ce1297bc
GRAAL-213: add HotSpot-style PrintCompilation and PrintInlining
twisti
parents:
8637
diff
changeset
|
214 |
9813
c010c12ab682
put disassembling of installed code under the control of Debug.log(); use -G:Log=CodeInstall to show disassembly for all installed code
Doug Simon <doug.simon@oracle.com>
parents:
9807
diff
changeset
|
215 private void installMethod(final CompilationResult compResult) { |
8150
b66f831ac5ab
Fix CFG printer output. Clean up after making the compiler class all-static.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7837
diff
changeset
|
216 Debug.scope("CodeInstall", new Object[]{new DebugDumpScope(String.valueOf(id), true), graalRuntime.getRuntime(), method}, new Runnable() { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7382
diff
changeset
|
217 |
5275
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5226
diff
changeset
|
218 @Override |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5226
diff
changeset
|
219 public void run() { |
9041 | 220 HotSpotInstalledCode installedCode = graalRuntime.getRuntime().installMethod(method, graph, entryBCI, compResult); |
8349
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8217
diff
changeset
|
221 if (Debug.isDumpEnabled()) { |
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8217
diff
changeset
|
222 Debug.dump(new Object[]{compResult, installedCode}, "After code installation"); |
5275
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5226
diff
changeset
|
223 } |
9813
c010c12ab682
put disassembling of installed code under the control of Debug.log(); use -G:Log=CodeInstall to show disassembly for all installed code
Doug Simon <doug.simon@oracle.com>
parents:
9807
diff
changeset
|
224 if (Debug.isLogEnabled()) { |
c010c12ab682
put disassembling of installed code under the control of Debug.log(); use -G:Log=CodeInstall to show disassembly for all installed code
Doug Simon <doug.simon@oracle.com>
parents:
9807
diff
changeset
|
225 Debug.log("%s", graalRuntime.getRuntime().disassemble(installedCode)); |
c010c12ab682
put disassembling of installed code under the control of Debug.log(); use -G:Log=CodeInstall to show disassembly for all installed code
Doug Simon <doug.simon@oracle.com>
parents:
9807
diff
changeset
|
226 } |
5275
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5226
diff
changeset
|
227 } |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5226
diff
changeset
|
228 |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5226
diff
changeset
|
229 }); |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5226
diff
changeset
|
230 } |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5226
diff
changeset
|
231 |
5176
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
232 @Override |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
233 public int compareTo(CompilationTask o) { |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
234 if (priority < o.priority) { |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
235 return -1; |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
236 } |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
237 if (priority > o.priority) { |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
238 return 1; |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
239 } |
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5138
diff
changeset
|
240 return id < o.id ? -1 : (id > o.id ? 1 : 0); |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
241 } |
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
242 |
7382
31d1cc9219d8
gave CompilationTask a toString() method
Doug Simon <doug.simon@oracle.com>
parents:
7377
diff
changeset
|
243 @Override |
31d1cc9219d8
gave CompilationTask a toString() method
Doug Simon <doug.simon@oracle.com>
parents:
7377
diff
changeset
|
244 public String toString() { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7382
diff
changeset
|
245 return "Compilation[id=" + id + ", prio=" + priority + " " + MetaUtil.format("%H.%n(%p)", method) + (entryBCI == StructuredGraph.INVOCATION_ENTRY_BCI ? "" : "@" + entryBCI) + "]"; |
7382
31d1cc9219d8
gave CompilationTask a toString() method
Doug Simon <doug.simon@oracle.com>
parents:
7377
diff
changeset
|
246 } |
5136
8f4f0ebffca2
Move compilation task logic to separate class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
247 } |