src/hotspot/share/opto/library_call.cpp

Print this page

        

*** 322,331 **** --- 322,332 ---- bool inline_mulAdd(); bool inline_montgomeryMultiply(); bool inline_montgomerySquare(); bool inline_vectorizedMismatch(); bool inline_fma(vmIntrinsics::ID id); + bool inline_character_compare(vmIntrinsics::ID id); bool inline_profileBoolean(); bool inline_isCompileConstant(); void clear_upper_avx() { #ifdef X86
*** 865,874 **** --- 866,881 ---- case vmIntrinsics::_fmaD: case vmIntrinsics::_fmaF: return inline_fma(intrinsic_id()); + case vmIntrinsics::_isDigit_c: + case vmIntrinsics::_isLowerCase_c: + case vmIntrinsics::_isUpperCase_c: + case vmIntrinsics::_isWhitespace_c: + return inline_character_compare(intrinsic_id()); + default: // If you get here, it may be that someone has added a new intrinsic // to the list in vmSymbols.hpp without implementing it here. #ifndef PRODUCT if ((PrintMiscellaneous && (Verbose || WizardMode)) || PrintOpto) {
*** 6553,6562 **** --- 6560,6621 ---- } set_result(result); return true; } + bool LibraryCallKit::inline_character_compare(vmIntrinsics::ID id) { + if (!control()->is_Region()) { + return false; + } + RegionNode* r = control()->as_Region(); + + // argument(0) is receiver + Node* codePoint = argument(1); + Node* n = NULL; + + switch (id) { + case vmIntrinsics::_isDigit_c : + if (!Matcher::match_rule_supported(Op_DigitC)) { + return false; + } + n = new DigitCNode(0, codePoint); + break; + case vmIntrinsics::_isLowerCase_c : + if (!Matcher::match_rule_supported(Op_LowerCaseC)) { + return false; + } + n = new LowerCaseCNode(0, codePoint); + break; + case vmIntrinsics::_isUpperCase_c : + if (!Matcher::match_rule_supported(Op_UpperCaseC)) { + return false; + } + n = new UpperCaseCNode(0, codePoint); + break; + case vmIntrinsics::_isWhitespace_c : + if (!Matcher::match_rule_supported(Op_WhitespaceC)) { + return false; + } + n = new WhitespaceCNode(0, codePoint); + break; + default: + fatal_unexpected_iid(id); + } + + RegionNode *rgn = new RegionNode(2); + PhiNode *phi = new PhiNode(rgn, TypeInt::CHAR); + + // Swap current RegionNode with new one + Node* new_ctrl = r->in(1); + r->del_req(1); + rgn->init_req(1, new_ctrl); + phi->init_req(1, _gvn.transform(n)); + set_result(rgn, phi); + + return true; + } + bool LibraryCallKit::inline_profileBoolean() { Node* counts = argument(1); const TypeAryPtr* ary = NULL; ciArray* aobj = NULL; if (counts->is_Con()