639
640 #ifdef HACK
641 {
642 ResourceMark rm;
643 char *method_name = istate->method()->name_and_sig_as_C_string();
644 if (strstr(method_name, "runThese$TestRunner.run()V") != NULL) {
645 tty->print_cr("entering: depth %d bci: %d",
646 (istate->_stack_base - istate->_stack),
647 istate->_bcp - istate->_method->code_base());
648 interesting = true;
649 }
650 }
651 #endif // HACK
652
653
654 // lock method if synchronized
655 if (METHOD->is_synchronized()) {
656 // oop rcvr = locals[0].j.r;
657 oop rcvr;
658 if (METHOD->is_static()) {
659 rcvr = METHOD->constants()->pool_holder()->klass_part()->java_mirror();
660 } else {
661 rcvr = LOCALS_OBJECT(0);
662 VERIFY_OOP(rcvr);
663 }
664 // The initial monitor is ours for the taking
665 BasicObjectLock* mon = &istate->monitor_base()[-1];
666 oop monobj = mon->obj();
667 assert(mon->obj() == rcvr, "method monitor mis-initialized");
668
669 bool success = UseBiasedLocking;
670 if (UseBiasedLocking) {
671 markOop mark = rcvr->mark();
672 if (mark->has_bias_pattern()) {
673 // The bias pattern is present in the object's header. Need to check
674 // whether the bias owner and the epoch are both still current.
675 intptr_t xx = ((intptr_t) THREAD) ^ (intptr_t) mark;
676 xx = (intptr_t) rcvr->klass()->klass_part()->prototype_header() ^ xx;
677 intptr_t yy = (xx & ~((int) markOopDesc::age_mask_in_place));
678 if (yy != 0 ) {
679 // At this point we know that the header has the bias pattern and
2094 incr = 3;
2095 wide = true;
2096 }
2097
2098 constantPoolOop constants = METHOD->constants();
2099 switch (constants->tag_at(index).value()) {
2100 case JVM_CONSTANT_Integer:
2101 SET_STACK_INT(constants->int_at(index), 0);
2102 break;
2103
2104 case JVM_CONSTANT_Float:
2105 SET_STACK_FLOAT(constants->float_at(index), 0);
2106 break;
2107
2108 case JVM_CONSTANT_String:
2109 VERIFY_OOP(constants->resolved_string_at(index));
2110 SET_STACK_OBJECT(constants->resolved_string_at(index), 0);
2111 break;
2112
2113 case JVM_CONSTANT_Class:
2114 VERIFY_OOP(constants->resolved_klass_at(index)->klass_part()->java_mirror());
2115 SET_STACK_OBJECT(constants->resolved_klass_at(index)->klass_part()->java_mirror(), 0);
2116 break;
2117
2118 case JVM_CONSTANT_UnresolvedString:
2119 case JVM_CONSTANT_UnresolvedClass:
2120 case JVM_CONSTANT_UnresolvedClassInError:
2121 CALL_VM(InterpreterRuntime::ldc(THREAD, wide), handle_exception);
2122 SET_STACK_OBJECT(THREAD->vm_result(), 0);
2123 THREAD->set_vm_result(NULL);
2124 break;
2125
2126 default: ShouldNotReachHere();
2127 }
2128 UPDATE_PC_AND_TOS_AND_CONTINUE(incr, 1);
2129 }
2130
2131 CASE(_ldc2_w):
2132 {
2133 u2 index = Bytes::get_Java_u2(pc+1);
2134
2135 constantPoolOop constants = METHOD->constants();
|
639
640 #ifdef HACK
641 {
642 ResourceMark rm;
643 char *method_name = istate->method()->name_and_sig_as_C_string();
644 if (strstr(method_name, "runThese$TestRunner.run()V") != NULL) {
645 tty->print_cr("entering: depth %d bci: %d",
646 (istate->_stack_base - istate->_stack),
647 istate->_bcp - istate->_method->code_base());
648 interesting = true;
649 }
650 }
651 #endif // HACK
652
653
654 // lock method if synchronized
655 if (METHOD->is_synchronized()) {
656 // oop rcvr = locals[0].j.r;
657 oop rcvr;
658 if (METHOD->is_static()) {
659 rcvr = METHOD->constants()->pool_holder()->java_mirror();
660 } else {
661 rcvr = LOCALS_OBJECT(0);
662 VERIFY_OOP(rcvr);
663 }
664 // The initial monitor is ours for the taking
665 BasicObjectLock* mon = &istate->monitor_base()[-1];
666 oop monobj = mon->obj();
667 assert(mon->obj() == rcvr, "method monitor mis-initialized");
668
669 bool success = UseBiasedLocking;
670 if (UseBiasedLocking) {
671 markOop mark = rcvr->mark();
672 if (mark->has_bias_pattern()) {
673 // The bias pattern is present in the object's header. Need to check
674 // whether the bias owner and the epoch are both still current.
675 intptr_t xx = ((intptr_t) THREAD) ^ (intptr_t) mark;
676 xx = (intptr_t) rcvr->klass()->klass_part()->prototype_header() ^ xx;
677 intptr_t yy = (xx & ~((int) markOopDesc::age_mask_in_place));
678 if (yy != 0 ) {
679 // At this point we know that the header has the bias pattern and
2094 incr = 3;
2095 wide = true;
2096 }
2097
2098 constantPoolOop constants = METHOD->constants();
2099 switch (constants->tag_at(index).value()) {
2100 case JVM_CONSTANT_Integer:
2101 SET_STACK_INT(constants->int_at(index), 0);
2102 break;
2103
2104 case JVM_CONSTANT_Float:
2105 SET_STACK_FLOAT(constants->float_at(index), 0);
2106 break;
2107
2108 case JVM_CONSTANT_String:
2109 VERIFY_OOP(constants->resolved_string_at(index));
2110 SET_STACK_OBJECT(constants->resolved_string_at(index), 0);
2111 break;
2112
2113 case JVM_CONSTANT_Class:
2114 VERIFY_OOP(constants->resolved_klass_at(index)->java_mirror());
2115 SET_STACK_OBJECT(constants->resolved_klass_at(index)->java_mirror(), 0);
2116 break;
2117
2118 case JVM_CONSTANT_UnresolvedString:
2119 case JVM_CONSTANT_UnresolvedClass:
2120 case JVM_CONSTANT_UnresolvedClassInError:
2121 CALL_VM(InterpreterRuntime::ldc(THREAD, wide), handle_exception);
2122 SET_STACK_OBJECT(THREAD->vm_result(), 0);
2123 THREAD->set_vm_result(NULL);
2124 break;
2125
2126 default: ShouldNotReachHere();
2127 }
2128 UPDATE_PC_AND_TOS_AND_CONTINUE(incr, 1);
2129 }
2130
2131 CASE(_ldc2_w):
2132 {
2133 u2 index = Bytes::get_Java_u2(pc+1);
2134
2135 constantPoolOop constants = METHOD->constants();
|