1 /*
2 * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
922 }
923 //
924 // src or dst could be j.l.Object when other is basic type array:
925 //
926 // arraycopy(char[],0,Object*,0,size);
927 // arraycopy(Object*,0,char[],0,size);
928 //
929 // Don't add edges in such cases.
930 //
931 bool arg_is_arraycopy_dest = src_has_oops && is_arraycopy &&
932 arg_has_oops && (i > TypeFunc::Parms);
933 #ifdef ASSERT
934 if (!(is_arraycopy ||
935 (call->as_CallLeaf()->_name != NULL &&
936 (strcmp(call->as_CallLeaf()->_name, "g1_wb_pre") == 0 ||
937 strcmp(call->as_CallLeaf()->_name, "g1_wb_post") == 0 ||
938 strcmp(call->as_CallLeaf()->_name, "updateBytesCRC32") == 0 ||
939 strcmp(call->as_CallLeaf()->_name, "aescrypt_encryptBlock") == 0 ||
940 strcmp(call->as_CallLeaf()->_name, "aescrypt_decryptBlock") == 0 ||
941 strcmp(call->as_CallLeaf()->_name, "cipherBlockChaining_encryptAESCrypt") == 0 ||
942 strcmp(call->as_CallLeaf()->_name, "cipherBlockChaining_decryptAESCrypt") == 0)
943 ))) {
944 call->dump();
945 fatal(err_msg_res("EA unexpected CallLeaf %s", call->as_CallLeaf()->_name));
946 }
947 #endif
948 // Always process arraycopy's destination object since
949 // we need to add all possible edges to references in
950 // source object.
951 if (arg_esc >= PointsToNode::ArgEscape &&
952 !arg_is_arraycopy_dest) {
953 continue;
954 }
955 set_escape_state(arg_ptn, PointsToNode::ArgEscape);
956 if (arg_is_arraycopy_dest) {
957 Node* src = call->in(TypeFunc::Parms);
958 if (src->is_AddP()) {
959 src = get_addp_base(src);
960 }
961 PointsToNode* src_ptn = ptnode_adr(src->_idx);
962 assert(src_ptn != NULL, "should be registered");
|
1 /*
2 * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
922 }
923 //
924 // src or dst could be j.l.Object when other is basic type array:
925 //
926 // arraycopy(char[],0,Object*,0,size);
927 // arraycopy(Object*,0,char[],0,size);
928 //
929 // Don't add edges in such cases.
930 //
931 bool arg_is_arraycopy_dest = src_has_oops && is_arraycopy &&
932 arg_has_oops && (i > TypeFunc::Parms);
933 #ifdef ASSERT
934 if (!(is_arraycopy ||
935 (call->as_CallLeaf()->_name != NULL &&
936 (strcmp(call->as_CallLeaf()->_name, "g1_wb_pre") == 0 ||
937 strcmp(call->as_CallLeaf()->_name, "g1_wb_post") == 0 ||
938 strcmp(call->as_CallLeaf()->_name, "updateBytesCRC32") == 0 ||
939 strcmp(call->as_CallLeaf()->_name, "aescrypt_encryptBlock") == 0 ||
940 strcmp(call->as_CallLeaf()->_name, "aescrypt_decryptBlock") == 0 ||
941 strcmp(call->as_CallLeaf()->_name, "cipherBlockChaining_encryptAESCrypt") == 0 ||
942 strcmp(call->as_CallLeaf()->_name, "cipherBlockChaining_decryptAESCrypt") == 0 ||
943 strcmp(call->as_CallLeaf()->_name, "sha1_implCompress") == 0 ||
944 strcmp(call->as_CallLeaf()->_name, "sha1_implCompressMB") == 0 ||
945 strcmp(call->as_CallLeaf()->_name, "sha256_implCompress") == 0 ||
946 strcmp(call->as_CallLeaf()->_name, "sha256_implCompressMB") == 0 ||
947 strcmp(call->as_CallLeaf()->_name, "sha512_implCompress") == 0 ||
948 strcmp(call->as_CallLeaf()->_name, "sha512_implCompressMB") == 0)
949 ))) {
950 call->dump();
951 fatal(err_msg_res("EA unexpected CallLeaf %s", call->as_CallLeaf()->_name));
952 }
953 #endif
954 // Always process arraycopy's destination object since
955 // we need to add all possible edges to references in
956 // source object.
957 if (arg_esc >= PointsToNode::ArgEscape &&
958 !arg_is_arraycopy_dest) {
959 continue;
960 }
961 set_escape_state(arg_ptn, PointsToNode::ArgEscape);
962 if (arg_is_arraycopy_dest) {
963 Node* src = call->in(TypeFunc::Parms);
964 if (src->is_AddP()) {
965 src = get_addp_base(src);
966 }
967 PointsToNode* src_ptn = ptnode_adr(src->_idx);
968 assert(src_ptn != NULL, "should be registered");
|