Mercurial > hg > truffle
annotate src/share/vm/graal/graalCompiler.cpp @ 5176:af59b4dfc9e4
compilation queue changes:
* new CiCompilationStatistics
* added new HotSpot compilation policy (-XX:CompilationPolicyChoice=4)
* compile queue prioritizing (-G:+PriorityCompileQueue)
* low-priority compilation threads (-G:+SlowCompileThreads)
* dynamic compilation thread priority adjustment (-G:+DynamicCompilePriority)
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Thu, 29 Mar 2012 18:43:30 +0200 |
parents | 482265e41a1a |
children | af07e798947d |
rev | line source |
---|---|
2516
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
1 /* |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
4 * |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
7 * published by the Free Software Foundation. |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
8 * |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
13 * accompanied this code). |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
14 * |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
18 * |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
21 * questions. |
1410
b30a2cd5e3a2
Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1407
diff
changeset
|
22 */ |
b30a2cd5e3a2
Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1407
diff
changeset
|
23 |
2045
9c96c873c42b
Fix includes to match new hotspot mechanism.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1942
diff
changeset
|
24 #include "precompiled.hpp" |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
25 #include "graal/graalCompiler.hpp" |
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
26 #include "graal/graalJavaAccess.hpp" |
4221
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
27 #include "graal/graalVMToCompiler.hpp" |
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
28 #include "graal/graalCompilerToVM.hpp" |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
29 #include "graal/graalVmIds.hpp" |
3637
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
30 #include "graal/graalEnv.hpp" |
2045
9c96c873c42b
Fix includes to match new hotspot mechanism.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1942
diff
changeset
|
31 #include "c1/c1_Runtime1.hpp" |
4463 | 32 #include "compiler/compilerOracle.hpp" |
2663
d7c0775d7e72
added includes to build without precompiled headers
Christian.Wimmer@Oracle.com
parents:
2516
diff
changeset
|
33 #include "runtime/arguments.hpp" |
5150
fdd9dd4508fa
some GC fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5130
diff
changeset
|
34 #include "runtime/compilationPolicy.hpp" |
1406
35069ca331f2
Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff
changeset
|
35 |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
36 GraalCompiler* GraalCompiler::_instance = NULL; |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
37 |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
38 GraalCompiler::GraalCompiler() { |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
39 _initialized = false; |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
40 assert(_instance == NULL, "only one instance allowed"); |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
41 _instance = this; |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
42 } |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
43 |
1406
35069ca331f2
Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff
changeset
|
44 // Initialization |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
45 void GraalCompiler::initialize() { |
3650
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
46 |
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
47 ThreadToNativeFromVM trans(JavaThread::current()); |
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
48 JavaThread* THREAD = JavaThread::current(); |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
49 TRACE_graal_1("GraalCompiler::initialize"); |
1412
9195b99c841b
Added first VM entry method.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1410
diff
changeset
|
50 |
5129
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
51 _deopted_leaf_graph_count = 0; |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
52 |
1931
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1483
diff
changeset
|
53 initialize_buffer_blob(); |
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1483
diff
changeset
|
54 Runtime1::initialize(THREAD->get_buffer_blob()); |
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1483
diff
changeset
|
55 |
1432
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
56 JNIEnv *env = ((JavaThread *) Thread::current())->jni_environment(); |
5062
5e9f38419819
Adjust C++ part according to the renaming.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5056
diff
changeset
|
57 jclass klass = env->FindClass("com/oracle/graal/hotspot/bridge/CompilerToVMImpl"); |
1483
ba37b9335e1e
New option "-graal" that sets up the correct boot class path and C1X options using only the two environment variables MAXINE and GRAAL.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1476
diff
changeset
|
58 if (klass == NULL) { |
4221
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
59 tty->print_cr("graal CompilerToVMImpl class not found"); |
2674
6ab73784566a
* BlockBegin.predecessors changed to List<BlockEnd>
Lukas Stadler <lukas.stadler@jku.at>
parents:
2663
diff
changeset
|
60 vm_abort(false); |
1483
ba37b9335e1e
New option "-graal" that sets up the correct boot class path and C1X options using only the two environment variables MAXINE and GRAAL.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1476
diff
changeset
|
61 } |
4221
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
62 env->RegisterNatives(klass, CompilerToVM_methods, CompilerToVM_methods_count()); |
1432
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
63 |
3650
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
64 ResourceMark rm; |
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
65 HandleMark hm; |
1452
9b22e3e5df8e
Solved an issue with unresolved field patching.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1449
diff
changeset
|
66 { |
9b22e3e5df8e
Solved an issue with unresolved field patching.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1449
diff
changeset
|
67 VM_ENTRY_MARK; |
9b22e3e5df8e
Solved an issue with unresolved field patching.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1449
diff
changeset
|
68 check_pending_exception("Could not register natives"); |
9b22e3e5df8e
Solved an issue with unresolved field patching.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1449
diff
changeset
|
69 } |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1422
diff
changeset
|
70 |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
71 graal_compute_offsets(); |
1437
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1434
diff
changeset
|
72 |
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1434
diff
changeset
|
73 { |
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1434
diff
changeset
|
74 VM_ENTRY_MARK; |
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1434
diff
changeset
|
75 HandleMark hm; |
4221
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
76 VMToCompiler::initializeCompiler(); |
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
77 VMToCompiler::setDefaultOptions(); |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
78 for (int i = 0; i < Arguments::num_graal_args(); ++i) { |
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
79 const char* arg = Arguments::graal_args_array()[i]; |
1437
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1434
diff
changeset
|
80 Handle option = java_lang_String::create_from_str(arg, THREAD); |
4221
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
81 jboolean result = VMToCompiler::setOption(option); |
2674
6ab73784566a
* BlockBegin.predecessors changed to List<BlockEnd>
Lukas Stadler <lukas.stadler@jku.at>
parents:
2663
diff
changeset
|
82 if (!result) { |
5156
482265e41a1a
added -G:+PrintFlags flag for printing the Graal flags; tightened format checking of Graal options to be consistent with HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
5150
diff
changeset
|
83 tty->print_cr("Invalid option for graal: -G:%s", arg); |
2674
6ab73784566a
* BlockBegin.predecessors changed to List<BlockEnd>
Lukas Stadler <lukas.stadler@jku.at>
parents:
2663
diff
changeset
|
84 vm_abort(false); |
6ab73784566a
* BlockBegin.predecessors changed to List<BlockEnd>
Lukas Stadler <lukas.stadler@jku.at>
parents:
2663
diff
changeset
|
85 } |
1437
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1434
diff
changeset
|
86 } |
3694
221133c5ed6c
Don't call startCompiler if the VM is run with -Xint
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3653
diff
changeset
|
87 if (UseCompiler) { |
4221
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
88 VMToCompiler::startCompiler(); |
3694
221133c5ed6c
Don't call startCompiler if the VM is run with -Xint
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3653
diff
changeset
|
89 _initialized = true; |
221133c5ed6c
Don't call startCompiler if the VM is run with -Xint
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3653
diff
changeset
|
90 if (BootstrapGraal) { |
4221
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
91 VMToCompiler::bootstrap(); |
3694
221133c5ed6c
Don't call startCompiler if the VM is run with -Xint
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3653
diff
changeset
|
92 } |
3651
a31028282e3e
Support blocking compilation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
93 } |
1437
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1434
diff
changeset
|
94 } |
1406
35069ca331f2
Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff
changeset
|
95 } |
35069ca331f2
Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff
changeset
|
96 |
5129
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
97 void GraalCompiler::deopt_leaf_graph(jlong leaf_graph_id) { |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
98 assert(leaf_graph_id != -1, "unexpected leaf graph id"); |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
99 |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
100 if (_deopted_leaf_graph_count < LEAF_GRAPH_ARRAY_SIZE) { |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
101 MutexLockerEx y(GraalDeoptLeafGraphIds_lock, Mutex::_no_safepoint_check_flag); |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
102 if (_deopted_leaf_graph_count < LEAF_GRAPH_ARRAY_SIZE) { |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
103 _deopted_leaf_graphs[_deopted_leaf_graph_count++] = leaf_graph_id; |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
104 } |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
105 } |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
106 } |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
107 |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
108 oop GraalCompiler::dump_deopted_leaf_graphs(TRAPS) { |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
109 if (_deopted_leaf_graph_count == 0) { |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
110 return NULL; |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
111 } |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
112 jlong* elements; |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
113 int length; |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
114 { |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
115 MutexLockerEx y(GraalDeoptLeafGraphIds_lock, Mutex::_no_safepoint_check_flag); |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
116 if (_deopted_leaf_graph_count == 0) { |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
117 return NULL; |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
118 } |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
119 if (_deopted_leaf_graph_count == LEAF_GRAPH_ARRAY_SIZE) { |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
120 length = 0; |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
121 } else { |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
122 length = _deopted_leaf_graph_count; |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
123 } |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
124 elements = new jlong[length]; |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
125 for (int i = 0; i < length; i++) { |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
126 elements[i] = _deopted_leaf_graphs[i]; |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
127 } |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
128 _deopted_leaf_graph_count = 0; |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
129 } |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
130 typeArrayOop array = oopFactory::new_longArray(length, CHECK_NULL); |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
131 for (int i = 0; i < length; i++) { |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
132 array->long_at_put(i, elements[i]); |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
133 } |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
134 delete elements; |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
135 return array; |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
136 } |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
137 |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
138 void GraalCompiler::initialize_buffer_blob() { |
1931
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1483
diff
changeset
|
139 |
3555
22d11b3bc561
Various hacks to be able to install machine code from a Java thread.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
3090
diff
changeset
|
140 JavaThread* THREAD = JavaThread::current(); |
1931
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1483
diff
changeset
|
141 if (THREAD->get_buffer_blob() == NULL) { |
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1483
diff
changeset
|
142 // setup CodeBuffer. Preallocate a BufferBlob of size |
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1483
diff
changeset
|
143 // NMethodSizeLimit plus some extra space for constants. |
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1483
diff
changeset
|
144 int code_buffer_size = Compilation::desired_max_code_buffer_size() + |
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1483
diff
changeset
|
145 Compilation::desired_max_constant_size(); |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
146 BufferBlob* blob = BufferBlob::create("graal temporary CodeBuffer", |
1931
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1483
diff
changeset
|
147 code_buffer_size); |
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1483
diff
changeset
|
148 guarantee(blob != NULL, "must create code buffer"); |
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1483
diff
changeset
|
149 THREAD->set_buffer_blob(blob); |
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1483
diff
changeset
|
150 } |
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1483
diff
changeset
|
151 } |
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1483
diff
changeset
|
152 |
3651
a31028282e3e
Support blocking compilation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
153 void GraalCompiler::compile_method(methodHandle method, int entry_bci, jboolean blocking) { |
3650
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
154 EXCEPTION_CONTEXT |
3651
a31028282e3e
Support blocking compilation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
155 if (!_initialized) { |
a31028282e3e
Support blocking compilation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
156 method->clear_queued_for_compilation(); |
a31028282e3e
Support blocking compilation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
157 method->invocation_counter()->reset(); |
a31028282e3e
Support blocking compilation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
158 method->backedge_counter()->reset(); |
a31028282e3e
Support blocking compilation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
159 return; |
a31028282e3e
Support blocking compilation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
160 } |
3650
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
161 assert(_initialized, "must already be initialized"); |
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
162 ResourceMark rm; |
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
163 ciEnv* current_env = JavaThread::current()->env(); |
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
164 JavaThread::current()->set_env(NULL); |
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
165 JavaThread::current()->set_compiling(true); |
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
166 Handle hotspot_method = GraalCompiler::createHotSpotMethodResolved(method, CHECK); |
5176
af59b4dfc9e4
compilation queue changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5156
diff
changeset
|
167 jboolean success = VMToCompiler::compileMethod(hotspot_method, entry_bci, blocking, method->graal_priority()); |
3650
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
168 JavaThread::current()->set_compiling(false); |
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
169 JavaThread::current()->set_env(current_env); |
5018
bf63d72879aa
fixed an issue that prevented java.util.concurrent methods from being compiled
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5003
diff
changeset
|
170 if (success != JNI_TRUE) { |
bf63d72879aa
fixed an issue that prevented java.util.concurrent methods from being compiled
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5003
diff
changeset
|
171 method->clear_queued_for_compilation(); |
5150
fdd9dd4508fa
some GC fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5130
diff
changeset
|
172 CompilationPolicy::policy()->delay_compilation(method()); |
5018
bf63d72879aa
fixed an issue that prevented java.util.concurrent methods from being compiled
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5003
diff
changeset
|
173 } |
3650
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
174 } |
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
175 |
1406
35069ca331f2
Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff
changeset
|
176 // Compilation entry point for methods |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
177 void GraalCompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) { |
3651
a31028282e3e
Support blocking compilation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
178 ShouldNotReachHere(); |
1406
35069ca331f2
Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff
changeset
|
179 } |
35069ca331f2
Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff
changeset
|
180 |
2901
d577d07cedec
Added time measurement for phases.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2891
diff
changeset
|
181 void GraalCompiler::exit() { |
3576
c94966c5fb41
Only shut down the compiler if it was initialized.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3566
diff
changeset
|
182 if (_initialized) { |
4221
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
183 VMToCompiler::shutdownCompiler(); |
3576
c94966c5fb41
Only shut down the compiler if it was initialized.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3566
diff
changeset
|
184 } |
2901
d577d07cedec
Added time measurement for phases.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2891
diff
changeset
|
185 } |
d577d07cedec
Added time measurement for phases.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2891
diff
changeset
|
186 |
1406
35069ca331f2
Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff
changeset
|
187 // Print compilation timers and statistics |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
188 void GraalCompiler::print_timers() { |
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
189 TRACE_graal_1("GraalCompiler::print_timers"); |
1410
b30a2cd5e3a2
Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1407
diff
changeset
|
190 } |
b30a2cd5e3a2
Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1407
diff
changeset
|
191 |
3653
6aef50c6d967
Handlize to fix GC issue.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3651
diff
changeset
|
192 Handle GraalCompiler::get_RiType(Symbol* klass_name, TRAPS) { |
4221
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
193 return VMToCompiler::createRiTypeUnresolved(VmIds::toString<Handle>(klass_name, THREAD), THREAD); |
3637
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
194 } |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
195 |
3653
6aef50c6d967
Handlize to fix GC issue.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3651
diff
changeset
|
196 Handle GraalCompiler::get_RiTypeFromSignature(constantPoolHandle cp, int index, KlassHandle loading_klass, TRAPS) { |
3637
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
197 |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
198 Symbol* signature = cp->symbol_at(index); |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
199 BasicType field_type = FieldType::basic_type(signature); |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
200 // If the field is a pointer type, get the klass of the |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
201 // field. |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
202 if (field_type == T_OBJECT || field_type == T_ARRAY) { |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
203 KlassHandle handle = GraalEnv::get_klass_by_name(loading_klass, signature, false); |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
204 if (handle.is_null()) { |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
205 return get_RiType(signature, CHECK_NULL); |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
206 } else { |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
207 return get_RiType(handle, CHECK_NULL); |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
208 } |
3566
b0d192f86f34
more work on ci removal
Lukas Stadler <lukas.stadler@jku.at>
parents:
3565
diff
changeset
|
209 } else { |
4221
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
210 return VMToCompiler::createRiTypePrimitive(field_type, CHECK_NULL); |
3566
b0d192f86f34
more work on ci removal
Lukas Stadler <lukas.stadler@jku.at>
parents:
3565
diff
changeset
|
211 } |
3637
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
212 } |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
213 |
3653
6aef50c6d967
Handlize to fix GC issue.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3651
diff
changeset
|
214 Handle GraalCompiler::get_RiType(constantPoolHandle cp, int index, KlassHandle loading_klass, TRAPS) { |
3637
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
215 bool is_accessible = false; |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
216 |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
217 KlassHandle klass = GraalEnv::get_klass_by_index(cp, index, is_accessible, loading_klass); |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
218 oop catch_class = NULL; |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
219 if (klass.is_null()) { |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
220 // We have to lock the cpool to keep the oop from being resolved |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
221 // while we are accessing it. |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
222 ObjectLocker ol(cp, THREAD); |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
223 |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
224 Symbol* klass_name = NULL; |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
225 constantTag tag = cp->tag_at(index); |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
226 if (tag.is_klass()) { |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
227 // The klass has been inserted into the constant pool |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
228 // very recently. |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
229 return GraalCompiler::get_RiType(cp->resolved_klass_at(index), CHECK_NULL); |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
230 } else if (tag.is_symbol()) { |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
231 klass_name = cp->symbol_at(index); |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
232 } else { |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
233 assert(cp->tag_at(index).is_unresolved_klass(), "wrong tag"); |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
234 klass_name = cp->unresolved_klass_at(index); |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
235 } |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
236 return GraalCompiler::get_RiType(klass_name, CHECK_NULL); |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
237 } else { |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
238 return GraalCompiler::get_RiType(klass, CHECK_NULL); |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
239 } |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
240 } |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3634
diff
changeset
|
241 |
3653
6aef50c6d967
Handlize to fix GC issue.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3651
diff
changeset
|
242 Handle GraalCompiler::get_RiType(KlassHandle klass, TRAPS) { |
3565
b3f0f8a01ca2
remove some ci-dependencies
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
243 Handle name = VmIds::toString<Handle>(klass->name(), THREAD); |
b3f0f8a01ca2
remove some ci-dependencies
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
244 return createHotSpotTypeResolved(klass, name, CHECK_NULL); |
b3f0f8a01ca2
remove some ci-dependencies
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
245 } |
b3f0f8a01ca2
remove some ci-dependencies
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
246 |
3653
6aef50c6d967
Handlize to fix GC issue.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3651
diff
changeset
|
247 Handle GraalCompiler::get_RiField(int offset, int flags, Symbol* field_name, Handle field_holder, Handle field_type, Bytecodes::Code byteCode, TRAPS) { |
3649
5a8c44b5fb80
Remove ci usage on field lookup.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3637
diff
changeset
|
248 Handle name = VmIds::toString<Handle>(field_name, CHECK_NULL); |
4221
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
249 return VMToCompiler::createRiField(field_holder, name, field_type, offset, flags, CHECK_NULL); |
1413
1ecc8f0aad00
Draft implementation of HotSpot CRI / first method compiling without exception.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1412
diff
changeset
|
250 } |
1ecc8f0aad00
Draft implementation of HotSpot CRI / first method compiling without exception.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1412
diff
changeset
|
251 |
3653
6aef50c6d967
Handlize to fix GC issue.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3651
diff
changeset
|
252 Handle GraalCompiler::createHotSpotTypeResolved(KlassHandle klass, Handle name, TRAPS) { |
4640
8aa283b5e173
Synchronize createHotSpotTypeResolved (should fix EscapeAnalysis NPE)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4551
diff
changeset
|
253 ObjectLocker ol(klass, THREAD); |
8aa283b5e173
Synchronize createHotSpotTypeResolved (should fix EscapeAnalysis NPE)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4551
diff
changeset
|
254 |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
255 if (klass->graal_mirror() != NULL) { |
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
256 return klass->graal_mirror(); |
1941
79d04223b8a5
Added caching for resolved types and resolved fields.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1931
diff
changeset
|
257 } |
79d04223b8a5
Added caching for resolved types and resolved fields.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1931
diff
changeset
|
258 |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
259 instanceKlass::cast(HotSpotTypeResolved::klass())->initialize(CHECK_NULL); |
2055
99ad52189524
Refactorings to get towards less CRI overhead.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
260 Handle obj = instanceKlass::cast(HotSpotTypeResolved::klass())->allocate_instance(CHECK_NULL); |
99ad52189524
Refactorings to get towards less CRI overhead.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
261 assert(obj() != NULL, "must succeed in allocating instance"); |
99ad52189524
Refactorings to get towards less CRI overhead.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
262 |
4221
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
263 HotSpotTypeResolved::set_compiler(obj, VMToCompiler::compilerInstance()()); |
2055
99ad52189524
Refactorings to get towards less CRI overhead.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
264 |
99ad52189524
Refactorings to get towards less CRI overhead.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
265 if (klass->oop_is_instance()) { |
3650
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
266 ResourceMark rm; |
2055
99ad52189524
Refactorings to get towards less CRI overhead.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
267 instanceKlass* ik = (instanceKlass*)klass()->klass_part(); |
99ad52189524
Refactorings to get towards less CRI overhead.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
268 Handle full_name = java_lang_String::create_from_str(ik->signature_name(), CHECK_NULL); |
99ad52189524
Refactorings to get towards less CRI overhead.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
269 HotSpotType::set_name(obj, full_name()); |
99ad52189524
Refactorings to get towards less CRI overhead.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
270 } else { |
99ad52189524
Refactorings to get towards less CRI overhead.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
271 HotSpotType::set_name(obj, name()); |
99ad52189524
Refactorings to get towards less CRI overhead.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
272 } |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
273 |
1465
2c754f3a2722
Inlining of static final field values. Java mirror instead of VmID. Support for PrintMetrics option.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1461
diff
changeset
|
274 HotSpotTypeResolved::set_javaMirror(obj, klass->java_mirror()); |
2055
99ad52189524
Refactorings to get towards less CRI overhead.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
275 HotSpotTypeResolved::set_simpleName(obj, name()); |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
276 HotSpotTypeResolved::set_accessFlags(obj, klass->access_flags().as_int()); |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
277 HotSpotTypeResolved::set_isInterface(obj, klass->is_interface()); |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
278 HotSpotTypeResolved::set_isInstanceClass(obj, klass->oop_is_instance()); |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
279 |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
280 if (klass->oop_is_javaArray()) { |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
281 HotSpotTypeResolved::set_isArrayClass(obj, true); |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
282 } else { |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
283 HotSpotTypeResolved::set_isArrayClass(obj, false); |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
284 HotSpotTypeResolved::set_instanceSize(obj, instanceKlass::cast(klass())->size_helper() * HeapWordSize); |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
285 HotSpotTypeResolved::set_hasFinalizer(obj, klass->has_finalizer()); |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
286 } |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
287 |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
288 // TODO replace these with correct values |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
289 HotSpotTypeResolved::set_hasSubclass(obj, false); |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
290 HotSpotTypeResolved::set_hasFinalizableSubclass(obj, false); |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
291 |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
292 klass->set_graal_mirror(obj()); |
1941
79d04223b8a5
Added caching for resolved types and resolved fields.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1931
diff
changeset
|
293 |
3653
6aef50c6d967
Handlize to fix GC issue.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3651
diff
changeset
|
294 return obj; |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
295 } |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
296 |
3653
6aef50c6d967
Handlize to fix GC issue.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3651
diff
changeset
|
297 Handle GraalCompiler::createHotSpotMethodResolved(methodHandle method, TRAPS) { |
3011
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
298 if (method->graal_mirror() != NULL) { |
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
299 assert(method->graal_mirror()->is_a(HotSpotMethodResolved::klass()), "unexpected class..."); |
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
300 return method->graal_mirror(); |
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
301 } |
3555
22d11b3bc561
Various hacks to be able to install machine code from a Java thread.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
3090
diff
changeset
|
302 Handle name = VmIds::toString<Handle>(method->name(), CHECK_NULL); |
22d11b3bc561
Various hacks to be able to install machine code from a Java thread.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
3090
diff
changeset
|
303 |
3011
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
304 instanceKlass::cast(HotSpotMethodResolved::klass())->initialize(CHECK_NULL); |
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
305 Handle obj = instanceKlass::cast(HotSpotMethodResolved::klass())->allocate_instance(CHECK_NULL); |
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
306 assert(obj() != NULL, "must succeed in allocating instance"); |
3020
9fed07e4a375
Changed from method/reflect object back to methodOop, because using method/reflection can create deadlock with the user application (test with -Xcomp). Disabled method caching by default and created a flag -G:StoreResultGraph (otherwise eclipse will fail because of being out of memory).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
3011
diff
changeset
|
307 |
4221
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
308 HotSpotMethodResolved::set_compiler(obj, VMToCompiler::compilerInstance()()); |
5056
2f2c6347fce4
comments cleanup/retagging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5018
diff
changeset
|
309 // (thomaswue) Cannot use reflection here, because the compiler thread could dead lock with the running application. |
3020
9fed07e4a375
Changed from method/reflect object back to methodOop, because using method/reflection can create deadlock with the user application (test with -Xcomp). Disabled method caching by default and created a flag -G:StoreResultGraph (otherwise eclipse will fail because of being out of memory).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
3011
diff
changeset
|
310 // oop reflected = getReflectedMethod(method(), CHECK_NULL); |
9fed07e4a375
Changed from method/reflect object back to methodOop, because using method/reflection can create deadlock with the user application (test with -Xcomp). Disabled method caching by default and created a flag -G:StoreResultGraph (otherwise eclipse will fail because of being out of memory).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
3011
diff
changeset
|
311 HotSpotMethodResolved::set_javaMirror(obj, method()); |
3011
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
312 HotSpotMethodResolved::set_name(obj, name()); |
3020
9fed07e4a375
Changed from method/reflect object back to methodOop, because using method/reflection can create deadlock with the user application (test with -Xcomp). Disabled method caching by default and created a flag -G:StoreResultGraph (otherwise eclipse will fail because of being out of memory).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
3011
diff
changeset
|
313 |
3011
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
314 KlassHandle klass = method->method_holder(); |
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
315 Handle holder_name = VmIds::toString<Handle>(klass->name(), CHECK_NULL); |
3653
6aef50c6d967
Handlize to fix GC issue.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3651
diff
changeset
|
316 Handle holder = GraalCompiler::createHotSpotTypeResolved(klass, holder_name, CHECK_NULL); |
6aef50c6d967
Handlize to fix GC issue.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3651
diff
changeset
|
317 HotSpotMethodResolved::set_holder(obj, holder()); |
3020
9fed07e4a375
Changed from method/reflect object back to methodOop, because using method/reflection can create deadlock with the user application (test with -Xcomp). Disabled method caching by default and created a flag -G:StoreResultGraph (otherwise eclipse will fail because of being out of memory).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
3011
diff
changeset
|
318 |
3011
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
319 HotSpotMethodResolved::set_codeSize(obj, method->code_size()); |
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
320 HotSpotMethodResolved::set_accessFlags(obj, method->access_flags().as_int()); |
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
321 HotSpotMethodResolved::set_maxLocals(obj, method->max_locals()); |
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
322 HotSpotMethodResolved::set_maxStackSize(obj, method->max_stack()); |
5105
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5062
diff
changeset
|
323 HotSpotMethodResolved::set_canBeInlined(obj, !method->is_not_compilable() && !CompilerOracle::should_not_inline(method)); |
3020
9fed07e4a375
Changed from method/reflect object back to methodOop, because using method/reflection can create deadlock with the user application (test with -Xcomp). Disabled method caching by default and created a flag -G:StoreResultGraph (otherwise eclipse will fail because of being out of memory).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
3011
diff
changeset
|
324 |
3011
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
325 method->set_graal_mirror(obj()); |
4439
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4221
diff
changeset
|
326 return obj; |
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4221
diff
changeset
|
327 } |
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4221
diff
changeset
|
328 |
4441
4e3aaf14cbc6
fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4439
diff
changeset
|
329 Handle GraalCompiler::createHotSpotMethodData(methodDataHandle method_data, TRAPS) { |
4439
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4221
diff
changeset
|
330 if(method_data->graal_mirror() != NULL) { |
4441
4e3aaf14cbc6
fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4439
diff
changeset
|
331 assert(method_data->graal_mirror()->is_a(HotSpotMethodData::klass()), "unexpected class"); |
4439
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4221
diff
changeset
|
332 return method_data->graal_mirror(); |
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4221
diff
changeset
|
333 } |
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4221
diff
changeset
|
334 |
4441
4e3aaf14cbc6
fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4439
diff
changeset
|
335 instanceKlass::cast(HotSpotMethodData::klass())->initialize(CHECK_NULL); |
4e3aaf14cbc6
fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4439
diff
changeset
|
336 Handle obj = instanceKlass::cast(HotSpotMethodData::klass())->allocate_instance(CHECK_NULL); |
4443
6fb167f79df6
fixed methodDataOop access
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4442
diff
changeset
|
337 assert(obj.not_null(), "must succeed in allocating instance"); |
4439
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4221
diff
changeset
|
338 |
4441
4e3aaf14cbc6
fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4439
diff
changeset
|
339 HotSpotMethodData::set_compiler(obj, VMToCompiler::compilerInstance()()); |
4444 | 340 HotSpotMethodData::set_hotspotMirror(obj, method_data()); |
4441
4e3aaf14cbc6
fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4439
diff
changeset
|
341 HotSpotMethodData::set_normalDataSize(obj, method_data()->data_size()); |
4e3aaf14cbc6
fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4439
diff
changeset
|
342 HotSpotMethodData::set_extraDataSize(obj, method_data()->extra_data_size()); |
4439
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4221
diff
changeset
|
343 |
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4221
diff
changeset
|
344 method_data->set_graal_mirror(obj()); |
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4221
diff
changeset
|
345 return obj; |
3011
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
346 } |
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2925
diff
changeset
|
347 |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
348 BasicType GraalCompiler::kindToBasicType(jchar ch) { |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
349 switch(ch) { |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
350 case 'z': return T_BOOLEAN; |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
351 case 'b': return T_BYTE; |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
352 case 's': return T_SHORT; |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
353 case 'c': return T_CHAR; |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
354 case 'i': return T_INT; |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
355 case 'f': return T_FLOAT; |
3592
ff472e09af46
Fixed long signature char.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3591
diff
changeset
|
356 case 'j': return T_LONG; |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
357 case 'd': return T_DOUBLE; |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
358 case 'a': return T_OBJECT; |
1476
1f81c0d18c75
Build also release version of VM. Fix towards making SpecJVM2008 run.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1465
diff
changeset
|
359 case 'r': return T_ADDRESS; |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
360 case '-': return T_ILLEGAL; |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
361 default: |
1931
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1483
diff
changeset
|
362 fatal(err_msg("unexpected CiKind: %c", ch)); |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
363 break; |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
364 } |
2215
999f8086cc4f
More changes to make it compile and work on win64.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2182
diff
changeset
|
365 return T_ILLEGAL; |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
366 } |