comparison src/share/vm/jvmci/jvmciCompiler.hpp @ 21559:be896a1983c0

recast all Graal native code as JVMCI code (JBS:GRAAL-53)
author Doug Simon <doug.simon@oracle.com>
date Thu, 28 May 2015 15:36:48 +0200
parents src/share/vm/graal/graalCompiler.hpp@104304a54b0c
children d9f5c93a83d3
comparison
equal deleted inserted replaced
21558:d563baeca9df 21559:be896a1983c0
1 /*
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 #ifndef SHARE_VM_JVMCI_JVMCI_COMPILER_HPP
25 #define SHARE_VM_JVMCI_JVMCI_COMPILER_HPP
26
27 #include "compiler/abstractCompiler.hpp"
28 #include "jvmci/jvmciEnv.hpp"
29
30 class JVMCICompiler : public AbstractCompiler {
31
32 private:
33
34 #ifdef COMPILERJVMCI
35 bool _bootstrapping;
36
37 /**
38 * Number of methods compiled by JVMCI. This is not synchronized
39 * so may not be 100% accurate.
40 */
41 volatile int _methodsCompiled;
42
43 #endif
44
45 static JVMCICompiler* _instance;
46
47 static elapsedTimer _codeInstallTimer;
48
49 public:
50
51 JVMCICompiler();
52
53 static JVMCICompiler* instance() { return _instance; }
54
55 virtual const char* name() { return "JVMCI"; }
56
57 virtual bool supports_native() { return true; }
58 virtual bool supports_osr () { return true; }
59
60 bool is_jvmci() { return true; }
61 bool is_c1 () { return false; }
62 bool is_c2 () { return false; }
63
64 bool needs_stubs () { return false; }
65
66 // Initialization
67 virtual void initialize();
68
69 #ifdef COMPILERJVMCI
70
71 void bootstrap();
72
73 // Compilation entry point for methods
74 virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci);
75
76 void compile_method(methodHandle target, int entry_bci, JVMCIEnv* env);
77
78 // Print compilation timers and statistics
79 virtual void print_timers();
80
81 // Print compilation statistics
82 void reset_compilation_stats();
83 #endif // COMPILERJVMCI
84
85 // Print compilation timers and statistics
86 static void print_compilation_timers();
87
88 static elapsedTimer* codeInstallTimer() { return &_codeInstallTimer; }
89
90 void compile_the_world();
91 };
92
93 #endif // SHARE_VM_JVMCI_JVMCI_COMPILER_HPP