annotate src/share/vm/opto/runtime.hpp @ 20313:b20a35eae442

8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC Summary: Add C2 SHA intrinsics on SPARC Reviewed-by: kvn, roland Contributed-by: james.cheng@oracle.com
author kvn
date Wed, 11 Jun 2014 11:05:10 -0700
parents 606acabe7b5c
children 166d744df0de
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
20313
b20a35eae442 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 17780
diff changeset
2 * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1166
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1166
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: 1166
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1763
diff changeset
25 #ifndef SHARE_VM_OPTO_RUNTIME_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1763
diff changeset
26 #define SHARE_VM_OPTO_RUNTIME_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1763
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1763
diff changeset
28 #include "code/codeBlob.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1763
diff changeset
29 #include "opto/machnode.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1763
diff changeset
30 #include "opto/type.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1763
diff changeset
31 #include "runtime/biasedLocking.hpp"
17780
606acabe7b5c 8031320: Use Intel RTM instructions for locks
kvn
parents: 12880
diff changeset
32 #include "runtime/rtmLocking.hpp"
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1763
diff changeset
33 #include "runtime/deoptimization.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1763
diff changeset
34 #include "runtime/vframe.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1763
diff changeset
35
0
a61af66fc99e Initial load
duke
parents:
diff changeset
36 //------------------------------OptoRuntime------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
37 // Opto compiler runtime routines
a61af66fc99e Initial load
duke
parents:
diff changeset
38 //
a61af66fc99e Initial load
duke
parents:
diff changeset
39 // These are all generated from Ideal graphs. They are called with the
a61af66fc99e Initial load
duke
parents:
diff changeset
40 // Java calling convention. Internally they call C++. They are made once at
a61af66fc99e Initial load
duke
parents:
diff changeset
41 // startup time and Opto compiles calls to them later.
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // Things are broken up into quads: the signature they will be called with,
a61af66fc99e Initial load
duke
parents:
diff changeset
43 // the address of the generated code, the corresponding C++ code and an
a61af66fc99e Initial load
duke
parents:
diff changeset
44 // nmethod.
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 // The signature (returned by "xxx_Type()") is used at startup time by the
a61af66fc99e Initial load
duke
parents:
diff changeset
47 // Generator to make the generated code "xxx_Java". Opto compiles calls
a61af66fc99e Initial load
duke
parents:
diff changeset
48 // to the generated code "xxx_Java". When the compiled code gets executed,
a61af66fc99e Initial load
duke
parents:
diff changeset
49 // it calls the C++ code "xxx_C". The generated nmethod is saved in the
a61af66fc99e Initial load
duke
parents:
diff changeset
50 // CodeCache. Exception handlers use the nmethod to get the callee-save
a61af66fc99e Initial load
duke
parents:
diff changeset
51 // register OopMaps.
a61af66fc99e Initial load
duke
parents:
diff changeset
52 class CallInfo;
a61af66fc99e Initial load
duke
parents:
diff changeset
53
a61af66fc99e Initial load
duke
parents:
diff changeset
54 //
a61af66fc99e Initial load
duke
parents:
diff changeset
55 // NamedCounters are tagged counters which can be used for profiling
a61af66fc99e Initial load
duke
parents:
diff changeset
56 // code in various ways. Currently they are used by the lock coarsening code
a61af66fc99e Initial load
duke
parents:
diff changeset
57 //
a61af66fc99e Initial load
duke
parents:
diff changeset
58
6197
d2a62e0f25eb 6995781: Native Memory Tracking (Phase 1)
zgu
parents: 6006
diff changeset
59 class NamedCounter : public CHeapObj<mtCompiler> {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
60 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
61 enum CounterTag {
a61af66fc99e Initial load
duke
parents:
diff changeset
62 NoTag,
a61af66fc99e Initial load
duke
parents:
diff changeset
63 LockCounter,
a61af66fc99e Initial load
duke
parents:
diff changeset
64 EliminatedLockCounter,
17780
606acabe7b5c 8031320: Use Intel RTM instructions for locks
kvn
parents: 12880
diff changeset
65 BiasedLockingCounter,
606acabe7b5c 8031320: Use Intel RTM instructions for locks
kvn
parents: 12880
diff changeset
66 RTMLockingCounter
0
a61af66fc99e Initial load
duke
parents:
diff changeset
67 };
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
70 const char * _name;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 int _count;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 CounterTag _tag;
a61af66fc99e Initial load
duke
parents:
diff changeset
73 NamedCounter* _next;
a61af66fc99e Initial load
duke
parents:
diff changeset
74
a61af66fc99e Initial load
duke
parents:
diff changeset
75 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
76 NamedCounter(const char *n, CounterTag tag = NoTag):
a61af66fc99e Initial load
duke
parents:
diff changeset
77 _name(n),
a61af66fc99e Initial load
duke
parents:
diff changeset
78 _count(0),
a61af66fc99e Initial load
duke
parents:
diff changeset
79 _next(NULL),
a61af66fc99e Initial load
duke
parents:
diff changeset
80 _tag(tag) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82 const char * name() const { return _name; }
a61af66fc99e Initial load
duke
parents:
diff changeset
83 int count() const { return _count; }
a61af66fc99e Initial load
duke
parents:
diff changeset
84 address addr() { return (address)&_count; }
a61af66fc99e Initial load
duke
parents:
diff changeset
85 CounterTag tag() const { return _tag; }
a61af66fc99e Initial load
duke
parents:
diff changeset
86 void set_tag(CounterTag tag) { _tag = tag; }
a61af66fc99e Initial load
duke
parents:
diff changeset
87
a61af66fc99e Initial load
duke
parents:
diff changeset
88 NamedCounter* next() const { return _next; }
a61af66fc99e Initial load
duke
parents:
diff changeset
89 void set_next(NamedCounter* next) {
17780
606acabe7b5c 8031320: Use Intel RTM instructions for locks
kvn
parents: 12880
diff changeset
90 assert(_next == NULL || next == NULL, "already set");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
91 _next = next;
a61af66fc99e Initial load
duke
parents:
diff changeset
92 }
a61af66fc99e Initial load
duke
parents:
diff changeset
93
a61af66fc99e Initial load
duke
parents:
diff changeset
94 };
a61af66fc99e Initial load
duke
parents:
diff changeset
95
a61af66fc99e Initial load
duke
parents:
diff changeset
96 class BiasedLockingNamedCounter : public NamedCounter {
a61af66fc99e Initial load
duke
parents:
diff changeset
97 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
98 BiasedLockingCounters _counters;
a61af66fc99e Initial load
duke
parents:
diff changeset
99
a61af66fc99e Initial load
duke
parents:
diff changeset
100 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
101 BiasedLockingNamedCounter(const char *n) :
a61af66fc99e Initial load
duke
parents:
diff changeset
102 NamedCounter(n, BiasedLockingCounter), _counters() {}
a61af66fc99e Initial load
duke
parents:
diff changeset
103
a61af66fc99e Initial load
duke
parents:
diff changeset
104 BiasedLockingCounters* counters() { return &_counters; }
a61af66fc99e Initial load
duke
parents:
diff changeset
105 };
a61af66fc99e Initial load
duke
parents:
diff changeset
106
17780
606acabe7b5c 8031320: Use Intel RTM instructions for locks
kvn
parents: 12880
diff changeset
107
606acabe7b5c 8031320: Use Intel RTM instructions for locks
kvn
parents: 12880
diff changeset
108 class RTMLockingNamedCounter : public NamedCounter {
606acabe7b5c 8031320: Use Intel RTM instructions for locks
kvn
parents: 12880
diff changeset
109 private:
606acabe7b5c 8031320: Use Intel RTM instructions for locks
kvn
parents: 12880
diff changeset
110 RTMLockingCounters _counters;
606acabe7b5c 8031320: Use Intel RTM instructions for locks
kvn
parents: 12880
diff changeset
111
606acabe7b5c 8031320: Use Intel RTM instructions for locks
kvn
parents: 12880
diff changeset
112 public:
606acabe7b5c 8031320: Use Intel RTM instructions for locks
kvn
parents: 12880
diff changeset
113 RTMLockingNamedCounter(const char *n) :
606acabe7b5c 8031320: Use Intel RTM instructions for locks
kvn
parents: 12880
diff changeset
114 NamedCounter(n, RTMLockingCounter), _counters() {}
606acabe7b5c 8031320: Use Intel RTM instructions for locks
kvn
parents: 12880
diff changeset
115
606acabe7b5c 8031320: Use Intel RTM instructions for locks
kvn
parents: 12880
diff changeset
116 RTMLockingCounters* counters() { return &_counters; }
606acabe7b5c 8031320: Use Intel RTM instructions for locks
kvn
parents: 12880
diff changeset
117 };
606acabe7b5c 8031320: Use Intel RTM instructions for locks
kvn
parents: 12880
diff changeset
118
0
a61af66fc99e Initial load
duke
parents:
diff changeset
119 typedef const TypeFunc*(*TypeFunc_generator)();
a61af66fc99e Initial load
duke
parents:
diff changeset
120
a61af66fc99e Initial load
duke
parents:
diff changeset
121 class OptoRuntime : public AllStatic {
a61af66fc99e Initial load
duke
parents:
diff changeset
122 friend class Matcher; // allow access to stub names
a61af66fc99e Initial load
duke
parents:
diff changeset
123
a61af66fc99e Initial load
duke
parents:
diff changeset
124 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
125 // define stubs
a61af66fc99e Initial load
duke
parents:
diff changeset
126 static address generate_stub(ciEnv* ci_env, TypeFunc_generator gen, address C_function, const char *name, int is_fancy_jump, bool pass_tls, bool save_arguments, bool return_pc);
a61af66fc99e Initial load
duke
parents:
diff changeset
127
a61af66fc99e Initial load
duke
parents:
diff changeset
128 // References to generated stubs
a61af66fc99e Initial load
duke
parents:
diff changeset
129 static address _new_instance_Java;
a61af66fc99e Initial load
duke
parents:
diff changeset
130 static address _new_array_Java;
3961
a92cdbac8b9e 7081933: Use zeroing elimination optimization for large array
kvn
parents: 3805
diff changeset
131 static address _new_array_nozero_Java;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
132 static address _multianewarray2_Java;
a61af66fc99e Initial load
duke
parents:
diff changeset
133 static address _multianewarray3_Java;
a61af66fc99e Initial load
duke
parents:
diff changeset
134 static address _multianewarray4_Java;
a61af66fc99e Initial load
duke
parents:
diff changeset
135 static address _multianewarray5_Java;
3805
263247c478c5 7058510: multinewarray with 6 dimensions uncommon traps in server compiler
iveresov
parents: 1972
diff changeset
136 static address _multianewarrayN_Java;
342
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
137 static address _g1_wb_pre_Java;
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
138 static address _g1_wb_post_Java;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
139 static address _vtable_must_compile_Java;
a61af66fc99e Initial load
duke
parents:
diff changeset
140 static address _complete_monitor_locking_Java;
a61af66fc99e Initial load
duke
parents:
diff changeset
141 static address _rethrow_Java;
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 static address _slow_arraycopy_Java;
a61af66fc99e Initial load
duke
parents:
diff changeset
144 static address _register_finalizer_Java;
a61af66fc99e Initial load
duke
parents:
diff changeset
145
a61af66fc99e Initial load
duke
parents:
diff changeset
146 # ifdef ENABLE_ZAP_DEAD_LOCALS
a61af66fc99e Initial load
duke
parents:
diff changeset
147 static address _zap_dead_Java_locals_Java;
a61af66fc99e Initial load
duke
parents:
diff changeset
148 static address _zap_dead_native_locals_Java;
a61af66fc99e Initial load
duke
parents:
diff changeset
149 # endif
a61af66fc99e Initial load
duke
parents:
diff changeset
150
a61af66fc99e Initial load
duke
parents:
diff changeset
151
a61af66fc99e Initial load
duke
parents:
diff changeset
152 //
a61af66fc99e Initial load
duke
parents:
diff changeset
153 // Implementation of runtime methods
a61af66fc99e Initial load
duke
parents:
diff changeset
154 // =================================
a61af66fc99e Initial load
duke
parents:
diff changeset
155
a61af66fc99e Initial load
duke
parents:
diff changeset
156 // Allocate storage for a Java instance.
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6197
diff changeset
157 static void new_instance_C(Klass* instance_klass, JavaThread *thread);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
158
a61af66fc99e Initial load
duke
parents:
diff changeset
159 // Allocate storage for a objArray or typeArray
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6197
diff changeset
160 static void new_array_C(Klass* array_klass, int len, JavaThread *thread);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6197
diff changeset
161 static void new_array_nozero_C(Klass* array_klass, int len, JavaThread *thread);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
162
1166
7b0e9cba0307 6896647: card marks can be deferred too long
ysr
parents: 1027
diff changeset
163 // Post-slow-path-allocation, pre-initializing-stores step for
7b0e9cba0307 6896647: card marks can be deferred too long
ysr
parents: 1027
diff changeset
164 // implementing ReduceInitialCardMarks
7b0e9cba0307 6896647: card marks can be deferred too long
ysr
parents: 1027
diff changeset
165 static void new_store_pre_barrier(JavaThread* thread);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
166
a61af66fc99e Initial load
duke
parents:
diff changeset
167 // Allocate storage for a multi-dimensional arrays
a61af66fc99e Initial load
duke
parents:
diff changeset
168 // Note: needs to be fixed for arbitrary number of dimensions
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6197
diff changeset
169 static void multianewarray2_C(Klass* klass, int len1, int len2, JavaThread *thread);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6197
diff changeset
170 static void multianewarray3_C(Klass* klass, int len1, int len2, int len3, JavaThread *thread);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6197
diff changeset
171 static void multianewarray4_C(Klass* klass, int len1, int len2, int len3, int len4, JavaThread *thread);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6197
diff changeset
172 static void multianewarray5_C(Klass* klass, int len1, int len2, int len3, int len4, int len5, JavaThread *thread);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6197
diff changeset
173 static void multianewarrayN_C(Klass* klass, arrayOopDesc* dims, JavaThread *thread);
342
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
174 static void g1_wb_pre_C(oopDesc* orig, JavaThread* thread);
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
175 static void g1_wb_post_C(void* card_addr, JavaThread* thread);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
176
a61af66fc99e Initial load
duke
parents:
diff changeset
177 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
178 // Slow-path Locking and Unlocking
a61af66fc99e Initial load
duke
parents:
diff changeset
179 static void complete_monitor_locking_C(oopDesc* obj, BasicLock* lock, JavaThread* thread);
a61af66fc99e Initial load
duke
parents:
diff changeset
180 static void complete_monitor_unlocking_C(oopDesc* obj, BasicLock* lock);
a61af66fc99e Initial load
duke
parents:
diff changeset
181
a61af66fc99e Initial load
duke
parents:
diff changeset
182 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
183
a61af66fc99e Initial load
duke
parents:
diff changeset
184 // Implicit exception support
a61af66fc99e Initial load
duke
parents:
diff changeset
185 static void throw_null_exception_C(JavaThread* thread);
a61af66fc99e Initial load
duke
parents:
diff changeset
186
a61af66fc99e Initial load
duke
parents:
diff changeset
187 // Exception handling
a61af66fc99e Initial load
duke
parents:
diff changeset
188 static address handle_exception_C (JavaThread* thread);
a61af66fc99e Initial load
duke
parents:
diff changeset
189 static address handle_exception_C_helper(JavaThread* thread, nmethod*& nm);
a61af66fc99e Initial load
duke
parents:
diff changeset
190 static address rethrow_C (oopDesc* exception, JavaThread *thread, address return_pc );
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents: 6894
diff changeset
191 static void deoptimize_caller_frame (JavaThread *thread);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
192 static void deoptimize_caller_frame (JavaThread *thread, bool doit);
4063
7e0e43cf86d6 7109887: java/util/Arrays/CopyMethods.java fails with -XX:+DeoptimizeALot
kvn
parents: 3961
diff changeset
193 static bool is_deoptimized_caller_frame (JavaThread *thread);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
194
a61af66fc99e Initial load
duke
parents:
diff changeset
195 // CodeBlob support
a61af66fc99e Initial load
duke
parents:
diff changeset
196 // ===================================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
197
a61af66fc99e Initial load
duke
parents:
diff changeset
198 static ExceptionBlob* _exception_blob;
a61af66fc99e Initial load
duke
parents:
diff changeset
199 static void generate_exception_blob();
a61af66fc99e Initial load
duke
parents:
diff changeset
200
a61af66fc99e Initial load
duke
parents:
diff changeset
201 static void register_finalizer(oopDesc* obj, JavaThread* thread);
a61af66fc99e Initial load
duke
parents:
diff changeset
202
a61af66fc99e Initial load
duke
parents:
diff changeset
203 // zaping dead locals, either from Java frames or from native frames
a61af66fc99e Initial load
duke
parents:
diff changeset
204 # ifdef ENABLE_ZAP_DEAD_LOCALS
a61af66fc99e Initial load
duke
parents:
diff changeset
205 static void zap_dead_Java_locals_C( JavaThread* thread);
a61af66fc99e Initial load
duke
parents:
diff changeset
206 static void zap_dead_native_locals_C( JavaThread* thread);
a61af66fc99e Initial load
duke
parents:
diff changeset
207
a61af66fc99e Initial load
duke
parents:
diff changeset
208 static void zap_dead_java_or_native_locals( JavaThread*, bool (*)(frame*));
a61af66fc99e Initial load
duke
parents:
diff changeset
209
a61af66fc99e Initial load
duke
parents:
diff changeset
210 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
211 static int ZapDeadCompiledLocals_count;
a61af66fc99e Initial load
duke
parents:
diff changeset
212
a61af66fc99e Initial load
duke
parents:
diff changeset
213 # endif
a61af66fc99e Initial load
duke
parents:
diff changeset
214
a61af66fc99e Initial load
duke
parents:
diff changeset
215
a61af66fc99e Initial load
duke
parents:
diff changeset
216 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
217
a61af66fc99e Initial load
duke
parents:
diff changeset
218 static bool is_callee_saved_register(MachRegisterNumbers reg);
a61af66fc99e Initial load
duke
parents:
diff changeset
219
12880
469216acdb28 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 11080
diff changeset
220 // One time only generate runtime code stubs. Returns true
469216acdb28 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 11080
diff changeset
221 // when runtime stubs have been generated successfully and
469216acdb28 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 11080
diff changeset
222 // false otherwise.
469216acdb28 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 11080
diff changeset
223 static bool generate(ciEnv* env);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
224
a61af66fc99e Initial load
duke
parents:
diff changeset
225 // Returns the name of a stub
a61af66fc99e Initial load
duke
parents:
diff changeset
226 static const char* stub_name(address entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
227
a61af66fc99e Initial load
duke
parents:
diff changeset
228 // access to runtime stubs entry points for java code
a61af66fc99e Initial load
duke
parents:
diff changeset
229 static address new_instance_Java() { return _new_instance_Java; }
a61af66fc99e Initial load
duke
parents:
diff changeset
230 static address new_array_Java() { return _new_array_Java; }
3961
a92cdbac8b9e 7081933: Use zeroing elimination optimization for large array
kvn
parents: 3805
diff changeset
231 static address new_array_nozero_Java() { return _new_array_nozero_Java; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
232 static address multianewarray2_Java() { return _multianewarray2_Java; }
a61af66fc99e Initial load
duke
parents:
diff changeset
233 static address multianewarray3_Java() { return _multianewarray3_Java; }
a61af66fc99e Initial load
duke
parents:
diff changeset
234 static address multianewarray4_Java() { return _multianewarray4_Java; }
a61af66fc99e Initial load
duke
parents:
diff changeset
235 static address multianewarray5_Java() { return _multianewarray5_Java; }
3805
263247c478c5 7058510: multinewarray with 6 dimensions uncommon traps in server compiler
iveresov
parents: 1972
diff changeset
236 static address multianewarrayN_Java() { return _multianewarrayN_Java; }
342
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
237 static address g1_wb_pre_Java() { return _g1_wb_pre_Java; }
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
238 static address g1_wb_post_Java() { return _g1_wb_post_Java; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
239 static address vtable_must_compile_stub() { return _vtable_must_compile_Java; }
a61af66fc99e Initial load
duke
parents:
diff changeset
240 static address complete_monitor_locking_Java() { return _complete_monitor_locking_Java; }
a61af66fc99e Initial load
duke
parents:
diff changeset
241
a61af66fc99e Initial load
duke
parents:
diff changeset
242 static address slow_arraycopy_Java() { return _slow_arraycopy_Java; }
a61af66fc99e Initial load
duke
parents:
diff changeset
243 static address register_finalizer_Java() { return _register_finalizer_Java; }
a61af66fc99e Initial load
duke
parents:
diff changeset
244
a61af66fc99e Initial load
duke
parents:
diff changeset
245
a61af66fc99e Initial load
duke
parents:
diff changeset
246 # ifdef ENABLE_ZAP_DEAD_LOCALS
a61af66fc99e Initial load
duke
parents:
diff changeset
247 static address zap_dead_locals_stub(bool is_native) { return is_native
a61af66fc99e Initial load
duke
parents:
diff changeset
248 ? _zap_dead_native_locals_Java
a61af66fc99e Initial load
duke
parents:
diff changeset
249 : _zap_dead_Java_locals_Java; }
a61af66fc99e Initial load
duke
parents:
diff changeset
250 static MachNode* node_to_call_zap_dead_locals(Node* n, int block_num, bool is_native);
a61af66fc99e Initial load
duke
parents:
diff changeset
251 # endif
a61af66fc99e Initial load
duke
parents:
diff changeset
252
a61af66fc99e Initial load
duke
parents:
diff changeset
253 static ExceptionBlob* exception_blob() { return _exception_blob; }
a61af66fc99e Initial load
duke
parents:
diff changeset
254
a61af66fc99e Initial load
duke
parents:
diff changeset
255 // Leaf routines helping with method data update
a61af66fc99e Initial load
duke
parents:
diff changeset
256 static void profile_receiver_type_C(DataLayout* data, oopDesc* receiver);
a61af66fc99e Initial load
duke
parents:
diff changeset
257
a61af66fc99e Initial load
duke
parents:
diff changeset
258 // Implicit exception support
a61af66fc99e Initial load
duke
parents:
diff changeset
259 static void throw_div0_exception_C (JavaThread* thread);
a61af66fc99e Initial load
duke
parents:
diff changeset
260 static void throw_stack_overflow_error_C(JavaThread* thread);
a61af66fc99e Initial load
duke
parents:
diff changeset
261
a61af66fc99e Initial load
duke
parents:
diff changeset
262 // Exception handling
a61af66fc99e Initial load
duke
parents:
diff changeset
263 static address rethrow_stub() { return _rethrow_Java; }
a61af66fc99e Initial load
duke
parents:
diff changeset
264
a61af66fc99e Initial load
duke
parents:
diff changeset
265
a61af66fc99e Initial load
duke
parents:
diff changeset
266 // Type functions
a61af66fc99e Initial load
duke
parents:
diff changeset
267 // ======================================================
a61af66fc99e Initial load
duke
parents:
diff changeset
268
a61af66fc99e Initial load
duke
parents:
diff changeset
269 static const TypeFunc* new_instance_Type(); // object allocation (slow case)
a61af66fc99e Initial load
duke
parents:
diff changeset
270 static const TypeFunc* new_array_Type (); // [a]newarray (slow case)
a61af66fc99e Initial load
duke
parents:
diff changeset
271 static const TypeFunc* multianewarray_Type(int ndim); // multianewarray
a61af66fc99e Initial load
duke
parents:
diff changeset
272 static const TypeFunc* multianewarray2_Type(); // multianewarray
a61af66fc99e Initial load
duke
parents:
diff changeset
273 static const TypeFunc* multianewarray3_Type(); // multianewarray
a61af66fc99e Initial load
duke
parents:
diff changeset
274 static const TypeFunc* multianewarray4_Type(); // multianewarray
a61af66fc99e Initial load
duke
parents:
diff changeset
275 static const TypeFunc* multianewarray5_Type(); // multianewarray
3805
263247c478c5 7058510: multinewarray with 6 dimensions uncommon traps in server compiler
iveresov
parents: 1972
diff changeset
276 static const TypeFunc* multianewarrayN_Type(); // multianewarray
342
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
277 static const TypeFunc* g1_wb_pre_Type();
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
278 static const TypeFunc* g1_wb_post_Type();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
279 static const TypeFunc* complete_monitor_enter_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
280 static const TypeFunc* complete_monitor_exit_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
281 static const TypeFunc* uncommon_trap_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
282 static const TypeFunc* athrow_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
283 static const TypeFunc* rethrow_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
284 static const TypeFunc* Math_D_D_Type(); // sin,cos & friends
a61af66fc99e Initial load
duke
parents:
diff changeset
285 static const TypeFunc* Math_DD_D_Type(); // mod,pow & friends
a61af66fc99e Initial load
duke
parents:
diff changeset
286 static const TypeFunc* modf_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
287 static const TypeFunc* l2f_Type();
6006
0105f367a14c 7160570: Intrinsification support for tracing framework
rbackman
parents: 4063
diff changeset
288 static const TypeFunc* void_long_Type();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
289
a61af66fc99e Initial load
duke
parents:
diff changeset
290 static const TypeFunc* flush_windows_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
291
a61af66fc99e Initial load
duke
parents:
diff changeset
292 // arraycopy routine types
a61af66fc99e Initial load
duke
parents:
diff changeset
293 static const TypeFunc* fast_arraycopy_Type(); // bit-blasters
a61af66fc99e Initial load
duke
parents:
diff changeset
294 static const TypeFunc* checkcast_arraycopy_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
295 static const TypeFunc* generic_arraycopy_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
296 static const TypeFunc* slow_arraycopy_Type(); // the full routine
a61af66fc99e Initial load
duke
parents:
diff changeset
297
1763
d6f45b55c972 4809552: Optimize Arrays.fill(...)
never
parents: 1552
diff changeset
298 static const TypeFunc* array_fill_Type();
d6f45b55c972 4809552: Optimize Arrays.fill(...)
never
parents: 1552
diff changeset
299
6894
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents: 6725
diff changeset
300 static const TypeFunc* aescrypt_block_Type();
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents: 6725
diff changeset
301 static const TypeFunc* cipherBlockChaining_aescrypt_Type();
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents: 6725
diff changeset
302
20313
b20a35eae442 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 17780
diff changeset
303 static const TypeFunc* sha_implCompress_Type();
b20a35eae442 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 17780
diff changeset
304 static const TypeFunc* digestBase_implCompressMB_Type();
b20a35eae442 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 17780
diff changeset
305
11080
b800986664f4 7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents: 7428
diff changeset
306 static const TypeFunc* updateBytesCRC32_Type();
b800986664f4 7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents: 7428
diff changeset
307
0
a61af66fc99e Initial load
duke
parents:
diff changeset
308 // leaf on stack replacement interpreter accessor types
a61af66fc99e Initial load
duke
parents:
diff changeset
309 static const TypeFunc* osr_end_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
310
a61af66fc99e Initial load
duke
parents:
diff changeset
311 // leaf methodData routine types
a61af66fc99e Initial load
duke
parents:
diff changeset
312 static const TypeFunc* profile_receiver_type_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
313
a61af66fc99e Initial load
duke
parents:
diff changeset
314 // leaf on stack replacement interpreter accessor types
a61af66fc99e Initial load
duke
parents:
diff changeset
315 static const TypeFunc* fetch_int_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
316 static const TypeFunc* fetch_long_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
317 static const TypeFunc* fetch_float_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
318 static const TypeFunc* fetch_double_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
319 static const TypeFunc* fetch_oop_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
320 static const TypeFunc* fetch_monitor_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
321
a61af66fc99e Initial load
duke
parents:
diff changeset
322 static const TypeFunc* register_finalizer_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
323
a61af66fc99e Initial load
duke
parents:
diff changeset
324 // Dtrace support
a61af66fc99e Initial load
duke
parents:
diff changeset
325 static const TypeFunc* dtrace_method_entry_exit_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
326 static const TypeFunc* dtrace_object_alloc_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
327
a61af66fc99e Initial load
duke
parents:
diff changeset
328 # ifdef ENABLE_ZAP_DEAD_LOCALS
a61af66fc99e Initial load
duke
parents:
diff changeset
329 static const TypeFunc* zap_dead_locals_Type();
a61af66fc99e Initial load
duke
parents:
diff changeset
330 # endif
a61af66fc99e Initial load
duke
parents:
diff changeset
331
a61af66fc99e Initial load
duke
parents:
diff changeset
332 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
333 static NamedCounter * volatile _named_counters;
a61af66fc99e Initial load
duke
parents:
diff changeset
334
a61af66fc99e Initial load
duke
parents:
diff changeset
335 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
336 // helper function which creates a named counter labeled with the
a61af66fc99e Initial load
duke
parents:
diff changeset
337 // if they are available
a61af66fc99e Initial load
duke
parents:
diff changeset
338 static NamedCounter* new_named_counter(JVMState* jvms, NamedCounter::CounterTag tag);
a61af66fc99e Initial load
duke
parents:
diff changeset
339
a61af66fc99e Initial load
duke
parents:
diff changeset
340 // dumps all the named counters
a61af66fc99e Initial load
duke
parents:
diff changeset
341 static void print_named_counters();
a61af66fc99e Initial load
duke
parents:
diff changeset
342
a61af66fc99e Initial load
duke
parents:
diff changeset
343 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1763
diff changeset
344
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1763
diff changeset
345 #endif // SHARE_VM_OPTO_RUNTIME_HPP