Mercurial > hg > truffle
annotate src/share/vm/graal/graalRuntime.hpp @ 14714:b602356a9cfc
additional canonicalizers for accesses and value nodes (improves number of implicit null checks)
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Thu, 20 Mar 2014 17:15:36 +0100 |
parents | d8143c431d63 |
children | 0cb5c4d276d4 |
rev | line source |
---|---|
5526
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
4 * |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
8 * |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
14 * |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
18 * |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
21 * questions. |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
22 */ |
87e4aed94b26
Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
23 |
5747
120820e30baa
added basic high-level interpreter support to HotSpot
Christian Haeubl <haeubl@ssw.jku.at>
parents:
5526
diff
changeset
|
24 #ifndef SHARE_VM_GRAAL_GRAAL_RUNTIME_HPP |
120820e30baa
added basic high-level interpreter support to HotSpot
Christian Haeubl <haeubl@ssw.jku.at>
parents:
5526
diff
changeset
|
25 #define SHARE_VM_GRAAL_GRAAL_RUNTIME_HPP |
120820e30baa
added basic high-level interpreter support to HotSpot
Christian Haeubl <haeubl@ssw.jku.at>
parents:
5526
diff
changeset
|
26 |
7125
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
27 #include "interpreter/interpreter.hpp" |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
28 #include "memory/allocation.hpp" |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
29 #include "runtime/deoptimization.hpp" |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
30 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
31 class GraalRuntime: public AllStatic { |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
32 public: |
9352
d4684b468e93
made NewInstanceStub a RuntimeStub that directly calls the C runtime (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9338
diff
changeset
|
33 static void new_instance(JavaThread* thread, Klass* klass); |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9232
diff
changeset
|
34 static void new_array(JavaThread* thread, Klass* klass, jint length); |
9355
4e260c2ced0e
removed new_multi_array assembler stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9354
diff
changeset
|
35 static void new_multi_array(JavaThread* thread, Klass* klass, int rank, jint* dims); |
12423
370b5f07f9e2
The runtime entries need to use oopDesc* rather than oop in their signature
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10953
diff
changeset
|
36 static void dynamic_new_array(JavaThread* thread, oopDesc* element_mirror, jint length); |
13578
d8143c431d63
Add DynamicNewInstanceNode and use it to intrinsify Unsafe.allocateInstance
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
12435
diff
changeset
|
37 static void dynamic_new_instance(JavaThread* thread, oopDesc* type_mirror); |
12423
370b5f07f9e2
The runtime entries need to use oopDesc* rather than oop in their signature
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10953
diff
changeset
|
38 static jboolean thread_is_interrupted(JavaThread* thread, oopDesc* obj, jboolean clear_interrupted); |
9471
5fa54bf57f8c
replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9463
diff
changeset
|
39 static void vm_message(jboolean vmError, jlong format, jlong v1, jlong v2, jlong v3); |
12423
370b5f07f9e2
The runtime entries need to use oopDesc* rather than oop in their signature
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10953
diff
changeset
|
40 static jint identity_hash_code(JavaThread* thread, oopDesc* obj); |
9471
5fa54bf57f8c
replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9463
diff
changeset
|
41 static address exception_handler_for_pc(JavaThread* thread); |
9590
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9581
diff
changeset
|
42 static void monitorenter(JavaThread* thread, oopDesc* obj, BasicLock* lock); |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9581
diff
changeset
|
43 static void monitorexit (JavaThread* thread, oopDesc* obj, BasicLock* lock); |
9591
0381c7937e7a
replaced create_null_pointer_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9590
diff
changeset
|
44 static void create_null_exception(JavaThread* thread); |
9592
efb8c1918ea5
replaced create_out_of_bounds_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9591
diff
changeset
|
45 static void create_out_of_bounds_exception(JavaThread* thread, jint index); |
12423
370b5f07f9e2
The runtime entries need to use oopDesc* rather than oop in their signature
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10953
diff
changeset
|
46 static void vm_error(JavaThread* thread, oopDesc* where, oopDesc* format, jlong value); |
370b5f07f9e2
The runtime entries need to use oopDesc* rather than oop in their signature
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10953
diff
changeset
|
47 static oopDesc* load_and_clear_exception(JavaThread* thread); |
370b5f07f9e2
The runtime entries need to use oopDesc* rather than oop in their signature
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10953
diff
changeset
|
48 static void log_printf(JavaThread* thread, oopDesc* format, jlong v1, jlong v2, jlong v3); |
9592
efb8c1918ea5
replaced create_out_of_bounds_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9591
diff
changeset
|
49 static void log_primitive(JavaThread* thread, jchar typeChar, jlong value, jboolean newline); |
9593
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
50 // Note: Must be kept in sync with constants in com.oracle.graal.replacements.Log |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
51 enum { |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
52 LOG_OBJECT_NEWLINE = 0x01, |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
53 LOG_OBJECT_STRING = 0x02, |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
54 LOG_OBJECT_ADDRESS = 0x04 |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
55 }; |
12423
370b5f07f9e2
The runtime entries need to use oopDesc* rather than oop in their signature
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10953
diff
changeset
|
56 static void log_object(JavaThread* thread, oopDesc* msg, jint flags); |
10434
8b22524df53b
Add G1 Barriers' foreign calls
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
10072
diff
changeset
|
57 static void write_barrier_pre(JavaThread* thread, oopDesc* obj); |
8b22524df53b
Add G1 Barriers' foreign calls
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
10072
diff
changeset
|
58 static void write_barrier_post(JavaThread* thread, void* card); |
10953
97e282186b5b
Add heap sanity checker with premature hard crash for debugging write barriers
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
10770
diff
changeset
|
59 static jboolean validate_object(JavaThread* thread, oopDesc* parent, oopDesc* child); |
12433
808348377021
Fix inconsistent oops in slow path allocation
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
10953
diff
changeset
|
60 static void new_store_pre_barrier(JavaThread* thread); |
7125
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
61 }; |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
62 |
5747
120820e30baa
added basic high-level interpreter support to HotSpot
Christian Haeubl <haeubl@ssw.jku.at>
parents:
5526
diff
changeset
|
63 #endif // SHARE_VM_GRAAL_GRAAL_RUNTIME_HPP |