Mercurial > hg > truffle
comparison src/share/vm/graal/graalCompiler.hpp @ 2890:c23d45daff9b
Renamed cpp/hpp file directory.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 08 Jun 2011 13:40:25 +0200 |
parents | src/share/vm/c1x/graalCompiler.hpp@2fb867285938 |
children | 75a99b4f1c98 |
comparison
equal
deleted
inserted
replaced
2889:2fb867285938 | 2890:c23d45daff9b |
---|---|
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 #include "compiler/abstractCompiler.hpp" | |
25 | |
26 class C1XCompiler : public AbstractCompiler { | |
27 | |
28 private: | |
29 | |
30 bool _initialized; | |
31 | |
32 static C1XCompiler* _instance; | |
33 | |
34 public: | |
35 | |
36 C1XCompiler(); | |
37 | |
38 static C1XCompiler* instance() { return _instance; } | |
39 | |
40 | |
41 virtual const char* name() { return "C1X"; } | |
42 | |
43 // Native / OSR not supported | |
44 virtual bool supports_native() { return false; } | |
45 virtual bool supports_osr () { return false; } | |
46 | |
47 // Pretend to be C1 | |
48 bool is_c1 () { return true; } | |
49 bool is_c2 () { return false; } | |
50 | |
51 // Initialization | |
52 virtual void initialize(); | |
53 | |
54 // Compilation entry point for methods | |
55 virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci); | |
56 | |
57 // Print compilation timers and statistics | |
58 virtual void print_timers(); | |
59 | |
60 static oop get_RiType(ciType *klass, KlassHandle accessor, TRAPS); | |
61 static oop get_RiField(ciField *ciField, ciInstanceKlass* accessor_klass, KlassHandle accessor, Bytecodes::Code byteCode, TRAPS); | |
62 | |
63 static oop createHotSpotTypeResolved(KlassHandle klass, Handle name, TRAPS); | |
64 | |
65 static BasicType kindToBasicType(jchar ch); | |
66 | |
67 static int to_cp_index_u2(int index) { | |
68 // Swap. | |
69 index = ((index & 0xFF) << 8) | (index >> 8); | |
70 // Tag. | |
71 index = index + constantPoolOopDesc::CPCACHE_INDEX_TAG; | |
72 return index; | |
73 } | |
74 | |
75 private: | |
76 | |
77 void initialize_buffer_blob(); | |
78 }; | |
79 | |
80 // Tracing macros | |
81 | |
82 #define IF_TRACE_C1X_1 if (!(TraceC1X >= 1)) ; else | |
83 #define IF_TRACE_C1X_2 if (!(TraceC1X >= 2)) ; else | |
84 #define IF_TRACE_C1X_3 if (!(TraceC1X >= 3)) ; else | |
85 #define IF_TRACE_C1X_4 if (!(TraceC1X >= 4)) ; else | |
86 #define IF_TRACE_C1X_5 if (!(TraceC1X >= 5)) ; else | |
87 | |
88 // using commas and else to keep one-instruction semantics | |
89 | |
90 #define TRACE_C1X_1 if (!(TraceC1X >= 1 && (tty->print("TraceC1X-1: "), true))) ; else tty->print_cr | |
91 #define TRACE_C1X_2 if (!(TraceC1X >= 2 && (tty->print(" TraceC1X-2: "), true))) ; else tty->print_cr | |
92 #define TRACE_C1X_3 if (!(TraceC1X >= 3 && (tty->print(" TraceC1X-3: "), true))) ; else tty->print_cr | |
93 #define TRACE_C1X_4 if (!(TraceC1X >= 4 && (tty->print(" TraceC1X-4: "), true))) ; else tty->print_cr | |
94 #define TRACE_C1X_5 if (!(TraceC1X >= 5 && (tty->print(" TraceC1X-5: "), true))) ; else tty->print_cr | |
95 | |
96 | |
97 |