1 /* |
1 /* |
2 * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
1349 Node* zero = __ ConI(0); |
1349 Node* zero = __ ConI(0); |
1350 Node* one = __ ConI(1); |
1350 Node* one = __ ConI(1); |
1351 Node* cache = __ ConI(cache_i); |
1351 Node* cache = __ ConI(cache_i); |
1352 Node* md2 = __ ConI(md2_i); |
1352 Node* md2 = __ ConI(md2_i); |
1353 Node* lastChar = __ ConI(target_array->char_at(target_length - 1)); |
1353 Node* lastChar = __ ConI(target_array->char_at(target_length - 1)); |
1354 Node* targetCount = __ ConI(target_length); |
|
1355 Node* targetCountLess1 = __ ConI(target_length - 1); |
1354 Node* targetCountLess1 = __ ConI(target_length - 1); |
1356 Node* targetOffset = __ ConI(targetOffset_i); |
1355 Node* targetOffset = __ ConI(targetOffset_i); |
1357 Node* sourceEnd = __ SubI(__ AddI(sourceOffset, sourceCount), targetCountLess1); |
1356 Node* sourceEnd = __ SubI(__ AddI(sourceOffset, sourceCount), targetCountLess1); |
1358 |
1357 |
1359 IdealVariable rtn(kit), i(kit), j(kit); __ declarations_done(); |
1358 IdealVariable rtn(kit), i(kit), j(kit); __ declarations_done(); |
1406 bool LibraryCallKit::inline_string_indexOf() { |
1405 bool LibraryCallKit::inline_string_indexOf() { |
1407 Node* receiver = argument(0); |
1406 Node* receiver = argument(0); |
1408 Node* arg = argument(1); |
1407 Node* arg = argument(1); |
1409 |
1408 |
1410 Node* result; |
1409 Node* result; |
1411 // Disable the use of pcmpestri until it can be guaranteed that |
|
1412 // the load doesn't cross into the uncommited space. |
|
1413 if (Matcher::has_match_rule(Op_StrIndexOf) && |
1410 if (Matcher::has_match_rule(Op_StrIndexOf) && |
1414 UseSSE42Intrinsics) { |
1411 UseSSE42Intrinsics) { |
1415 // Generate SSE4.2 version of indexOf |
1412 // Generate SSE4.2 version of indexOf |
1416 // We currently only have match rules that use SSE4.2 |
1413 // We currently only have match rules that use SSE4.2 |
1417 |
1414 |
1418 receiver = null_check(receiver); |
1415 receiver = null_check(receiver); |
1419 arg = null_check(arg); |
1416 arg = null_check(arg); |
1420 if (stopped()) { |
1417 if (stopped()) { |
1421 return true; |
1418 return true; |
1422 } |
1419 } |
1423 |
|
1424 ciInstanceKlass* str_klass = env()->String_klass(); |
|
1425 const TypeOopPtr* string_type = TypeOopPtr::make_from_klass(str_klass); |
|
1426 |
1420 |
1427 // Make the merge point |
1421 // Make the merge point |
1428 RegionNode* result_rgn = new RegionNode(4); |
1422 RegionNode* result_rgn = new RegionNode(4); |
1429 Node* result_phi = new PhiNode(result_rgn, TypeInt::INT); |
1423 Node* result_phi = new PhiNode(result_rgn, TypeInt::INT); |
1430 Node* no_ctrl = NULL; |
1424 Node* no_ctrl = NULL; |