< prev index next >

src/hotspot/share/opto/library_call.hpp

Print this page

117   }
118 
119   void  set_result(Node* n) { assert(_result == NULL, "only set once"); _result = n; }
120   void  set_result(RegionNode* region, PhiNode* value);
121   Node*     result() { return _result; }
122 
123   virtual int reexecute_sp() { return _reexecute_sp; }
124 
125   // Helper functions to inline natives
126   Node* generate_guard(Node* test, RegionNode* region, float true_prob);
127   Node* generate_slow_guard(Node* test, RegionNode* region);
128   Node* generate_fair_guard(Node* test, RegionNode* region);
129   Node* generate_negative_guard(Node* index, RegionNode* region,
130                                 // resulting CastII of index:
131                                 Node* *pos_index = NULL);
132   Node* generate_limit_guard(Node* offset, Node* subseq_length,
133                              Node* array_length,
134                              RegionNode* region);
135   void  generate_string_range_check(Node* array, Node* offset,
136                                     Node* length, bool char_count);


137   Node* generate_current_thread(Node* &tls_output);

138   Node* load_mirror_from_klass(Node* klass);
139   Node* load_klass_from_mirror_common(Node* mirror, bool never_see_null,
140                                       RegionNode* region, int null_path,
141                                       int offset);
142   Node* load_klass_from_mirror(Node* mirror, bool never_see_null,
143                                RegionNode* region, int null_path) {
144     int offset = java_lang_Class::klass_offset();
145     return load_klass_from_mirror_common(mirror, never_see_null,
146                                          region, null_path,
147                                          offset);
148   }
149   Node* load_array_klass_from_mirror(Node* mirror, bool never_see_null,
150                                      RegionNode* region, int null_path) {
151     int offset = java_lang_Class::array_klass_offset();
152     return load_klass_from_mirror_common(mirror, never_see_null,
153                                          region, null_path,
154                                          offset);
155   }
156   Node* generate_access_flags_guard(Node* kls,
157                                     int modifier_mask, int modifier_bits,

164   Node* generate_non_array_guard(Node* kls, RegionNode* region) {
165     return generate_array_guard_common(kls, region, false, true);
166   }
167   Node* generate_objArray_guard(Node* kls, RegionNode* region) {
168     return generate_array_guard_common(kls, region, true, false);
169   }
170   Node* generate_non_objArray_guard(Node* kls, RegionNode* region) {
171     return generate_array_guard_common(kls, region, true, true);
172   }
173   Node* generate_array_guard_common(Node* kls, RegionNode* region,
174                                     bool obj_array, bool not_array);
175   Node* generate_virtual_guard(Node* obj_klass, RegionNode* slow_region);
176   CallJavaNode* generate_method_call(vmIntrinsics::ID method_id,
177                                      bool is_virtual = false, bool is_static = false);
178   CallJavaNode* generate_method_call_static(vmIntrinsics::ID method_id) {
179     return generate_method_call(method_id, false, true);
180   }
181   CallJavaNode* generate_method_call_virtual(vmIntrinsics::ID method_id) {
182     return generate_method_call(method_id, true, false);
183   }
184   Node* load_field_from_object(Node* fromObj, const char* fieldName, const char* fieldTypeString, DecoratorSet decorators, bool is_static, ciInstanceKlass* fromKls);
185   Node* field_address_from_object(Node* fromObj, const char* fieldName, const char* fieldTypeString, bool is_exact, bool is_static, ciInstanceKlass* fromKls);
186 
187   Node* make_string_method_node(int opcode, Node* str1_start, Node* cnt1, Node* str2_start, Node* cnt2, StrIntrinsicNode::ArgEnc ae);
188   bool inline_string_compareTo(StrIntrinsicNode::ArgEnc ae);
189   bool inline_string_indexOf(StrIntrinsicNode::ArgEnc ae);
190   bool inline_string_indexOfI(StrIntrinsicNode::ArgEnc ae);
191   Node* make_indexOf_node(Node* src_start, Node* src_count, Node* tgt_start, Node* tgt_count,
192                           RegionNode* region, Node* phi, StrIntrinsicNode::ArgEnc ae);
193   bool inline_string_indexOfChar(StrIntrinsicNode::ArgEnc ae);
194   bool inline_string_equals(StrIntrinsicNode::ArgEnc ae);
195   bool inline_string_toBytesU();
196   bool inline_string_getCharsU();
197   bool inline_string_copy(bool compress);
198   bool inline_string_char_access(bool is_store);
199   Node* round_double_node(Node* n);
200   bool runtime_math(const TypeFunc* call_type, address funcAddr, const char* funcName);
201   bool inline_math_native(vmIntrinsics::ID id);
202   bool inline_math(vmIntrinsics::ID id);
203   bool inline_double_math(vmIntrinsics::ID id);
204   bool inline_math_pow();
205   template <typename OverflowOp>

213   bool inline_math_negateExactI();
214   bool inline_math_negateExactL();
215   bool inline_math_subtractExactI(bool is_decrement);
216   bool inline_math_subtractExactL(bool is_decrement);
217   bool inline_min_max(vmIntrinsics::ID id);
218   bool inline_notify(vmIntrinsics::ID id);
219   Node* generate_min_max(vmIntrinsics::ID id, Node* x, Node* y);
220   // This returns Type::AnyPtr, RawPtr, or OopPtr.
221   int classify_unsafe_addr(Node* &base, Node* &offset, BasicType type);
222   Node* make_unsafe_address(Node*& base, Node* offset, BasicType type = T_ILLEGAL, bool can_cast = false);
223 
224   typedef enum { Relaxed, Opaque, Volatile, Acquire, Release } AccessKind;
225   DecoratorSet mo_decorator_for_access_kind(AccessKind kind);
226   bool inline_unsafe_access(bool is_store, BasicType type, AccessKind kind, bool is_unaligned);
227   static bool klass_needs_init_guard(Node* kls);
228   bool inline_unsafe_allocate();
229   bool inline_unsafe_newArray(bool uninitialized);
230   bool inline_unsafe_writeback0();
231   bool inline_unsafe_writebackSync0(bool is_pre);
232   bool inline_unsafe_copyMemory();




233   bool inline_native_currentThread();

234 
235   bool inline_native_time_funcs(address method, const char* funcName);
236 #ifdef JFR_HAVE_INTRINSICS
237   bool inline_native_classID();
238   bool inline_native_getEventWriter();
239 #endif
240   bool inline_native_Class_query(vmIntrinsics::ID id);
241   bool inline_native_subtype_check();
242   bool inline_native_getLength();
243   bool inline_array_copyOf(bool is_copyOfRange);
244   bool inline_array_equals(StrIntrinsicNode::ArgEnc ae);
245   bool inline_preconditions_checkIndex(BasicType bt);
246   void copy_to_clone(Node* obj, Node* alloc_obj, Node* obj_size, bool is_array);
247   bool inline_native_clone(bool is_virtual);
248   bool inline_native_Reflection_getCallerClass();
249   // Helper function for inlining native object hash method
250   bool inline_native_hashcode(bool is_virtual, bool is_static);
251   bool inline_native_getClass();
252 
253   // Helper functions for inlining arraycopy

294   bool inline_updateDirectByteBufferCRC32C();
295   bool inline_updateBytesAdler32();
296   bool inline_updateByteBufferAdler32();
297   bool inline_multiplyToLen();
298   bool inline_hasNegatives();
299   bool inline_squareToLen();
300   bool inline_mulAdd();
301   bool inline_montgomeryMultiply();
302   bool inline_montgomerySquare();
303   bool inline_bigIntegerShift(bool isRightShift);
304   bool inline_vectorizedMismatch();
305   bool inline_fma(vmIntrinsics::ID id);
306   bool inline_character_compare(vmIntrinsics::ID id);
307   bool inline_fp_min_max(vmIntrinsics::ID id);
308   bool inline_galoisCounterMode_AESCrypt();
309   Node* inline_galoisCounterMode_AESCrypt_predicate();
310 
311   bool inline_profileBoolean();
312   bool inline_isCompileConstant();
313 


314   // Vector API support
315   bool inline_vector_nary_operation(int n);
316   bool inline_vector_broadcast_coerced();
317   bool inline_vector_shuffle_to_vector();
318   bool inline_vector_shuffle_iota();
319   bool inline_vector_mask_operation();
320   bool inline_vector_mem_operation(bool is_store);
321   bool inline_vector_gather_scatter(bool is_scatter);
322   bool inline_vector_reduction();
323   bool inline_vector_test();
324   bool inline_vector_blend();
325   bool inline_vector_rearrange();
326   bool inline_vector_compare();
327   bool inline_vector_broadcast_int();
328   bool inline_vector_convert();
329   bool inline_vector_extract();
330   bool inline_vector_insert();
331   Node* gen_call_to_svml(int vector_api_op_id, BasicType bt, int num_elem, Node* opd1, Node* opd2);
332 
333   enum VectorMaskUseType {

117   }
118 
119   void  set_result(Node* n) { assert(_result == NULL, "only set once"); _result = n; }
120   void  set_result(RegionNode* region, PhiNode* value);
121   Node*     result() { return _result; }
122 
123   virtual int reexecute_sp() { return _reexecute_sp; }
124 
125   // Helper functions to inline natives
126   Node* generate_guard(Node* test, RegionNode* region, float true_prob);
127   Node* generate_slow_guard(Node* test, RegionNode* region);
128   Node* generate_fair_guard(Node* test, RegionNode* region);
129   Node* generate_negative_guard(Node* index, RegionNode* region,
130                                 // resulting CastII of index:
131                                 Node* *pos_index = NULL);
132   Node* generate_limit_guard(Node* offset, Node* subseq_length,
133                              Node* array_length,
134                              RegionNode* region);
135   void  generate_string_range_check(Node* array, Node* offset,
136                                     Node* length, bool char_count);
137   Node* current_thread_helper(Node* &tls_output, ByteSize handle_offset,
138                               bool is_immutable);
139   Node* generate_current_thread(Node* &tls_output);
140   Node* generate_virtual_thread(Node* threadObj);
141   Node* load_mirror_from_klass(Node* klass);
142   Node* load_klass_from_mirror_common(Node* mirror, bool never_see_null,
143                                       RegionNode* region, int null_path,
144                                       int offset);
145   Node* load_klass_from_mirror(Node* mirror, bool never_see_null,
146                                RegionNode* region, int null_path) {
147     int offset = java_lang_Class::klass_offset();
148     return load_klass_from_mirror_common(mirror, never_see_null,
149                                          region, null_path,
150                                          offset);
151   }
152   Node* load_array_klass_from_mirror(Node* mirror, bool never_see_null,
153                                      RegionNode* region, int null_path) {
154     int offset = java_lang_Class::array_klass_offset();
155     return load_klass_from_mirror_common(mirror, never_see_null,
156                                          region, null_path,
157                                          offset);
158   }
159   Node* generate_access_flags_guard(Node* kls,
160                                     int modifier_mask, int modifier_bits,

167   Node* generate_non_array_guard(Node* kls, RegionNode* region) {
168     return generate_array_guard_common(kls, region, false, true);
169   }
170   Node* generate_objArray_guard(Node* kls, RegionNode* region) {
171     return generate_array_guard_common(kls, region, true, false);
172   }
173   Node* generate_non_objArray_guard(Node* kls, RegionNode* region) {
174     return generate_array_guard_common(kls, region, true, true);
175   }
176   Node* generate_array_guard_common(Node* kls, RegionNode* region,
177                                     bool obj_array, bool not_array);
178   Node* generate_virtual_guard(Node* obj_klass, RegionNode* slow_region);
179   CallJavaNode* generate_method_call(vmIntrinsics::ID method_id,
180                                      bool is_virtual = false, bool is_static = false);
181   CallJavaNode* generate_method_call_static(vmIntrinsics::ID method_id) {
182     return generate_method_call(method_id, false, true);
183   }
184   CallJavaNode* generate_method_call_virtual(vmIntrinsics::ID method_id) {
185     return generate_method_call(method_id, true, false);
186   }
187   Node* load_field_from_object(Node* fromObj, const char* fieldName, const char* fieldTypeString, DecoratorSet decorators = IN_HEAP, bool is_static = false, ciInstanceKlass* fromKls = NULL);
188   Node* field_address_from_object(Node* fromObj, const char* fieldName, const char* fieldTypeString, bool is_exact = true, bool is_static = false, ciInstanceKlass* fromKls = NULL);
189 
190   Node* make_string_method_node(int opcode, Node* str1_start, Node* cnt1, Node* str2_start, Node* cnt2, StrIntrinsicNode::ArgEnc ae);
191   bool inline_string_compareTo(StrIntrinsicNode::ArgEnc ae);
192   bool inline_string_indexOf(StrIntrinsicNode::ArgEnc ae);
193   bool inline_string_indexOfI(StrIntrinsicNode::ArgEnc ae);
194   Node* make_indexOf_node(Node* src_start, Node* src_count, Node* tgt_start, Node* tgt_count,
195                           RegionNode* region, Node* phi, StrIntrinsicNode::ArgEnc ae);
196   bool inline_string_indexOfChar(StrIntrinsicNode::ArgEnc ae);
197   bool inline_string_equals(StrIntrinsicNode::ArgEnc ae);
198   bool inline_string_toBytesU();
199   bool inline_string_getCharsU();
200   bool inline_string_copy(bool compress);
201   bool inline_string_char_access(bool is_store);
202   Node* round_double_node(Node* n);
203   bool runtime_math(const TypeFunc* call_type, address funcAddr, const char* funcName);
204   bool inline_math_native(vmIntrinsics::ID id);
205   bool inline_math(vmIntrinsics::ID id);
206   bool inline_double_math(vmIntrinsics::ID id);
207   bool inline_math_pow();
208   template <typename OverflowOp>

216   bool inline_math_negateExactI();
217   bool inline_math_negateExactL();
218   bool inline_math_subtractExactI(bool is_decrement);
219   bool inline_math_subtractExactL(bool is_decrement);
220   bool inline_min_max(vmIntrinsics::ID id);
221   bool inline_notify(vmIntrinsics::ID id);
222   Node* generate_min_max(vmIntrinsics::ID id, Node* x, Node* y);
223   // This returns Type::AnyPtr, RawPtr, or OopPtr.
224   int classify_unsafe_addr(Node* &base, Node* &offset, BasicType type);
225   Node* make_unsafe_address(Node*& base, Node* offset, BasicType type = T_ILLEGAL, bool can_cast = false);
226 
227   typedef enum { Relaxed, Opaque, Volatile, Acquire, Release } AccessKind;
228   DecoratorSet mo_decorator_for_access_kind(AccessKind kind);
229   bool inline_unsafe_access(bool is_store, BasicType type, AccessKind kind, bool is_unaligned);
230   static bool klass_needs_init_guard(Node* kls);
231   bool inline_unsafe_allocate();
232   bool inline_unsafe_newArray(bool uninitialized);
233   bool inline_unsafe_writeback0();
234   bool inline_unsafe_writebackSync0(bool is_pre);
235   bool inline_unsafe_copyMemory();
236   bool inline_native_currentThread0();
237   bool inline_native_scopeLocalCache();
238   Node* scopeLocalCache_helper();
239   bool inline_native_setScopeLocalCache();
240   bool inline_native_currentThread();
241   bool inline_native_setCurrentThread();
242 
243   bool inline_native_time_funcs(address method, const char* funcName);
244 #ifdef JFR_HAVE_INTRINSICS
245   bool inline_native_classID();
246   bool inline_native_getEventWriter();
247 #endif
248   bool inline_native_Class_query(vmIntrinsics::ID id);
249   bool inline_native_subtype_check();
250   bool inline_native_getLength();
251   bool inline_array_copyOf(bool is_copyOfRange);
252   bool inline_array_equals(StrIntrinsicNode::ArgEnc ae);
253   bool inline_preconditions_checkIndex(BasicType bt);
254   void copy_to_clone(Node* obj, Node* alloc_obj, Node* obj_size, bool is_array);
255   bool inline_native_clone(bool is_virtual);
256   bool inline_native_Reflection_getCallerClass();
257   // Helper function for inlining native object hash method
258   bool inline_native_hashcode(bool is_virtual, bool is_static);
259   bool inline_native_getClass();
260 
261   // Helper functions for inlining arraycopy

302   bool inline_updateDirectByteBufferCRC32C();
303   bool inline_updateBytesAdler32();
304   bool inline_updateByteBufferAdler32();
305   bool inline_multiplyToLen();
306   bool inline_hasNegatives();
307   bool inline_squareToLen();
308   bool inline_mulAdd();
309   bool inline_montgomeryMultiply();
310   bool inline_montgomerySquare();
311   bool inline_bigIntegerShift(bool isRightShift);
312   bool inline_vectorizedMismatch();
313   bool inline_fma(vmIntrinsics::ID id);
314   bool inline_character_compare(vmIntrinsics::ID id);
315   bool inline_fp_min_max(vmIntrinsics::ID id);
316   bool inline_galoisCounterMode_AESCrypt();
317   Node* inline_galoisCounterMode_AESCrypt_predicate();
318 
319   bool inline_profileBoolean();
320   bool inline_isCompileConstant();
321 
322   bool inline_continuation_do_yield();
323 
324   // Vector API support
325   bool inline_vector_nary_operation(int n);
326   bool inline_vector_broadcast_coerced();
327   bool inline_vector_shuffle_to_vector();
328   bool inline_vector_shuffle_iota();
329   bool inline_vector_mask_operation();
330   bool inline_vector_mem_operation(bool is_store);
331   bool inline_vector_gather_scatter(bool is_scatter);
332   bool inline_vector_reduction();
333   bool inline_vector_test();
334   bool inline_vector_blend();
335   bool inline_vector_rearrange();
336   bool inline_vector_compare();
337   bool inline_vector_broadcast_int();
338   bool inline_vector_convert();
339   bool inline_vector_extract();
340   bool inline_vector_insert();
341   Node* gen_call_to_svml(int vector_api_op_id, BasicType bt, int num_elem, Node* opd1, Node* opd2);
342 
343   enum VectorMaskUseType {
< prev index next >