1.1 --- a/src/cpu/sparc/vm/assembler_sparc.cpp Thu Jun 02 13:36:11 2011 -0700 1.2 +++ b/src/cpu/sparc/vm/assembler_sparc.cpp Fri Jun 03 22:31:43 2011 -0700 1.3 @@ -42,6 +42,12 @@ 1.4 #include "gc_implementation/g1/heapRegion.hpp" 1.5 #endif 1.6 1.7 +#ifdef PRODUCT 1.8 +#define BLOCK_COMMENT(str) /* nothing */ 1.9 +#else 1.10 +#define BLOCK_COMMENT(str) block_comment(str) 1.11 +#endif 1.12 + 1.13 // Convert the raw encoding form into the form expected by the 1.14 // constructor for Address. 1.15 Address Address::make_raw(int base, int index, int scale, int disp, bool disp_is_oop) { 1.16 @@ -1072,6 +1078,12 @@ 1.17 check_and_forward_exception(Gtemp); 1.18 } 1.19 1.20 +#ifdef ASSERT 1.21 + set(badHeapWordVal, G3); 1.22 + set(badHeapWordVal, G4); 1.23 + set(badHeapWordVal, G5); 1.24 +#endif 1.25 + 1.26 // get oop result if there is one and reset the value in the thread 1.27 if (oop_result->is_valid()) { 1.28 get_vm_result(oop_result); 1.29 @@ -1177,6 +1189,11 @@ 1.30 call(entry_point, relocInfo::runtime_call_type); 1.31 delayed()->nop(); 1.32 restore_thread(thread_cache); 1.33 +#ifdef ASSERT 1.34 + set(badHeapWordVal, G3); 1.35 + set(badHeapWordVal, G4); 1.36 + set(badHeapWordVal, G5); 1.37 +#endif 1.38 } 1.39 1.40 1.41 @@ -1518,7 +1535,7 @@ 1.42 // save_frame: given number of "extra" words in frame, 1.43 // issue approp. save instruction (p 200, v8 manual) 1.44 1.45 -void MacroAssembler::save_frame(int extraWords = 0) { 1.46 +void MacroAssembler::save_frame(int extraWords) { 1.47 int delta = -total_frame_size_in_bytes(extraWords); 1.48 if (is_simm13(delta)) { 1.49 save(SP, delta, SP); 1.50 @@ -1730,6 +1747,7 @@ 1.51 1.52 if (reg == G0) return; // always NULL, which is always an oop 1.53 1.54 + BLOCK_COMMENT("verify_oop {"); 1.55 char buffer[64]; 1.56 #ifdef COMPILER1 1.57 if (CommentedAssembly) { 1.58 @@ -1768,6 +1786,7 @@ 1.59 delayed()->nop(); 1.60 // recover frame size 1.61 add(SP, 8*8,SP); 1.62 + BLOCK_COMMENT("} verify_oop"); 1.63 } 1.64 1.65 void MacroAssembler::_verify_oop_addr(Address addr, const char* msg, const char * file, int line) { 1.66 @@ -2040,7 +2059,7 @@ 1.67 } 1.68 else 1.69 ::tty->print_cr("=============== DEBUG MESSAGE: %s ================\n", msg); 1.70 - assert(false, "error"); 1.71 + assert(false, err_msg("DEBUG MESSAGE: %s", msg)); 1.72 } 1.73 1.74 1.75 @@ -3230,6 +3249,7 @@ 1.76 1.77 1.78 RegisterOrConstant MacroAssembler::argument_offset(RegisterOrConstant arg_slot, 1.79 + Register temp_reg, 1.80 int extra_slot_offset) { 1.81 // cf. TemplateTable::prepare_invoke(), if (load_receiver). 1.82 int stackElementSize = Interpreter::stackElementSize; 1.83 @@ -3238,18 +3258,19 @@ 1.84 offset += arg_slot.as_constant() * stackElementSize; 1.85 return offset; 1.86 } else { 1.87 - Register temp = arg_slot.as_register(); 1.88 - sll_ptr(temp, exact_log2(stackElementSize), temp); 1.89 + assert(temp_reg != noreg, "must specify"); 1.90 + sll_ptr(arg_slot.as_register(), exact_log2(stackElementSize), temp_reg); 1.91 if (offset != 0) 1.92 - add(temp, offset, temp); 1.93 - return temp; 1.94 + add(temp_reg, offset, temp_reg); 1.95 + return temp_reg; 1.96 } 1.97 } 1.98 1.99 1.100 Address MacroAssembler::argument_address(RegisterOrConstant arg_slot, 1.101 + Register temp_reg, 1.102 int extra_slot_offset) { 1.103 - return Address(Gargs, argument_offset(arg_slot, extra_slot_offset)); 1.104 + return Address(Gargs, argument_offset(arg_slot, temp_reg, extra_slot_offset)); 1.105 } 1.106 1.107 1.108 @@ -4906,4 +4927,3 @@ 1.109 // Caller should set it: 1.110 // add(G0, 1, result); // equals 1.111 } 1.112 -