src/share/vm/interpreter/interpreterRuntime.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/interpreter

src/share/vm/interpreter/interpreterRuntime.cpp

Print this page




1192 
1193 #if defined(IA32) || defined(AMD64) || defined(ARM)
1194 IRT_LEAF(void, InterpreterRuntime::popframe_move_outgoing_args(JavaThread* thread, void* src_address, void* dest_address))
1195   if (src_address == dest_address) {
1196     return;
1197   }
1198   ResetNoHandleMark rnm; // In a LEAF entry.
1199   HandleMark hm;
1200   ResourceMark rm;
1201   frame fr = thread->last_frame();
1202   assert(fr.is_interpreted_frame(), "");
1203   jint bci = fr.interpreter_frame_bci();
1204   methodHandle mh(thread, fr.interpreter_frame_method());
1205   Bytecode_invoke invoke(mh, bci);
1206   ArgumentSizeComputer asc(invoke.signature());
1207   int size_of_arguments = (asc.size() + (invoke.has_receiver() ? 1 : 0)); // receiver
1208   Copy::conjoint_jbytes(src_address, dest_address,
1209                        size_of_arguments * Interpreter::stackElementSize);
1210 IRT_END
1211 #endif































































































1192 
1193 #if defined(IA32) || defined(AMD64) || defined(ARM)
1194 IRT_LEAF(void, InterpreterRuntime::popframe_move_outgoing_args(JavaThread* thread, void* src_address, void* dest_address))
1195   if (src_address == dest_address) {
1196     return;
1197   }
1198   ResetNoHandleMark rnm; // In a LEAF entry.
1199   HandleMark hm;
1200   ResourceMark rm;
1201   frame fr = thread->last_frame();
1202   assert(fr.is_interpreted_frame(), "");
1203   jint bci = fr.interpreter_frame_bci();
1204   methodHandle mh(thread, fr.interpreter_frame_method());
1205   Bytecode_invoke invoke(mh, bci);
1206   ArgumentSizeComputer asc(invoke.signature());
1207   int size_of_arguments = (asc.size() + (invoke.has_receiver() ? 1 : 0)); // receiver
1208   Copy::conjoint_jbytes(src_address, dest_address,
1209                        size_of_arguments * Interpreter::stackElementSize);
1210 IRT_END
1211 #endif
1212 
1213 #ifdef ASSERT
1214 static void print_field_info(TosState state, oop obj, int offset, jvalue* value) {
1215   switch (state) {
1216     case btos: tty->print_cr(" (old_value=" INT32_FORMAT ") (new_value=" INT32_FORMAT ")", obj->bool_field(offset), *value); break;
1217     case ctos: tty->print_cr(" (old_value=" INT32_FORMAT ") (new_value=" INT32_FORMAT ")", obj->char_field(offset), *value); break;
1218     case stos: tty->print_cr(" (old_value=" INT32_FORMAT ") (new_value=" INT32_FORMAT ")", obj->short_field(offset), *value); break;
1219     case itos: tty->print_cr(" (old_value=" INT32_FORMAT ") (new_value=" INT32_FORMAT ")", obj->int_field(offset), *value); break;
1220     case ftos: tty->print_cr(" (old_value=%f) (new_value=%f)", obj->float_field(offset), *value); break;
1221     case dtos: tty->print_cr(" (old_value=%lf) (new_value=%lf)", obj->double_field(offset), *value); break;
1222     case atos: tty->print_cr(" (old_value=" INTPTR_FORMAT ") (new_value=" INTPTR_FORMAT ")", obj->obj_field(offset), *value); break;
1223     case ltos: tty->print_cr(" (old_value=" JLONG_FORMAT ") (new_value=" JLONG_FORMAT ")", obj->long_field(offset), *value); break;
1224     default: fatal(err_msg("Unexpected field type: " INT32_FORMAT, state));
1225   }
1226 }
1227 
1228 static void assert_stable_property(TosState state, oop obj, int offset, jvalue* value) {
1229   switch (state) {
1230     case btos:
1231       assert(obj->bool_field(offset) == 0, "");
1232       assert((*value).b != 0, "");
1233       break;
1234     case ctos:
1235       assert(obj->char_field(offset) == 0, "");
1236       assert((*value).c != 0, "");
1237       break;
1238     case stos:
1239       assert(obj->short_field(offset) == 0, "");
1240       assert((*value).s != 0, "");
1241       break;
1242     case itos:
1243       assert(obj->int_field(offset) == 0, "");
1244       assert((*value).i != 0, "");
1245       break;
1246     case ftos:
1247       assert(obj->float_field(offset) == 0, "");
1248       assert((*value).f != 0, "");
1249       break;
1250     case atos:
1251       assert(obj->obj_field(offset) == NULL, "");
1252       assert((*value).l != 0, "");
1253       break;
1254     case ltos:
1255       assert(obj->long_field(offset) == 0, "");
1256       assert((*value).j != 0, "");
1257       break;
1258     case dtos:
1259       assert(obj->double_field(offset) == 0, "");
1260       assert((*value).d != 0, "");
1261       break;
1262     default:
1263       fatal(err_msg("Unexpected field type: " INT32_FORMAT, state));
1264   }
1265 }
1266 
1267 IRT_ENTRY(void, InterpreterRuntime::verify_stable(JavaThread *thread,
1268   oopDesc* obj, ConstantPoolCacheEntry *cp_entry, jvalue *value))
1269   assert(cp_entry != NULL, "");
1270 
1271   Klass* k = (Klass*)cp_entry->f1_as_klass();
1272   // check the access_flags for the field in the klass
1273   InstanceKlass* ik = InstanceKlass::cast(k);
1274   int index = cp_entry->field_index();
1275   bool is_stable = (ik->field_access_flags(index) & JVM_ACC_FIELD_STABLE);
1276 
1277   if (!is_stable) return;
1278 
1279   bool is_static = (obj == NULL);
1280   if (is_static) {
1281     obj = ik->java_mirror();
1282   }
1283 
1284   int offset = ik->field_offset(index);
1285 
1286   if (TraceStableFieldUpdates) {
1287     tty->print("%s::%s (static=%d) (type=%d) (index=%d) (offset=%d)",
1288                ik->name()->as_C_string(), ik->field_name(index)->as_C_string(),
1289                is_static, cp_entry->flag_state(), index, offset);
1290 
1291     if (is_static) {
1292       tty->print(" (klass=" INTPTR_FORMAT ")", obj);
1293     } else {
1294       tty->print(" (obj=" INTPTR_FORMAT ")", obj);
1295     }
1296 
1297     print_field_info(cp_entry->flag_state(), obj, offset, value);
1298   }
1299 
1300   if (VerifyStable) {
1301     assert_stable_property(cp_entry->flag_state(), obj, offset, value);
1302   }
1303 IRT_END
1304 #endif // ASSERT
src/share/vm/interpreter/interpreterRuntime.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File