annotate src/share/vm/jvmci/jvmciCompiler.hpp @ 23679:b5557b757040

fix HotSpotVMConfig startup performance (JDK-8159167)
author Doug Simon <doug.simon@oracle.com>
date Wed, 15 Jun 2016 00:00:41 +0200
parents f84a5ac3be22
children 190f5f33b7d3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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: 1406
diff changeset
22 */
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
23
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 20028
diff changeset
24 #ifndef SHARE_VM_JVMCI_JVMCI_COMPILER_HPP
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 20028
diff changeset
25 #define SHARE_VM_JVMCI_JVMCI_COMPILER_HPP
5747
120820e30baa added basic high-level interpreter support to HotSpot
Christian Haeubl <haeubl@ssw.jku.at>
parents: 5554
diff changeset
26
2045
9c96c873c42b Fix includes to match new hotspot mechanism.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1931
diff changeset
27 #include "compiler/abstractCompiler.hpp"
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 20028
diff changeset
28 #include "jvmci/jvmciEnv.hpp"
2045
9c96c873c42b Fix includes to match new hotspot mechanism.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1931
diff changeset
29
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 20028
diff changeset
30 class JVMCICompiler : public AbstractCompiler {
1414
e1a275dbc8cd Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1413
diff changeset
31 private:
16006
66a9286203a2 decoupled Graal runtime initialization and Graal compilation queue initialization
Doug Simon <doug.simon@oracle.com>
parents: 15582
diff changeset
32 bool _bootstrapping;
66a9286203a2 decoupled Graal runtime initialization and Graal compilation queue initialization
Doug Simon <doug.simon@oracle.com>
parents: 15582
diff changeset
33
16399
4481cf549cfc removed (Java based) CompilationQueue
Doug Simon <doug.simon@oracle.com>
parents: 16136
diff changeset
34 /**
23385
6ee2af864395 8156034: update 01
Josef Eisl <josef.eisl@jku.at>
parents: 23383
diff changeset
35 * True if we have seen a bootstrap compilation request.
23383
0226d6bcb0d2 Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents: 23379
diff changeset
36 */
23386
2625b10989ee 8156034: update 02
Josef Eisl <josef.eisl@jku.at>
parents: 23385
diff changeset
37 volatile bool _bootstrap_compilation_request_handled;
23383
0226d6bcb0d2 Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents: 23379
diff changeset
38
0226d6bcb0d2 Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents: 23379
diff changeset
39 /**
23303
633cf7bea01d thread waiting for blocking JVMCI compilation should not wait on compiler queue forever (JDK-8148507) [part 2]
Doug Simon <doug.simon@oracle.com>
parents: 23302
diff changeset
40 * Number of methods successfully compiled by a call to
633cf7bea01d thread waiting for blocking JVMCI compilation should not wait on compiler queue forever (JDK-8148507) [part 2]
Doug Simon <doug.simon@oracle.com>
parents: 23302
diff changeset
41 * JVMCICompiler::compile_method().
16399
4481cf549cfc removed (Java based) CompilationQueue
Doug Simon <doug.simon@oracle.com>
parents: 16136
diff changeset
42 */
23408
f84a5ac3be22 make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents: 23404
diff changeset
43 volatile int _methods_compiled;
16399
4481cf549cfc removed (Java based) CompilationQueue
Doug Simon <doug.simon@oracle.com>
parents: 16136
diff changeset
44
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 20028
diff changeset
45 static JVMCICompiler* _instance;
23408
f84a5ac3be22 make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents: 23404
diff changeset
46
17374
4a6e24a8fc2c Track code installation time
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16399
diff changeset
47 static elapsedTimer _codeInstallTimer;
4a6e24a8fc2c Track code installation time
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16399
diff changeset
48
1406
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
49 public:
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 20028
diff changeset
50 JVMCICompiler();
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
51
23408
f84a5ac3be22 make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents: 23404
diff changeset
52 static JVMCICompiler* instance(TRAPS) {
f84a5ac3be22 make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents: 23404
diff changeset
53 if (!EnableJVMCI) {
f84a5ac3be22 make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents: 23404
diff changeset
54 THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), "JVMCI is not enabled")
f84a5ac3be22 make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents: 23404
diff changeset
55 }
f84a5ac3be22 make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents: 23404
diff changeset
56 return _instance;
f84a5ac3be22 make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents: 23404
diff changeset
57 }
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
58
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 20028
diff changeset
59 virtual const char* name() { return "JVMCI"; }
1406
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
60
7149
6a8b22829e36 made the Graal implementation of the C++ AbstractCompiler class support native wrapper generation
Doug Simon <doug.simon@oracle.com>
parents: 7125
diff changeset
61 virtual bool supports_native() { return true; }
6962
Doug Simon <doug.simon@oracle.com>
parents: 6955
diff changeset
62 virtual bool supports_osr () { return true; }
1422
3483ec571caf * using reflected objects instead of oops
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1421
diff changeset
63
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 20028
diff changeset
64 bool is_jvmci() { return true; }
7125
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
65 bool is_c1 () { return false; }
1422
3483ec571caf * using reflected objects instead of oops
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1421
diff changeset
66 bool is_c2 () { return false; }
1406
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
67
12356
359f7e70ae7f Reduce HotSpot diff and fix previous merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 10567
diff changeset
68 bool needs_stubs () { return false; }
359f7e70ae7f Reduce HotSpot diff and fix previous merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 10567
diff changeset
69
1422
3483ec571caf * using reflected objects instead of oops
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1421
diff changeset
70 // Initialization
3483ec571caf * using reflected objects instead of oops
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1421
diff changeset
71 virtual void initialize();
3483ec571caf * using reflected objects instead of oops
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1421
diff changeset
72
23379
24505bf61633 allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents: 23303
diff changeset
73 /**
24505bf61633 allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents: 23303
diff changeset
74 * Initialize the compile queue with the methods in java.lang.Object and
24505bf61633 allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents: 23303
diff changeset
75 * then wait until the queue is empty.
24505bf61633 allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents: 23303
diff changeset
76 */
23386
2625b10989ee 8156034: update 02
Josef Eisl <josef.eisl@jku.at>
parents: 23385
diff changeset
77 void bootstrap(TRAPS);
23379
24505bf61633 allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents: 23303
diff changeset
78
24505bf61633 allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents: 23303
diff changeset
79 bool is_bootstrapping() const { return _bootstrapping; }
24505bf61633 allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents: 23303
diff changeset
80
1422
3483ec571caf * using reflected objects instead of oops
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1421
diff changeset
81 // Compilation entry point for methods
3483ec571caf * using reflected objects instead of oops
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1421
diff changeset
82 virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci);
1406
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
83
22730
24fd08e99b35 Backport Handle fixes from jvmci-9.
Roland Schatz <roland.schatz@oracle.com>
parents: 22650
diff changeset
84 void compile_method(const methodHandle& target, int entry_bci, JVMCIEnv* env);
3650
0e8a2a629afb Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3649
diff changeset
85
22575
569c82ebb96e Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22463
diff changeset
86 virtual bool is_trivial(Method* method);
569c82ebb96e Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22463
diff changeset
87
1422
3483ec571caf * using reflected objects instead of oops
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1421
diff changeset
88 // Print compilation timers and statistics
3483ec571caf * using reflected objects instead of oops
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1421
diff changeset
89 virtual void print_timers();
8945
7ef66078d837 add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents: 7568
diff changeset
90
23302
90f7b4c21cfb thread waiting for blocking JVMCI compilation should not wait on compiler queue forever (JDK-8148507)
Doug Simon <doug.simon@oracle.com>
parents: 22730
diff changeset
91 /**
23303
633cf7bea01d thread waiting for blocking JVMCI compilation should not wait on compiler queue forever (JDK-8148507) [part 2]
Doug Simon <doug.simon@oracle.com>
parents: 23302
diff changeset
92 * Gets the number of methods that have been successfully compiled by
633cf7bea01d thread waiting for blocking JVMCI compilation should not wait on compiler queue forever (JDK-8148507) [part 2]
Doug Simon <doug.simon@oracle.com>
parents: 23302
diff changeset
93 * a call to JVMCICompiler::compile_method().
23302
90f7b4c21cfb thread waiting for blocking JVMCI compilation should not wait on compiler queue forever (JDK-8148507)
Doug Simon <doug.simon@oracle.com>
parents: 22730
diff changeset
94 */
23303
633cf7bea01d thread waiting for blocking JVMCI compilation should not wait on compiler queue forever (JDK-8148507) [part 2]
Doug Simon <doug.simon@oracle.com>
parents: 23302
diff changeset
95 int methods_compiled() { return _methods_compiled; }
23302
90f7b4c21cfb thread waiting for blocking JVMCI compilation should not wait on compiler queue forever (JDK-8148507)
Doug Simon <doug.simon@oracle.com>
parents: 22730
diff changeset
96
18171
9bb816169777 Report code install timer in hosted mode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17374
diff changeset
97 // Print compilation timers and statistics
9bb816169777 Report code install timer in hosted mode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17374
diff changeset
98 static void print_compilation_timers();
9bb816169777 Report code install timer in hosted mode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17374
diff changeset
99
17374
4a6e24a8fc2c Track code installation time
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16399
diff changeset
100 static elapsedTimer* codeInstallTimer() { return &_codeInstallTimer; }
1422
3483ec571caf * using reflected objects instead of oops
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1421
diff changeset
101 };
1406
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
102
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 20028
diff changeset
103 #endif // SHARE_VM_JVMCI_JVMCI_COMPILER_HPP