Mercurial > hg > truffle
annotate src/share/vm/compiler/abstractCompiler.hpp @ 7511:b5316e551965
reapply fix from 8f7be0c45a82
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Tue, 22 Jan 2013 15:08:08 +0100 |
parents | 5d0bb7d52783 |
children | 140d4d4ab3b9 |
rev | line source |
---|---|
0 | 1 /* |
6842
b9a9ed0f8eeb
7197424: update copyright year to match last edit in jdk8 hotspot repository
mikael
parents:
6197
diff
changeset
|
2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP |
26 #define SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP | |
27 | |
28 #include "ci/compilerInterface.hpp" | |
29 | |
0 | 30 typedef void (*initializer)(void); |
31 | |
6197 | 32 class AbstractCompiler : public CHeapObj<mtCompiler> { |
0 | 33 private: |
34 bool _is_initialized; // Mark whether compiler object is initialized | |
35 | |
36 protected: | |
37 // Used for tracking global state of compiler runtime initialization | |
38 enum { uninitialized, initializing, initialized }; | |
39 | |
7154
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7149
diff
changeset
|
40 // The (closed set) of concrete compiler classes. Using an tag like this |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7149
diff
changeset
|
41 // avoids a confusing use of macros around the definition of the |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7149
diff
changeset
|
42 // 'is_<compiler type>' methods. |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7149
diff
changeset
|
43 enum Type { c1, c2, shark, graal }; |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7149
diff
changeset
|
44 |
0 | 45 // This method will call the initialization method "f" once (per compiler class/subclass) |
46 // and do so without holding any locks | |
47 void initialize_runtimes(initializer f, volatile int* state); | |
48 | |
7154
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7149
diff
changeset
|
49 private: |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7149
diff
changeset
|
50 Type _type; |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7149
diff
changeset
|
51 |
0 | 52 public: |
7154
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7149
diff
changeset
|
53 AbstractCompiler(Type type) : _is_initialized(false), _type(type) {} |
0 | 54 |
55 // Name of this compiler | |
56 virtual const char* name() = 0; | |
57 | |
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
|
58 // Should a native wrapper be generated by the runtime. This method |
6a8b22829e36
made the Graal implementation of the C++ AbstractCompiler class support native wrapper generation
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
59 // does *not* answer the question "can this compiler generate code for |
6a8b22829e36
made the Graal implementation of the C++ AbstractCompiler class support native wrapper generation
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
60 // a native method". |
0 | 61 virtual bool supports_native() { return true; } |
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
|
62 |
0 | 63 virtual bool supports_osr () { return true; } |
7154
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7149
diff
changeset
|
64 bool is_c1 () { return _type == c1; } |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7149
diff
changeset
|
65 bool is_c2 () { return _type == c2; } |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7149
diff
changeset
|
66 bool is_shark() { return _type == shark; } |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7149
diff
changeset
|
67 bool is_graal() { return _type == graal; } |
0 | 68 |
69 void mark_initialized() { _is_initialized = true; } | |
70 bool is_initialized() { return _is_initialized; } | |
71 | |
72 virtual void initialize() = 0; | |
73 | |
74 // Compilation entry point for methods | |
75 virtual void compile_method(ciEnv* env, | |
76 ciMethod* target, | |
77 int entry_bci) { | |
78 ShouldNotReachHere(); | |
79 } | |
80 | |
81 | |
82 // Print compilation timers and statistics | |
83 virtual void print_timers() { | |
84 ShouldNotReachHere(); | |
85 } | |
86 }; | |
1972 | 87 |
88 #endif // SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP |