comparison src/share/vm/oops/constantPool.cpp @ 7957:0d26ce8e9251

Merge
author acorn
date Mon, 28 Jan 2013 10:34:07 -0500
parents 16fb9f942703 edd76a5856f7
children dc31f560d6e7
comparison
equal deleted inserted replaced
7956:16fb9f942703 7957:0d26ce8e9251
1097 1097
1098 return false; 1098 return false;
1099 } // end compare_entry_to() 1099 } // end compare_entry_to()
1100 1100
1101 1101
1102 // Copy this constant pool's entries at start_i to end_i (inclusive) 1102 void ConstantPool::copy_operands(constantPoolHandle from_cp,
1103 // to the constant pool to_cp's entries starting at to_i. A total of 1103 constantPoolHandle to_cp,
1104 // (end_i - start_i) + 1 entries are copied. 1104 TRAPS) {
1105 void ConstantPool::copy_cp_to_impl(constantPoolHandle from_cp, int start_i, int end_i,
1106 constantPoolHandle to_cp, int to_i, TRAPS) {
1107
1108 int dest_i = to_i; // leave original alone for debug purposes
1109
1110 for (int src_i = start_i; src_i <= end_i; /* see loop bottom */ ) {
1111 copy_entry_to(from_cp, src_i, to_cp, dest_i, CHECK);
1112
1113 switch (from_cp->tag_at(src_i).value()) {
1114 case JVM_CONSTANT_Double:
1115 case JVM_CONSTANT_Long:
1116 // double and long take two constant pool entries
1117 src_i += 2;
1118 dest_i += 2;
1119 break;
1120
1121 default:
1122 // all others take one constant pool entry
1123 src_i++;
1124 dest_i++;
1125 break;
1126 }
1127 }
1128 1105
1129 int from_oplen = operand_array_length(from_cp->operands()); 1106 int from_oplen = operand_array_length(from_cp->operands());
1130 int old_oplen = operand_array_length(to_cp->operands()); 1107 int old_oplen = operand_array_length(to_cp->operands());
1131 if (from_oplen != 0) { 1108 if (from_oplen != 0) {
1132 ClassLoaderData* loader_data = to_cp->pool_holder()->class_loader_data(); 1109 ClassLoaderData* loader_data = to_cp->pool_holder()->class_loader_data();
1178 1155
1179 // replace target operands array with combined array 1156 // replace target operands array with combined array
1180 to_cp->set_operands(new_operands); 1157 to_cp->set_operands(new_operands);
1181 } 1158 }
1182 } 1159 }
1183 1160 } // end copy_operands()
1184 } // end copy_cp_to() 1161
1162
1163 // Copy this constant pool's entries at start_i to end_i (inclusive)
1164 // to the constant pool to_cp's entries starting at to_i. A total of
1165 // (end_i - start_i) + 1 entries are copied.
1166 void ConstantPool::copy_cp_to_impl(constantPoolHandle from_cp, int start_i, int end_i,
1167 constantPoolHandle to_cp, int to_i, TRAPS) {
1168
1169
1170 int dest_i = to_i; // leave original alone for debug purposes
1171
1172 for (int src_i = start_i; src_i <= end_i; /* see loop bottom */ ) {
1173 copy_entry_to(from_cp, src_i, to_cp, dest_i, CHECK);
1174
1175 switch (from_cp->tag_at(src_i).value()) {
1176 case JVM_CONSTANT_Double:
1177 case JVM_CONSTANT_Long:
1178 // double and long take two constant pool entries
1179 src_i += 2;
1180 dest_i += 2;
1181 break;
1182
1183 default:
1184 // all others take one constant pool entry
1185 src_i++;
1186 dest_i++;
1187 break;
1188 }
1189 }
1190 copy_operands(from_cp, to_cp, CHECK);
1191
1192 } // end copy_cp_to_impl()
1185 1193
1186 1194
1187 // Copy this constant pool's entry at from_i to the constant pool 1195 // Copy this constant pool's entry at from_i to the constant pool
1188 // to_cp's entry at to_i. 1196 // to_cp's entry at to_i.
1189 void ConstantPool::copy_entry_to(constantPoolHandle from_cp, int from_i, 1197 void ConstantPool::copy_entry_to(constantPoolHandle from_cp, int from_i,