comparison src/cpu/x86/vm/methodHandles_x86.cpp @ 6740:75f33eecc1b3

7196681: NPG: Some JSR 292 tests crash in Windows exception handler Summary: There was a rogue os::breakpoint() call in log_dependency left over from the jsr292 merge. Also changed verify_oop() calls for metadata to verify_{method,klass}_ptr. Reviewed-by: kvn, twisti
author coleenp
date Tue, 11 Sep 2012 20:20:38 -0400
parents da91efe96a93
children 2cb2f30450c7
comparison
equal deleted inserted replaced
6739:8a02ca5e5576 6740:75f33eecc1b3
116 #endif //ASSERT 116 #endif //ASSERT
117 117
118 void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register temp, 118 void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register temp,
119 bool for_compiler_entry) { 119 bool for_compiler_entry) {
120 assert(method == rbx, "interpreter calling convention"); 120 assert(method == rbx, "interpreter calling convention");
121 __ verify_oop(method); 121 __ verify_method_ptr(method);
122 122
123 if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) { 123 if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
124 Label run_compiled_code; 124 Label run_compiled_code;
125 // JVMTI events, such as single-stepping, are implemented partly by avoiding running 125 // JVMTI events, such as single-stepping, are implemented partly by avoiding running
126 // compiled code in threads for which the event is enabled. Check here for 126 // compiled code in threads for which the event is enabled. Check here for
356 __ null_check(receiver_reg); 356 __ null_check(receiver_reg);
357 } else { 357 } else {
358 // load receiver klass itself 358 // load receiver klass itself
359 __ null_check(receiver_reg, oopDesc::klass_offset_in_bytes()); 359 __ null_check(receiver_reg, oopDesc::klass_offset_in_bytes());
360 __ load_klass(temp1_recv_klass, receiver_reg); 360 __ load_klass(temp1_recv_klass, receiver_reg);
361 __ verify_oop(temp1_recv_klass); 361 __ verify_klass_ptr(temp1_recv_klass);
362 } 362 }
363 BLOCK_COMMENT("check_receiver {"); 363 BLOCK_COMMENT("check_receiver {");
364 // The receiver for the MemberName must be in receiver_reg. 364 // The receiver for the MemberName must be in receiver_reg.
365 // Check the receiver against the MemberName.clazz 365 // Check the receiver against the MemberName.clazz
366 if (VerifyMethodHandles && iid == vmIntrinsics::_linkToSpecial) { 366 if (VerifyMethodHandles && iid == vmIntrinsics::_linkToSpecial) {
367 // Did not load it above... 367 // Did not load it above...
368 __ load_klass(temp1_recv_klass, receiver_reg); 368 __ load_klass(temp1_recv_klass, receiver_reg);
369 __ verify_oop(temp1_recv_klass); 369 __ verify_klass_ptr(temp1_recv_klass);
370 } 370 }
371 if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) { 371 if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) {
372 Label L_ok; 372 Label L_ok;
373 Register temp2_defc = temp2; 373 Register temp2_defc = temp2;
374 __ load_heap_oop(temp2_defc, member_clazz); 374 __ load_heap_oop(temp2_defc, member_clazz);
375 load_klass_from_Class(_masm, temp2_defc); 375 load_klass_from_Class(_masm, temp2_defc);
376 __ verify_oop(temp2_defc); 376 __ verify_klass_ptr(temp2_defc);
377 __ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, L_ok); 377 __ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, L_ok);
378 // If we get here, the type check failed! 378 // If we get here, the type check failed!
379 __ STOP("receiver class disagrees with MemberName.clazz"); 379 __ STOP("receiver class disagrees with MemberName.clazz");
380 __ bind(L_ok); 380 __ bind(L_ok);
381 } 381 }
449 } 449 }
450 450
451 Register temp3_intf = temp3; 451 Register temp3_intf = temp3;
452 __ load_heap_oop(temp3_intf, member_clazz); 452 __ load_heap_oop(temp3_intf, member_clazz);
453 load_klass_from_Class(_masm, temp3_intf); 453 load_klass_from_Class(_masm, temp3_intf);
454 __ verify_oop(temp3_intf); 454 __ verify_klass_ptr(temp3_intf);
455 455
456 Register rbx_index = rbx_method; 456 Register rbx_index = rbx_method;
457 __ movptr(rbx_index, member_vmindex); 457 __ movptr(rbx_index, member_vmindex);
458 if (VerifyMethodHandles) { 458 if (VerifyMethodHandles) {
459 Label L; 459 Label L;
469 // note: next two args must be the same: 469 // note: next two args must be the same:
470 rbx_index, rbx_method, 470 rbx_index, rbx_method,
471 temp2, 471 temp2,
472 L_no_such_interface); 472 L_no_such_interface);
473 473
474 __ verify_oop(rbx_method); 474 __ verify_method_ptr(rbx_method);
475 jump_from_method_handle(_masm, rbx_method, temp2, for_compiler_entry); 475 jump_from_method_handle(_masm, rbx_method, temp2, for_compiler_entry);
476 __ hlt(); 476 __ hlt();
477 477
478 __ bind(L_no_such_interface); 478 __ bind(L_no_such_interface);
479 __ jump(RuntimeAddress(StubRoutines::throw_IncompatibleClassChangeError_entry())); 479 __ jump(RuntimeAddress(StubRoutines::throw_IncompatibleClassChangeError_entry()));
489 // live at this point: rbx_method, rsi/r13 (if interpreted) 489 // live at this point: rbx_method, rsi/r13 (if interpreted)
490 490
491 // After figuring out which concrete method to call, jump into it. 491 // After figuring out which concrete method to call, jump into it.
492 // Note that this works in the interpreter with no data motion. 492 // Note that this works in the interpreter with no data motion.
493 // But the compiled version will require that rcx_recv be shifted out. 493 // But the compiled version will require that rcx_recv be shifted out.
494 __ verify_oop(rbx_method); 494 __ verify_method_ptr(rbx_method);
495 jump_from_method_handle(_masm, rbx_method, temp1, for_compiler_entry); 495 jump_from_method_handle(_masm, rbx_method, temp1, for_compiler_entry);
496 } 496 }
497 } 497 }
498 } 498 }
499 499