hotspot/src/cpu/sparc/vm/frame_sparc.cpp
changeset 35214 d86005e0b4c2
parent 35071 a0910b1d3e0d
child 38074 8475fdc6dcc3
child 38133 78b95467b9f1
equal deleted inserted replaced
35211:3771329165d4 35214:d86005e0b4c2
   439 intptr_t* frame::interpreter_frame_sender_sp() const {
   439 intptr_t* frame::interpreter_frame_sender_sp() const {
   440   assert(is_interpreted_frame(), "interpreted frame expected");
   440   assert(is_interpreted_frame(), "interpreted frame expected");
   441   return fp();
   441   return fp();
   442 }
   442 }
   443 
   443 
   444 #ifndef CC_INTERP
       
   445 void frame::set_interpreter_frame_sender_sp(intptr_t* sender_sp) {
   444 void frame::set_interpreter_frame_sender_sp(intptr_t* sender_sp) {
   446   assert(is_interpreted_frame(), "interpreted frame expected");
   445   assert(is_interpreted_frame(), "interpreted frame expected");
   447   Unimplemented();
   446   Unimplemented();
   448 }
   447 }
   449 #endif // CC_INTERP
       
   450 
   448 
   451 frame frame::sender_for_entry_frame(RegisterMap *map) const {
   449 frame frame::sender_for_entry_frame(RegisterMap *map) const {
   452   assert(map != NULL, "map must be set");
   450   assert(map != NULL, "map must be set");
   453   // Java frame called from C; skip all C frames and return top C
   451   // Java frame called from C; skip all C frames and return top C
   454   // frame of that chunk as the sender
   452   // frame of that chunk as the sender
   598 bool frame::is_valid_stack_pointer(intptr_t* valid_sp, intptr_t* sp) {
   596 bool frame::is_valid_stack_pointer(intptr_t* valid_sp, intptr_t* sp) {
   599   return next_younger_sp_or_null(valid_sp, sp) != NULL;
   597   return next_younger_sp_or_null(valid_sp, sp) != NULL;
   600 }
   598 }
   601 
   599 
   602 bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
   600 bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
   603 #ifdef CC_INTERP
       
   604   // Is there anything to do?
       
   605 #else
       
   606   assert(is_interpreted_frame(), "Not an interpreted frame");
   601   assert(is_interpreted_frame(), "Not an interpreted frame");
   607   // These are reasonable sanity checks
   602   // These are reasonable sanity checks
   608   if (fp() == 0 || (intptr_t(fp()) & (2*wordSize-1)) != 0) {
   603   if (fp() == 0 || (intptr_t(fp()) & (2*wordSize-1)) != 0) {
   609     return false;
   604     return false;
   610   }
   605   }
   652   address locals =  (address) *interpreter_frame_locals_addr();
   647   address locals =  (address) *interpreter_frame_locals_addr();
   653 
   648 
   654   if (locals > thread->stack_base() || locals < (address) fp()) return false;
   649   if (locals > thread->stack_base() || locals < (address) fp()) return false;
   655 
   650 
   656   // We'd have to be pretty unlucky to be mislead at this point
   651   // We'd have to be pretty unlucky to be mislead at this point
   657 #endif /* CC_INTERP */
       
   658   return true;
   652   return true;
   659 }
   653 }
   660 
   654 
   661 
   655 
   662 // Windows have been flushed on entry (but not marked). Capture the pc that
   656 // Windows have been flushed on entry (but not marked). Capture the pc that
   710 
   704 
   711   if (method->is_native()) {
   705   if (method->is_native()) {
   712     // Prior to notifying the runtime of the method_exit the possible result
   706     // Prior to notifying the runtime of the method_exit the possible result
   713     // value is saved to l_scratch and d_scratch.
   707     // value is saved to l_scratch and d_scratch.
   714 
   708 
   715 #ifdef CC_INTERP
       
   716     interpreterState istate = get_interpreterState();
       
   717     intptr_t* l_scratch = (intptr_t*) &istate->_native_lresult;
       
   718     intptr_t* d_scratch = (intptr_t*) &istate->_native_fresult;
       
   719 #else /* CC_INTERP */
       
   720     intptr_t* l_scratch = fp() + interpreter_frame_l_scratch_fp_offset;
   709     intptr_t* l_scratch = fp() + interpreter_frame_l_scratch_fp_offset;
   721     intptr_t* d_scratch = fp() + interpreter_frame_d_scratch_fp_offset;
   710     intptr_t* d_scratch = fp() + interpreter_frame_d_scratch_fp_offset;
   722 #endif /* CC_INTERP */
       
   723 
   711 
   724     address l_addr = (address)l_scratch;
   712     address l_addr = (address)l_scratch;
   725 #ifdef _LP64
   713 #ifdef _LP64
   726     // On 64-bit the result for 1/8/16/32-bit result types is in the other
   714     // On 64-bit the result for 1/8/16/32-bit result types is in the other
   727     // word half
   715     // word half
   729 #endif
   717 #endif
   730 
   718 
   731     switch (type) {
   719     switch (type) {
   732       case T_OBJECT:
   720       case T_OBJECT:
   733       case T_ARRAY: {
   721       case T_ARRAY: {
   734 #ifdef CC_INTERP
       
   735         *oop_result = istate->_oop_temp;
       
   736 #else
       
   737         oop obj = cast_to_oop(at(interpreter_frame_oop_temp_offset));
   722         oop obj = cast_to_oop(at(interpreter_frame_oop_temp_offset));
   738         assert(obj == NULL || Universe::heap()->is_in(obj), "sanity check");
   723         assert(obj == NULL || Universe::heap()->is_in(obj), "sanity check");
   739         *oop_result = obj;
   724         *oop_result = obj;
   740 #endif // CC_INTERP
       
   741         break;
   725         break;
   742       }
   726       }
   743 
   727 
   744       case T_BOOLEAN : { jint* p = (jint*)l_addr; value_result->z = (jboolean)((*p) & 0x1); break; }
   728       case T_BOOLEAN : { jint* p = (jint*)l_addr; value_result->z = (jboolean)((*p) & 0x1); break; }
   745       case T_BYTE    : { jint* p = (jint*)l_addr; value_result->b = (jbyte)((*p) & 0xff); break; }
   729       case T_BYTE    : { jint* p = (jint*)l_addr; value_result->b = (jbyte)((*p) & 0xff); break; }
   795   for (int w = 0; w < frame::register_save_words; w++) {
   779   for (int w = 0; w < frame::register_save_words; w++) {
   796     values.describe(frame_no, sp() + w, err_msg("register save area word %d", w), 1);
   780     values.describe(frame_no, sp() + w, err_msg("register save area word %d", w), 1);
   797   }
   781   }
   798 
   782 
   799   if (is_interpreted_frame()) {
   783   if (is_interpreted_frame()) {
   800 #ifndef CC_INTERP
       
   801     DESCRIBE_FP_OFFSET(interpreter_frame_d_scratch_fp);
   784     DESCRIBE_FP_OFFSET(interpreter_frame_d_scratch_fp);
   802     DESCRIBE_FP_OFFSET(interpreter_frame_l_scratch_fp);
   785     DESCRIBE_FP_OFFSET(interpreter_frame_l_scratch_fp);
   803     DESCRIBE_FP_OFFSET(interpreter_frame_padding);
   786     DESCRIBE_FP_OFFSET(interpreter_frame_padding);
   804     DESCRIBE_FP_OFFSET(interpreter_frame_oop_temp);
   787     DESCRIBE_FP_OFFSET(interpreter_frame_oop_temp);
   805 
   788 
   806     // esp, according to Lesp (e.g. not depending on bci), if seems valid
   789     // esp, according to Lesp (e.g. not depending on bci), if seems valid
   807     intptr_t* esp = *interpreter_frame_esp_addr();
   790     intptr_t* esp = *interpreter_frame_esp_addr();
   808     if ((esp >= sp()) && (esp < fp())) {
   791     if ((esp >= sp()) && (esp < fp())) {
   809       values.describe(-1, esp, "*Lesp");
   792       values.describe(-1, esp, "*Lesp");
   810     }
   793     }
   811 #endif
       
   812   }
   794   }
   813 
   795 
   814   if (!is_compiled_frame()) {
   796   if (!is_compiled_frame()) {
   815     if (frame::callee_aggregate_return_pointer_words != 0) {
   797     if (frame::callee_aggregate_return_pointer_words != 0) {
   816       values.describe(frame_no, sp() + frame::callee_aggregate_return_pointer_sp_offset, "callee_aggregate_return_pointer_word");
   798       values.describe(frame_no, sp() + frame::callee_aggregate_return_pointer_sp_offset, "callee_aggregate_return_pointer_word");