Mercurial > hg > graal-compiler
annotate src/share/vm/graal/graalVMToCompiler.cpp @ 15046:5c71dcf0915d
use hotspot static stubs for call sites
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Wed, 09 Apr 2014 16:33:37 -0700 |
parents | db4254246f9a |
children | 4df6d7c966a2 |
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:
diff
changeset
|
22 */ |
b30a2cd5e3a2
Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff
changeset
|
23 |
2045
9c96c873c42b
Fix includes to match new hotspot mechanism.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1941
diff
changeset
|
24 #include "precompiled.hpp" |
10770 | 25 #include "classfile/systemDictionary.hpp" |
4220
5c80ccb80036
Renaming of VMExits and VMEntries part 1.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
26 #include "graal/graalVMToCompiler.hpp" |
11596
91e5f927af63
Initial implementation of PTXRuntime (RegisterConfig, PTX description etc); guarded with new flag UseGPU. Specify -XX:+UseGPU to exercise this new implementation.
bharadwaj
parents:
11585
diff
changeset
|
27 #include "runtime/gpu.hpp" |
1410
b30a2cd5e3a2
Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff
changeset
|
28 |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1422
diff
changeset
|
29 // this is a *global* handle |
6505
1ecf984d490c
fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents:
6503
diff
changeset
|
30 jobject VMToCompiler::_graalRuntimePermObject = NULL; |
5278
74dfa6f86879
removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents:
5176
diff
changeset
|
31 jobject VMToCompiler::_vmToCompilerPermObject = NULL; |
6948
e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents:
6505
diff
changeset
|
32 Klass* VMToCompiler::_vmToCompilerPermKlass = NULL; |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1422
diff
changeset
|
33 |
6948
e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents:
6505
diff
changeset
|
34 static Klass* loadClass(Symbol* name) { |
10770 | 35 Klass* klass = SystemDictionary::resolve_or_null(name, SystemDictionary::java_system_loader(), Handle(), Thread::current()); |
6503
ac3a4ea144a6
simplified error checking when loading Graal classes from the C++ code
Doug Simon <doug.simon@oracle.com>
parents:
6495
diff
changeset
|
36 if (klass == NULL) { |
ac3a4ea144a6
simplified error checking when loading Graal classes from the C++ code
Doug Simon <doug.simon@oracle.com>
parents:
6495
diff
changeset
|
37 tty->print_cr("Could not load class %s", name->as_C_string()); |
ac3a4ea144a6
simplified error checking when loading Graal classes from the C++ code
Doug Simon <doug.simon@oracle.com>
parents:
6495
diff
changeset
|
38 vm_abort(false); |
ac3a4ea144a6
simplified error checking when loading Graal classes from the C++ code
Doug Simon <doug.simon@oracle.com>
parents:
6495
diff
changeset
|
39 } |
ac3a4ea144a6
simplified error checking when loading Graal classes from the C++ code
Doug Simon <doug.simon@oracle.com>
parents:
6495
diff
changeset
|
40 return klass; |
ac3a4ea144a6
simplified error checking when loading Graal classes from the C++ code
Doug Simon <doug.simon@oracle.com>
parents:
6495
diff
changeset
|
41 } |
ac3a4ea144a6
simplified error checking when loading Graal classes from the C++ code
Doug Simon <doug.simon@oracle.com>
parents:
6495
diff
changeset
|
42 |
5278
74dfa6f86879
removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents:
5176
diff
changeset
|
43 KlassHandle VMToCompiler::vmToCompilerKlass() { |
6948
e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents:
6505
diff
changeset
|
44 if (_vmToCompilerPermKlass == NULL) { |
e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents:
6505
diff
changeset
|
45 Klass* result = loadClass(vmSymbols::com_oracle_graal_hotspot_bridge_VMToCompiler()); |
e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents:
6505
diff
changeset
|
46 _vmToCompilerPermKlass = result; |
1421
6223633ce7dd
changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1414
diff
changeset
|
47 } |
6948
e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents:
6505
diff
changeset
|
48 return _vmToCompilerPermKlass; |
1410
b30a2cd5e3a2
Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff
changeset
|
49 } |
b30a2cd5e3a2
Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff
changeset
|
50 |
10475
3489047ffea2
Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10056
diff
changeset
|
51 Handle VMToCompiler::truffleRuntime() { |
15018
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14069
diff
changeset
|
52 Symbol* name = vmSymbols::com_oracle_graal_truffle_hotspot_HotSpotTruffleRuntime(); |
10475
3489047ffea2
Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10056
diff
changeset
|
53 KlassHandle klass = loadClass(name); |
3489047ffea2
Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10056
diff
changeset
|
54 |
3489047ffea2
Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10056
diff
changeset
|
55 JavaValue result(T_OBJECT); |
12456
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
11699
diff
changeset
|
56 JavaCalls::call_static(&result, klass, vmSymbols::makeInstance_name(), vmSymbols::makeInstance_signature(), Thread::current()); |
15018
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14069
diff
changeset
|
57 check_pending_exception("Couldn't initialize HotSpotTruffleRuntime"); |
10475
3489047ffea2
Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10056
diff
changeset
|
58 return Handle((oop) result.get_jobject()); |
3489047ffea2
Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10056
diff
changeset
|
59 } |
3489047ffea2
Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10056
diff
changeset
|
60 |
6505
1ecf984d490c
fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents:
6503
diff
changeset
|
61 Handle VMToCompiler::graalRuntime() { |
1ecf984d490c
fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents:
6503
diff
changeset
|
62 if (JNIHandles::resolve(_graalRuntimePermObject) == NULL) { |
12456
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
11699
diff
changeset
|
63 KlassHandle klass = loadClass(vmSymbols::com_oracle_graal_hotspot_HotSpotGraalRuntime()); |
2284
569d3fe7d65c
non-static VMEntries and VMExits, CompilationServer simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
2045
diff
changeset
|
64 JavaValue result(T_OBJECT); |
12456
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
11699
diff
changeset
|
65 JavaCalls::call_static(&result, klass, vmSymbols::runtime_name(), vmSymbols::runtime_signature(), Thread::current()); |
6494
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
5554
diff
changeset
|
66 check_pending_exception("Couldn't initialize HotSpotGraalRuntime"); |
6505
1ecf984d490c
fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents:
6503
diff
changeset
|
67 _graalRuntimePermObject = JNIHandles::make_global((oop) result.get_jobject()); |
2284
569d3fe7d65c
non-static VMEntries and VMExits, CompilationServer simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
2045
diff
changeset
|
68 } |
6505
1ecf984d490c
fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents:
6503
diff
changeset
|
69 return Handle(JNIHandles::resolve_non_null(_graalRuntimePermObject)); |
2284
569d3fe7d65c
non-static VMEntries and VMExits, CompilationServer simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
2045
diff
changeset
|
70 } |
569d3fe7d65c
non-static VMEntries and VMExits, CompilationServer simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
2045
diff
changeset
|
71 |
4220
5c80ccb80036
Renaming of VMExits and VMEntries part 1.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
72 Handle VMToCompiler::instance() { |
5278
74dfa6f86879
removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents:
5176
diff
changeset
|
73 if (JNIHandles::resolve(_vmToCompilerPermObject) == NULL) { |
6503
ac3a4ea144a6
simplified error checking when loading Graal classes from the C++ code
Doug Simon <doug.simon@oracle.com>
parents:
6495
diff
changeset
|
74 KlassHandle compilerKlass = loadClass(vmSymbols::com_oracle_graal_hotspot_HotSpotGraalRuntime()); |
2285
762de4b26788
turn Compiler and HotSpotTypeResolved into interfaces
Lukas Stadler <lukas.stadler@jku.at>
parents:
2284
diff
changeset
|
75 |
1437
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1432
diff
changeset
|
76 JavaValue result(T_OBJECT); |
2285
762de4b26788
turn Compiler and HotSpotTypeResolved into interfaces
Lukas Stadler <lukas.stadler@jku.at>
parents:
2284
diff
changeset
|
77 JavaCallArguments args; |
6505
1ecf984d490c
fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents:
6503
diff
changeset
|
78 args.set_receiver(graalRuntime()); |
5526
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5515
diff
changeset
|
79 JavaCalls::call_virtual(&result, compilerKlass, vmSymbols::getVMToCompiler_name(), vmSymbols::getVMToCompiler_signature(), &args, Thread::current()); |
5278
74dfa6f86879
removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents:
5176
diff
changeset
|
80 check_pending_exception("Couldn't get VMToCompiler"); |
74dfa6f86879
removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents:
5176
diff
changeset
|
81 _vmToCompilerPermObject = JNIHandles::make_global((oop) result.get_jobject()); |
1421
6223633ce7dd
changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1414
diff
changeset
|
82 } |
5278
74dfa6f86879
removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents:
5176
diff
changeset
|
83 return Handle(JNIHandles::resolve_non_null(_vmToCompilerPermObject)); |
1437
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1432
diff
changeset
|
84 } |
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1432
diff
changeset
|
85 |
9913
35f93560b1f0
ensure that <clinit> for HotSpotOptions is called irrespective of whether and -G: options are specified
Doug Simon <doug.simon@oracle.com>
parents:
9728
diff
changeset
|
86 void VMToCompiler::initOptions() { |
11561
e1309fc4d17f
ensure Debug.enable() is called before any DebugTimer or DebugMetric objects are requested
Doug Simon <doug.simon@oracle.com>
parents:
10770
diff
changeset
|
87 KlassHandle optionsKlass = loadClass(vmSymbols::com_oracle_graal_hotspot_HotSpotOptions()); |
9913
35f93560b1f0
ensure that <clinit> for HotSpotOptions is called irrespective of whether and -G: options are specified
Doug Simon <doug.simon@oracle.com>
parents:
9728
diff
changeset
|
88 Thread* THREAD = Thread::current(); |
11561
e1309fc4d17f
ensure Debug.enable() is called before any DebugTimer or DebugMetric objects are requested
Doug Simon <doug.simon@oracle.com>
parents:
10770
diff
changeset
|
89 optionsKlass->initialize(THREAD); |
9913
35f93560b1f0
ensure that <clinit> for HotSpotOptions is called irrespective of whether and -G: options are specified
Doug Simon <doug.simon@oracle.com>
parents:
9728
diff
changeset
|
90 check_pending_exception("Error while calling initOptions"); |
35f93560b1f0
ensure that <clinit> for HotSpotOptions is called irrespective of whether and -G: options are specified
Doug Simon <doug.simon@oracle.com>
parents:
9728
diff
changeset
|
91 } |
35f93560b1f0
ensure that <clinit> for HotSpotOptions is called irrespective of whether and -G: options are specified
Doug Simon <doug.simon@oracle.com>
parents:
9728
diff
changeset
|
92 |
4220
5c80ccb80036
Renaming of VMExits and VMEntries part 1.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
93 jboolean VMToCompiler::setOption(Handle option) { |
1437
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1432
diff
changeset
|
94 assert(!option.is_null(), ""); |
11561
e1309fc4d17f
ensure Debug.enable() is called before any DebugTimer or DebugMetric objects are requested
Doug Simon <doug.simon@oracle.com>
parents:
10770
diff
changeset
|
95 KlassHandle optionsKlass = loadClass(vmSymbols::com_oracle_graal_hotspot_HotSpotOptions()); |
2296
34354e2e40a3
cleanups and client/server fixes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2289
diff
changeset
|
96 |
1437
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1432
diff
changeset
|
97 Thread* THREAD = Thread::current(); |
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1432
diff
changeset
|
98 JavaValue result(T_BOOLEAN); |
11561
e1309fc4d17f
ensure Debug.enable() is called before any DebugTimer or DebugMetric objects are requested
Doug Simon <doug.simon@oracle.com>
parents:
10770
diff
changeset
|
99 JavaCalls::call_static(&result, optionsKlass, vmSymbols::setOption_name(), vmSymbols::setOption_signature(), option, THREAD); |
1437
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1432
diff
changeset
|
100 check_pending_exception("Error while calling setOption"); |
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1432
diff
changeset
|
101 return result.get_jboolean(); |
1421
6223633ce7dd
changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1414
diff
changeset
|
102 } |
6223633ce7dd
changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1414
diff
changeset
|
103 |
11585
516b93ccf7c9
pass the value of the -XX:+CITime VM option explicitly to HotSpotOptions.finalize()
Doug Simon <doug.simon@oracle.com>
parents:
11561
diff
changeset
|
104 void VMToCompiler::finalizeOptions(jboolean ciTime) { |
11561
e1309fc4d17f
ensure Debug.enable() is called before any DebugTimer or DebugMetric objects are requested
Doug Simon <doug.simon@oracle.com>
parents:
10770
diff
changeset
|
105 KlassHandle optionsKlass = loadClass(vmSymbols::com_oracle_graal_hotspot_HotSpotOptions()); |
e1309fc4d17f
ensure Debug.enable() is called before any DebugTimer or DebugMetric objects are requested
Doug Simon <doug.simon@oracle.com>
parents:
10770
diff
changeset
|
106 Thread* THREAD = Thread::current(); |
e1309fc4d17f
ensure Debug.enable() is called before any DebugTimer or DebugMetric objects are requested
Doug Simon <doug.simon@oracle.com>
parents:
10770
diff
changeset
|
107 JavaValue result(T_VOID); |
11585
516b93ccf7c9
pass the value of the -XX:+CITime VM option explicitly to HotSpotOptions.finalize()
Doug Simon <doug.simon@oracle.com>
parents:
11561
diff
changeset
|
108 JavaCallArguments args; |
516b93ccf7c9
pass the value of the -XX:+CITime VM option explicitly to HotSpotOptions.finalize()
Doug Simon <doug.simon@oracle.com>
parents:
11561
diff
changeset
|
109 args.push_int(ciTime); |
516b93ccf7c9
pass the value of the -XX:+CITime VM option explicitly to HotSpotOptions.finalize()
Doug Simon <doug.simon@oracle.com>
parents:
11561
diff
changeset
|
110 JavaCalls::call_static(&result, optionsKlass, vmSymbols::finalizeOptions_name(), vmSymbols::bool_void_signature(), &args, THREAD); |
11561
e1309fc4d17f
ensure Debug.enable() is called before any DebugTimer or DebugMetric objects are requested
Doug Simon <doug.simon@oracle.com>
parents:
10770
diff
changeset
|
111 check_pending_exception("Error while calling finalizeOptions"); |
e1309fc4d17f
ensure Debug.enable() is called before any DebugTimer or DebugMetric objects are requested
Doug Simon <doug.simon@oracle.com>
parents:
10770
diff
changeset
|
112 } |
e1309fc4d17f
ensure Debug.enable() is called before any DebugTimer or DebugMetric objects are requested
Doug Simon <doug.simon@oracle.com>
parents:
10770
diff
changeset
|
113 |
13262
f13f6dc290c8
don't pass HotSpotResolvedObjectType to VMToCompiler.compileMethod but instead create it in Java code
twisti
parents:
13254
diff
changeset
|
114 void VMToCompiler::compileMethod(Method* method, int entry_bci, jboolean blocking) { |
6948
e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents:
6505
diff
changeset
|
115 assert(method != NULL, "just checking"); |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1422
diff
changeset
|
116 Thread* THREAD = Thread::current(); |
10056
a323a9e20f9d
Fixed a few race conditions in the compilation queue.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9934
diff
changeset
|
117 JavaValue result(T_VOID); |
1410
b30a2cd5e3a2
Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff
changeset
|
118 JavaCallArguments args; |
1421
6223633ce7dd
changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1414
diff
changeset
|
119 args.push_oop(instance()); |
6948
e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents:
6505
diff
changeset
|
120 args.push_long((jlong) (address) method); |
1410
b30a2cd5e3a2
Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff
changeset
|
121 args.push_int(entry_bci); |
3651
a31028282e3e
Support blocking compilation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
122 args.push_int(blocking); |
5278
74dfa6f86879
removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents:
5176
diff
changeset
|
123 JavaCalls::call_interface(&result, vmToCompilerKlass(), vmSymbols::compileMethod_name(), vmSymbols::compileMethod_signature(), &args, THREAD); |
1421
6223633ce7dd
changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1414
diff
changeset
|
124 check_pending_exception("Error while calling compileMethod"); |
1410
b30a2cd5e3a2
Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff
changeset
|
125 } |
b30a2cd5e3a2
Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff
changeset
|
126 |
4220
5c80ccb80036
Renaming of VMExits and VMEntries part 1.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
127 void VMToCompiler::shutdownCompiler() { |
6505
1ecf984d490c
fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents:
6503
diff
changeset
|
128 if (_graalRuntimePermObject != NULL) { |
3011
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2951
diff
changeset
|
129 HandleMark hm; |
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2951
diff
changeset
|
130 JavaThread* THREAD = JavaThread::current(); |
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2951
diff
changeset
|
131 JavaValue result(T_VOID); |
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2951
diff
changeset
|
132 JavaCallArguments args; |
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2951
diff
changeset
|
133 args.push_oop(instance()); |
5278
74dfa6f86879
removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents:
5176
diff
changeset
|
134 JavaCalls::call_interface(&result, vmToCompilerKlass(), vmSymbols::shutdownCompiler_name(), vmSymbols::void_method_signature(), &args, THREAD); |
3011
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2951
diff
changeset
|
135 check_pending_exception("Error while calling shutdownCompiler"); |
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2951
diff
changeset
|
136 |
6505
1ecf984d490c
fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents:
6503
diff
changeset
|
137 JNIHandles::destroy_global(_graalRuntimePermObject); |
5278
74dfa6f86879
removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents:
5176
diff
changeset
|
138 JNIHandles::destroy_global(_vmToCompilerPermObject); |
6948
e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents:
6505
diff
changeset
|
139 //JNIHandles::destroy_global(_vmToCompilerPermKlass); |
3011
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2951
diff
changeset
|
140 |
6505
1ecf984d490c
fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents:
6503
diff
changeset
|
141 _graalRuntimePermObject = NULL; |
5278
74dfa6f86879
removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents:
5176
diff
changeset
|
142 _vmToCompilerPermObject = NULL; |
74dfa6f86879
removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents:
5176
diff
changeset
|
143 _vmToCompilerPermKlass = NULL; |
3011
f00918f35c7f
inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents:
2951
diff
changeset
|
144 } |
2901
d577d07cedec
Added time measurement for phases.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2891
diff
changeset
|
145 } |
d577d07cedec
Added time measurement for phases.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2891
diff
changeset
|
146 |
13103
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
147 void VMToCompiler::startCompiler(jboolean bootstrap_enabled) { |
2925
b78b4ae0757c
Also call Compiler shutdown hook in case of System.exit call. Draft VMExits.Sandbox class.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2916
diff
changeset
|
148 JavaThread* THREAD = JavaThread::current(); |
b78b4ae0757c
Also call Compiler shutdown hook in case of System.exit call. Draft VMExits.Sandbox class.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2916
diff
changeset
|
149 JavaValue result(T_VOID); |
b78b4ae0757c
Also call Compiler shutdown hook in case of System.exit call. Draft VMExits.Sandbox class.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2916
diff
changeset
|
150 JavaCallArguments args; |
b78b4ae0757c
Also call Compiler shutdown hook in case of System.exit call. Draft VMExits.Sandbox class.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2916
diff
changeset
|
151 args.push_oop(instance()); |
9728
2dc020b33a6e
set bootstrapRunning flag earlier (in VMToCompiler.startCompiler)
Lukas Stadler <lukas.stadler@jku.at>
parents:
9126
diff
changeset
|
152 args.push_int(bootstrap_enabled); |
13103
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
153 JavaCalls::call_interface(&result, vmToCompilerKlass(), vmSymbols::startCompiler_name(), vmSymbols::bool_void_signature(), &args, THREAD); |
2925
b78b4ae0757c
Also call Compiler shutdown hook in case of System.exit call. Draft VMExits.Sandbox class.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2916
diff
changeset
|
154 check_pending_exception("Error while calling startCompiler"); |
b78b4ae0757c
Also call Compiler shutdown hook in case of System.exit call. Draft VMExits.Sandbox class.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2916
diff
changeset
|
155 } |
2901
d577d07cedec
Added time measurement for phases.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2891
diff
changeset
|
156 |
4220
5c80ccb80036
Renaming of VMExits and VMEntries part 1.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4139
diff
changeset
|
157 void VMToCompiler::bootstrap() { |
3650
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3636
diff
changeset
|
158 JavaThread* THREAD = JavaThread::current(); |
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3636
diff
changeset
|
159 JavaValue result(T_VOID); |
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3636
diff
changeset
|
160 JavaCallArguments args; |
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3636
diff
changeset
|
161 args.push_oop(instance()); |
5278
74dfa6f86879
removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents:
5176
diff
changeset
|
162 JavaCalls::call_interface(&result, vmToCompilerKlass(), vmSymbols::bootstrap_name(), vmSymbols::void_method_signature(), &args, THREAD); |
12652
0dd597c6c9c7
fixed performance regression in hosted CompileTheWorld
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
163 check_pending_exception("Error while calling bootstrap"); |
0dd597c6c9c7
fixed performance regression in hosted CompileTheWorld
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
164 } |
0dd597c6c9c7
fixed performance regression in hosted CompileTheWorld
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
165 |
0dd597c6c9c7
fixed performance regression in hosted CompileTheWorld
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
166 void VMToCompiler::compileTheWorld() { |
0dd597c6c9c7
fixed performance regression in hosted CompileTheWorld
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
167 JavaThread* THREAD = JavaThread::current(); |
0dd597c6c9c7
fixed performance regression in hosted CompileTheWorld
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
168 JavaValue result(T_VOID); |
0dd597c6c9c7
fixed performance regression in hosted CompileTheWorld
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
169 JavaCallArguments args; |
0dd597c6c9c7
fixed performance regression in hosted CompileTheWorld
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
170 args.push_oop(instance()); |
0dd597c6c9c7
fixed performance regression in hosted CompileTheWorld
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
171 JavaCalls::call_interface(&result, vmToCompilerKlass(), vmSymbols::compileTheWorld_name(), vmSymbols::void_method_signature(), &args, THREAD); |
0dd597c6c9c7
fixed performance regression in hosted CompileTheWorld
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
172 check_pending_exception("Error while calling compileTheWorld"); |
3650
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3636
diff
changeset
|
173 } |