< 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>

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




234   bool inline_native_currentThread();

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

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


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

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>

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

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