Mercurial > hg > truffle
annotate src/share/vm/graal/graalRuntime.hpp @ 7555:9c6602e65423
Updated .hgignore file to also ignore IntelliJ project files.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 25 Jan 2013 11:11:32 +0100 |
parents | a6bd253a770f |
children | 983f7bdb85ff 92d21814cf7b |
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 "code/stubs.hpp" |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
28 #include "interpreter/interpreter.hpp" |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
29 #include "memory/allocation.hpp" |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
30 #include "runtime/deoptimization.hpp" |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
31 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
32 // A GraalStubAssembler is a MacroAssembler w/ extra functionality for runtime |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
33 // stubs. Currently it 'knows' some stub info. Eventually, the information |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
34 // may be set automatically or can be asserted when using specialised |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
35 // GraalStubAssembler functions. |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
36 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
37 class GraalStubAssembler: public MacroAssembler { |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
38 private: |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
39 const char* _name; |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
40 bool _must_gc_arguments; |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
41 int _frame_size; |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
42 int _num_rt_args; |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
43 int _stub_id; |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
44 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
45 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:
7145
diff
changeset
|
46 |
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:
7145
diff
changeset
|
47 enum { |
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:
7145
diff
changeset
|
48 no_frame_size = -1 |
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:
7145
diff
changeset
|
49 }; |
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:
7145
diff
changeset
|
50 |
7125
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
51 // creation |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
52 GraalStubAssembler(CodeBuffer* code, const char * name, int stub_id); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
53 void set_info(const char* name, bool must_gc_arguments); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
54 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
55 void set_frame_size(int size); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
56 void set_num_rt_args(int args); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
57 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
58 // accessors |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
59 const char* name() const { return _name; } |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
60 bool must_gc_arguments() const { return _must_gc_arguments; } |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
61 int frame_size() const { return _frame_size; } |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
62 int num_rt_args() const { return _num_rt_args; } |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
63 int stub_id() const { return _stub_id; } |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
64 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
65 void verify_stack_oop(int offset) PRODUCT_RETURN; |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
66 void verify_not_null_oop(Register r) PRODUCT_RETURN; |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
67 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
68 // runtime calls (return offset of call to be used by GC map) |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
69 int call_RT(Register oop_result1, Register metadata_result, address entry, int args_size = 0); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
70 int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
71 int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
72 int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2, Register arg3); |
7235
a6bd253a770f
expanded LOG_PRINTF stub to handle up to 3 arguments in addition to the format string
Doug Simon <doug.simon@oracle.com>
parents:
7226
diff
changeset
|
73 int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2, Register arg3, Register arg4); |
7125
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
74 }; |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
75 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
76 // set frame size and return address offset to these values in blobs |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
77 // (if the compiled frame uses ebp as link pointer on IA; otherwise, |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
78 // the frame size must be fixed) |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
79 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
80 // Holds all assembly stubs and VM |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
81 // runtime routines needed by code code generated |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
82 // by Graal. |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
83 #define GRAAL_STUBS(stub, last_entry) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
84 stub(graal_register_finalizer) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
85 stub(graal_new_instance) \ |
7145
6c46172c04bf
consolidated new_type_array and new_object_array stubs into one as there no difference between them
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
86 stub(graal_new_array) \ |
7125
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
87 stub(graal_new_multi_array) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
88 stub(graal_handle_exception_nofpu) /* optimized version that does not preserve fpu registers */ \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
89 stub(graal_slow_subtype_check) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
90 stub(graal_unwind_exception_call) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
91 stub(graal_OSR_migration_end) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
92 stub(graal_arithmetic_frem) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
93 stub(graal_arithmetic_drem) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
94 stub(graal_monitorenter) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
95 stub(graal_monitorexit) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
96 stub(graal_verify_oop) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
97 stub(graal_vm_error) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
98 stub(graal_set_deopt_info) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
99 stub(graal_create_null_pointer_exception) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
100 stub(graal_create_out_of_bounds_exception) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
101 stub(graal_log_object) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
102 stub(graal_log_printf) \ |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
103 stub(graal_log_primitive) \ |
7220
fcae6d960acd
added more compiler intrinsics
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7125
diff
changeset
|
104 stub(graal_identity_hash_code) \ |
fcae6d960acd
added more compiler intrinsics
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7125
diff
changeset
|
105 stub(graal_thread_is_interrupted) \ |
7125
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
106 last_entry(number_of_ids) |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
107 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
108 #define DECLARE_STUB_ID(x) x ## _id , |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
109 #define DECLARE_LAST_STUB_ID(x) x |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
110 #define STUB_NAME(x) #x " GraalRuntime stub", |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
111 #define LAST_STUB_NAME(x) #x " GraalRuntime stub" |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
112 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
113 class GraalRuntime: public AllStatic { |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
114 friend class VMStructs; |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
115 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
116 public: |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
117 enum StubID { |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
118 GRAAL_STUBS(DECLARE_STUB_ID, DECLARE_LAST_STUB_ID) |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
119 }; |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
120 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
121 private: |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
122 static CodeBlob* _blobs[number_of_ids]; |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
123 static const char* _blob_names[]; |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
124 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
125 // stub generation |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
126 static void generate_blob_for(BufferBlob* blob, StubID id); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
127 static OopMapSet* generate_code_for(StubID id, GraalStubAssembler* sasm); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
128 static OopMapSet* generate_handle_exception(StubID id, GraalStubAssembler* sasm); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
129 static void generate_unwind_exception(GraalStubAssembler *sasm); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
130 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
131 static OopMapSet* generate_stub_call(GraalStubAssembler* sasm, Register result, address entry, |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
132 Register arg1 = noreg, Register arg2 = noreg, Register arg3 = noreg); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
133 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
134 // runtime entry points |
7145
6c46172c04bf
consolidated new_type_array and new_object_array stubs into one as there no difference between them
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
135 static void new_instance(JavaThread* thread, Klass* klass); |
6c46172c04bf
consolidated new_type_array and new_object_array stubs into one as there no difference between them
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
136 static void new_array(JavaThread* thread, Klass* klass, jint length); |
6c46172c04bf
consolidated new_type_array and new_object_array stubs into one as there no difference between them
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
137 static void new_multi_array(JavaThread* thread, Klass* klass, int rank, jint* dims); |
7125
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
138 |
7145
6c46172c04bf
consolidated new_type_array and new_object_array stubs into one as there no difference between them
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
139 static void unimplemented_entry(JavaThread* thread, StubID id); |
7125
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
140 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
141 static address exception_handler_for_pc(JavaThread* thread); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
142 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
143 static void graal_create_null_exception(JavaThread* thread); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
144 static void graal_create_out_of_bounds_exception(JavaThread* thread, jint index); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
145 static void graal_monitorenter(JavaThread* thread, oopDesc* obj, BasicLock* lock); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
146 static void graal_monitorexit (JavaThread* thread, oopDesc* obj, BasicLock* lock); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
147 static void graal_vm_error(JavaThread* thread, oop where, oop format, jlong value); |
7235
a6bd253a770f
expanded LOG_PRINTF stub to handle up to 3 arguments in addition to the format string
Doug Simon <doug.simon@oracle.com>
parents:
7226
diff
changeset
|
148 static void graal_log_printf(JavaThread* thread, oop format, jlong v1, jlong v2, jlong v3); |
7125
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
149 static void graal_log_primitive(JavaThread* thread, jchar typeChar, jlong value, jboolean newline); |
7220
fcae6d960acd
added more compiler intrinsics
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7125
diff
changeset
|
150 |
fcae6d960acd
added more compiler intrinsics
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7125
diff
changeset
|
151 static jint graal_identity_hash_code(JavaThread* thread, oopDesc* objd); |
fcae6d960acd
added more compiler intrinsics
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7125
diff
changeset
|
152 static jboolean graal_thread_is_interrupted(JavaThread* thread, oopDesc* obj, jboolean clear_interrupte); |
7125
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
153 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
154 // Note: Must be kept in sync with constants in com.oracle.graal.snippets.Log |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
155 enum { |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
156 LOG_OBJECT_NEWLINE = 0x01, |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
157 LOG_OBJECT_STRING = 0x02, |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
158 LOG_OBJECT_ADDRESS = 0x04 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
159 }; |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
160 static void graal_log_object(JavaThread* thread, oop msg, jint flags); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
161 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
162 public: |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
163 // initialization |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
164 static void initialize(BufferBlob* blob); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
165 |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
166 // stubs |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
167 static CodeBlob* blob_for (StubID id); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
168 static address entry_for(StubID id) { return blob_for(id)->code_begin(); } |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
169 static const char* name_for (StubID id); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
170 static const char* name_for_address(address entry); |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
171 }; |
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6559
diff
changeset
|
172 |
5747
120820e30baa
added basic high-level interpreter support to HotSpot
Christian Haeubl <haeubl@ssw.jku.at>
parents:
5526
diff
changeset
|
173 #endif // SHARE_VM_GRAAL_GRAAL_RUNTIME_HPP |