annotate src/share/vm/c1x/c1x_Compiler.hpp @ 1421:6223633ce7dd

changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
author Lukas Stadler <lukas.stadler@oracle.com>
date Fri, 23 Jul 2010 15:53:02 -0700
parents 55ac38887415
children 3483ec571caf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1410
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
1 /*
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
2 * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved.
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
4 *
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
7 * published by the Free Software Foundation.
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
8 *
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
13 * accompanied this code).
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
14 *
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
15 * You should have received a copy of the GNU General Public License version
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
18 *
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
21 * have any questions.
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 */
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
24
1406
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
25 class C1XCompiler : public AbstractCompiler {
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
26
1414
e1a275dbc8cd Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1413
diff changeset
27 private:
e1a275dbc8cd Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1413
diff changeset
28
1418
55ac38887415 modifications for linux: argument register layout, makefile
Lukas Stadler <lukas.stadler@jku.at>
parents: 1414
diff changeset
29 bool _initialized;
1414
e1a275dbc8cd Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1413
diff changeset
30
1406
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
31 public:
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
32
1414
e1a275dbc8cd Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1413
diff changeset
33 C1XCompiler() { _initialized = false; }
e1a275dbc8cd Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1413
diff changeset
34
1406
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
35 virtual const char* name() { return "C1X"; }
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
36
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
37 // Native / OSR not supported
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
38 virtual bool supports_native() { return false; }
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
39 virtual bool supports_osr () { return false; }
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
40
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
41 // Pretend to be C1
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
42 bool is_c1 () { return true; }
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
43 bool is_c2 () { return false; }
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
44
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
45 // Initialization
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
46 virtual void initialize();
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
47
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
48 // Compilation entry point for methods
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
49 virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci);
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
50
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
51 // Print compilation timers and statistics
1410
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
52 virtual void print_timers();
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
53
1413
1ecc8f0aad00 Draft implementation of HotSpot CRI / first method compiling without exception.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1410
diff changeset
54 static oop get_RiMethod(ciMethod *ciMethod);
1ecc8f0aad00 Draft implementation of HotSpot CRI / first method compiling without exception.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1410
diff changeset
55 static oop get_RiField(ciField *ciField);
1ecc8f0aad00 Draft implementation of HotSpot CRI / first method compiling without exception.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1410
diff changeset
56 static oop get_RiType(ciType *klass);
1ecc8f0aad00 Draft implementation of HotSpot CRI / first method compiling without exception.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1410
diff changeset
57 static oop get_RiType(klassOop klass);
1ecc8f0aad00 Draft implementation of HotSpot CRI / first method compiling without exception.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1410
diff changeset
58 static oop get_RiMethod(methodOop method);
1ecc8f0aad00 Draft implementation of HotSpot CRI / first method compiling without exception.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1410
diff changeset
59 static oop get_RiType(symbolOop klass, klassOop accessingType);
1ecc8f0aad00 Draft implementation of HotSpot CRI / first method compiling without exception.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1410
diff changeset
60 static oop get_unresolved_RiType(symbolOop klass, klassOop accessingType);
1ecc8f0aad00 Draft implementation of HotSpot CRI / first method compiling without exception.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1410
diff changeset
61 static oop get_RiConstantPool(constantPoolOop cpOop);
1410
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
62 };
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
63
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
64 // Tracing macros
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
65
1406
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
66 #define IF_TRACE_C1X_1 if (TraceC1X >= 1)
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
67 #define IF_TRACE_C1X_2 if (TraceC1X >= 2)
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
68 #define IF_TRACE_C1X_3 if (TraceC1X >= 3)
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
69 #define IF_TRACE_C1X_4 if (TraceC1X >= 4)
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
70 #define IF_TRACE_C1X_5 if (TraceC1X >= 5)
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
71
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
72 #define TRACE_C1X_1 if (TraceC1X >= 1) tty->print("TraceC1X-1: "); if (TraceC1X >= 1) tty->print_cr
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
73 #define TRACE_C1X_2 if (TraceC1X >= 2) tty->print(" TraceC1X-2: "); if (TraceC1X >= 2) tty->print_cr
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
74 #define TRACE_C1X_3 if (TraceC1X >= 3) tty->print(" TraceC1X-3: "); if (TraceC1X >= 3) tty->print_cr
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
75 #define TRACE_C1X_4 if (TraceC1X >= 4) tty->print(" TraceC1X-4: "); if (TraceC1X >= 4) tty->print_cr
1418
55ac38887415 modifications for linux: argument register layout, makefile
Lukas Stadler <lukas.stadler@jku.at>
parents: 1414
diff changeset
76 #define TRACE_C1X_5 if (TraceC1X >= 5) tty->print(" TraceC1X-5: "); if (TraceC1X >= 5) tty->print_cr