1087 RegisterMap map(thread(), true);
1088 frame caller_fr = stub_fr.sender(&map);
1089
1090 // Should only be poll_return or poll
1091 assert( nm->is_at_poll_or_poll_return(real_return_addr), "should not be at call" );
1092
1093 // This is a poll immediately before a return. The exception handling code
1094 // has already had the effect of causing the return to occur, so the execution
1095 // will continue immediately after the call. In addition, the oopmap at the
1096 // return point does not mark the return value as an oop (if it is), so
1097 // it needs a handle here to be updated.
1098 if( nm->is_at_poll_return(real_return_addr) ) {
1099 // See if return type is an oop.
1100 bool return_oop = nm->method()->is_returning_oop();
1101 Handle return_value;
1102 if (return_oop) {
1103 // The oop result has been saved on the stack together with all
1104 // the other registers. In order to preserve it over GCs we need
1105 // to keep it in a handle.
1106 oop result = caller_fr.saved_oop_result(&map);
1107 assert(result == NULL || result->is_oop(), "must be oop");
1108 return_value = Handle(thread(), result);
1109 assert(Universe::heap()->is_in_or_null(result), "must be heap pointer");
1110 }
1111
1112 // Block the thread
1113 SafepointSynchronize::block(thread());
1114
1115 // restore oop result, if any
1116 if (return_oop) {
1117 caller_fr.set_saved_oop_result(&map, return_value());
1118 }
1119 }
1120
1121 // This is a safepoint poll. Verify the return address and block.
1122 else {
1123 set_at_poll_safepoint(true);
1124
1125 // verify the blob built the "return address" correctly
1126 assert(real_return_addr == caller_fr.pc(), "must match");
1127
|
1087 RegisterMap map(thread(), true);
1088 frame caller_fr = stub_fr.sender(&map);
1089
1090 // Should only be poll_return or poll
1091 assert( nm->is_at_poll_or_poll_return(real_return_addr), "should not be at call" );
1092
1093 // This is a poll immediately before a return. The exception handling code
1094 // has already had the effect of causing the return to occur, so the execution
1095 // will continue immediately after the call. In addition, the oopmap at the
1096 // return point does not mark the return value as an oop (if it is), so
1097 // it needs a handle here to be updated.
1098 if( nm->is_at_poll_return(real_return_addr) ) {
1099 // See if return type is an oop.
1100 bool return_oop = nm->method()->is_returning_oop();
1101 Handle return_value;
1102 if (return_oop) {
1103 // The oop result has been saved on the stack together with all
1104 // the other registers. In order to preserve it over GCs we need
1105 // to keep it in a handle.
1106 oop result = caller_fr.saved_oop_result(&map);
1107 assert(result == NULL || oopDesc::is_oop(result), "must be oop");
1108 return_value = Handle(thread(), result);
1109 assert(Universe::heap()->is_in_or_null(result), "must be heap pointer");
1110 }
1111
1112 // Block the thread
1113 SafepointSynchronize::block(thread());
1114
1115 // restore oop result, if any
1116 if (return_oop) {
1117 caller_fr.set_saved_oop_result(&map, return_value());
1118 }
1119 }
1120
1121 // This is a safepoint poll. Verify the return address and block.
1122 else {
1123 set_at_poll_safepoint(true);
1124
1125 // verify the blob built the "return address" correctly
1126 assert(real_return_addr == caller_fr.pc(), "must match");
1127
|