254 |
254 |
255 bool inline_native_newArray(); |
255 bool inline_native_newArray(); |
256 bool inline_native_getLength(); |
256 bool inline_native_getLength(); |
257 bool inline_array_copyOf(bool is_copyOfRange); |
257 bool inline_array_copyOf(bool is_copyOfRange); |
258 bool inline_array_equals(StrIntrinsicNode::ArgEnc ae); |
258 bool inline_array_equals(StrIntrinsicNode::ArgEnc ae); |
|
259 bool inline_objects_checkIndex(); |
259 void copy_to_clone(Node* obj, Node* alloc_obj, Node* obj_size, bool is_array, bool card_mark); |
260 void copy_to_clone(Node* obj, Node* alloc_obj, Node* obj_size, bool is_array, bool card_mark); |
260 bool inline_native_clone(bool is_virtual); |
261 bool inline_native_clone(bool is_virtual); |
261 bool inline_native_Reflection_getCallerClass(); |
262 bool inline_native_Reflection_getCallerClass(); |
262 // Helper function for inlining native object hash method |
263 // Helper function for inlining native object hash method |
263 bool inline_native_hashcode(bool is_virtual, bool is_static); |
264 bool inline_native_hashcode(bool is_virtual, bool is_static); |
645 case vmIntrinsics::_getLength: return inline_native_getLength(); |
646 case vmIntrinsics::_getLength: return inline_native_getLength(); |
646 case vmIntrinsics::_copyOf: return inline_array_copyOf(false); |
647 case vmIntrinsics::_copyOf: return inline_array_copyOf(false); |
647 case vmIntrinsics::_copyOfRange: return inline_array_copyOf(true); |
648 case vmIntrinsics::_copyOfRange: return inline_array_copyOf(true); |
648 case vmIntrinsics::_equalsB: return inline_array_equals(StrIntrinsicNode::LL); |
649 case vmIntrinsics::_equalsB: return inline_array_equals(StrIntrinsicNode::LL); |
649 case vmIntrinsics::_equalsC: return inline_array_equals(StrIntrinsicNode::UU); |
650 case vmIntrinsics::_equalsC: return inline_array_equals(StrIntrinsicNode::UU); |
|
651 case vmIntrinsics::_Objects_checkIndex: return inline_objects_checkIndex(); |
650 case vmIntrinsics::_clone: return inline_native_clone(intrinsic()->is_virtual()); |
652 case vmIntrinsics::_clone: return inline_native_clone(intrinsic()->is_virtual()); |
651 |
653 |
652 case vmIntrinsics::_isAssignableFrom: return inline_native_subtype_check(); |
654 case vmIntrinsics::_isAssignableFrom: return inline_native_subtype_check(); |
653 |
655 |
654 case vmIntrinsics::_isInstance: |
656 case vmIntrinsics::_isInstance: |
1040 if (!stopped()) { |
1042 if (!stopped()) { |
1041 Node* ba_start = array_element_address(ba, offset, T_BYTE); |
1043 Node* ba_start = array_element_address(ba, offset, T_BYTE); |
1042 Node* result = new HasNegativesNode(control(), memory(TypeAryPtr::BYTES), ba_start, len); |
1044 Node* result = new HasNegativesNode(control(), memory(TypeAryPtr::BYTES), ba_start, len); |
1043 set_result(_gvn.transform(result)); |
1045 set_result(_gvn.transform(result)); |
1044 } |
1046 } |
|
1047 return true; |
|
1048 } |
|
1049 |
|
1050 bool LibraryCallKit::inline_objects_checkIndex() { |
|
1051 Node* index = argument(0); |
|
1052 Node* length = argument(1); |
|
1053 if (too_many_traps(Deoptimization::Reason_intrinsic) || too_many_traps(Deoptimization::Reason_range_check)) { |
|
1054 return false; |
|
1055 } |
|
1056 |
|
1057 Node* len_pos_cmp = _gvn.transform(new CmpINode(length, intcon(0))); |
|
1058 Node* len_pos_bol = _gvn.transform(new BoolNode(len_pos_cmp, BoolTest::ge)); |
|
1059 |
|
1060 { |
|
1061 BuildCutout unless(this, len_pos_bol, PROB_MAX); |
|
1062 uncommon_trap(Deoptimization::Reason_intrinsic, |
|
1063 Deoptimization::Action_make_not_entrant); |
|
1064 } |
|
1065 |
|
1066 if (stopped()) { |
|
1067 return false; |
|
1068 } |
|
1069 |
|
1070 Node* rc_cmp = _gvn.transform(new CmpUNode(index, length)); |
|
1071 BoolTest::mask btest = BoolTest::lt; |
|
1072 Node* rc_bool = _gvn.transform(new BoolNode(rc_cmp, btest)); |
|
1073 RangeCheckNode* rc = new RangeCheckNode(control(), rc_bool, PROB_MAX, COUNT_UNKNOWN); |
|
1074 _gvn.set_type(rc, rc->Value(&_gvn)); |
|
1075 if (!rc_bool->is_Con()) { |
|
1076 record_for_igvn(rc); |
|
1077 } |
|
1078 set_control(_gvn.transform(new IfTrueNode(rc))); |
|
1079 { |
|
1080 PreserveJVMState pjvms(this); |
|
1081 set_control(_gvn.transform(new IfFalseNode(rc))); |
|
1082 uncommon_trap(Deoptimization::Reason_range_check, |
|
1083 Deoptimization::Action_make_not_entrant); |
|
1084 } |
|
1085 |
|
1086 if (stopped()) { |
|
1087 return false; |
|
1088 } |
|
1089 |
|
1090 Node* result = new CastIINode(index, TypeInt::make(0, _gvn.type(length)->is_int()->_hi, Type::WidenMax)); |
|
1091 result->set_req(0, control()); |
|
1092 result = _gvn.transform(result); |
|
1093 set_result(result); |
|
1094 replace_in_map(index, result); |
1045 return true; |
1095 return true; |
1046 } |
1096 } |
1047 |
1097 |
1048 //------------------------------inline_string_indexOf------------------------ |
1098 //------------------------------inline_string_indexOf------------------------ |
1049 bool LibraryCallKit::inline_string_indexOf(StrIntrinsicNode::ArgEnc ae) { |
1099 bool LibraryCallKit::inline_string_indexOf(StrIntrinsicNode::ArgEnc ae) { |