1.1 --- a/src/cpu/x86/vm/interp_masm_x86_64.cpp Fri Apr 30 04:27:25 2010 -0700 1.2 +++ b/src/cpu/x86/vm/interp_masm_x86_64.cpp Fri Apr 30 08:37:24 2010 -0700 1.3 @@ -264,113 +264,51 @@ 1.4 1.5 // Java Expression Stack 1.6 1.7 -#ifdef ASSERT 1.8 -// Verifies that the stack tag matches. Must be called before the stack 1.9 -// value is popped off the stack. 1.10 -void InterpreterMacroAssembler::verify_stack_tag(frame::Tag t) { 1.11 - if (TaggedStackInterpreter) { 1.12 - frame::Tag tag = t; 1.13 - if (t == frame::TagCategory2) { 1.14 - tag = frame::TagValue; 1.15 - Label hokay; 1.16 - cmpptr(Address(rsp, 3*wordSize), (int32_t)tag); 1.17 - jcc(Assembler::equal, hokay); 1.18 - stop("Java Expression stack tag high value is bad"); 1.19 - bind(hokay); 1.20 - } 1.21 - Label okay; 1.22 - cmpptr(Address(rsp, wordSize), (int32_t)tag); 1.23 - jcc(Assembler::equal, okay); 1.24 - // Also compare if the stack value is zero, then the tag might 1.25 - // not have been set coming from deopt. 1.26 - cmpptr(Address(rsp, 0), 0); 1.27 - jcc(Assembler::equal, okay); 1.28 - stop("Java Expression stack tag value is bad"); 1.29 - bind(okay); 1.30 - } 1.31 -} 1.32 -#endif // ASSERT 1.33 - 1.34 void InterpreterMacroAssembler::pop_ptr(Register r) { 1.35 - debug_only(verify_stack_tag(frame::TagReference)); 1.36 pop(r); 1.37 - if (TaggedStackInterpreter) addptr(rsp, 1 * wordSize); 1.38 -} 1.39 - 1.40 -void InterpreterMacroAssembler::pop_ptr(Register r, Register tag) { 1.41 - pop(r); 1.42 - if (TaggedStackInterpreter) pop(tag); 1.43 } 1.44 1.45 void InterpreterMacroAssembler::pop_i(Register r) { 1.46 // XXX can't use pop currently, upper half non clean 1.47 - debug_only(verify_stack_tag(frame::TagValue)); 1.48 movl(r, Address(rsp, 0)); 1.49 addptr(rsp, wordSize); 1.50 - if (TaggedStackInterpreter) addptr(rsp, 1 * wordSize); 1.51 } 1.52 1.53 void InterpreterMacroAssembler::pop_l(Register r) { 1.54 - debug_only(verify_stack_tag(frame::TagCategory2)); 1.55 movq(r, Address(rsp, 0)); 1.56 - addptr(rsp, 2 * Interpreter::stackElementSize()); 1.57 + addptr(rsp, 2 * Interpreter::stackElementSize); 1.58 } 1.59 1.60 void InterpreterMacroAssembler::pop_f(XMMRegister r) { 1.61 - debug_only(verify_stack_tag(frame::TagValue)); 1.62 movflt(r, Address(rsp, 0)); 1.63 addptr(rsp, wordSize); 1.64 - if (TaggedStackInterpreter) addptr(rsp, 1 * wordSize); 1.65 } 1.66 1.67 void InterpreterMacroAssembler::pop_d(XMMRegister r) { 1.68 - debug_only(verify_stack_tag(frame::TagCategory2)); 1.69 movdbl(r, Address(rsp, 0)); 1.70 - addptr(rsp, 2 * Interpreter::stackElementSize()); 1.71 + addptr(rsp, 2 * Interpreter::stackElementSize); 1.72 } 1.73 1.74 void InterpreterMacroAssembler::push_ptr(Register r) { 1.75 - if (TaggedStackInterpreter) push(frame::TagReference); 1.76 - push(r); 1.77 -} 1.78 - 1.79 -void InterpreterMacroAssembler::push_ptr(Register r, Register tag) { 1.80 - if (TaggedStackInterpreter) push(tag); 1.81 push(r); 1.82 } 1.83 1.84 void InterpreterMacroAssembler::push_i(Register r) { 1.85 - if (TaggedStackInterpreter) push(frame::TagValue); 1.86 push(r); 1.87 } 1.88 1.89 void InterpreterMacroAssembler::push_l(Register r) { 1.90 - if (TaggedStackInterpreter) { 1.91 - push(frame::TagValue); 1.92 - subptr(rsp, 1 * wordSize); 1.93 - push(frame::TagValue); 1.94 - subptr(rsp, 1 * wordSize); 1.95 - } else { 1.96 - subptr(rsp, 2 * wordSize); 1.97 - } 1.98 + subptr(rsp, 2 * wordSize); 1.99 movq(Address(rsp, 0), r); 1.100 } 1.101 1.102 void InterpreterMacroAssembler::push_f(XMMRegister r) { 1.103 - if (TaggedStackInterpreter) push(frame::TagValue); 1.104 subptr(rsp, wordSize); 1.105 movflt(Address(rsp, 0), r); 1.106 } 1.107 1.108 void InterpreterMacroAssembler::push_d(XMMRegister r) { 1.109 - if (TaggedStackInterpreter) { 1.110 - push(frame::TagValue); 1.111 - subptr(rsp, 1 * wordSize); 1.112 - push(frame::TagValue); 1.113 - subptr(rsp, 1 * wordSize); 1.114 - } else { 1.115 - subptr(rsp, 2 * wordSize); 1.116 - } 1.117 + subptr(rsp, 2 * wordSize); 1.118 movdbl(Address(rsp, 0), r); 1.119 } 1.120 1.121 @@ -407,118 +345,16 @@ 1.122 } 1.123 1.124 1.125 - 1.126 - 1.127 -// Tagged stack helpers for swap and dup 1.128 -void InterpreterMacroAssembler::load_ptr_and_tag(int n, Register val, 1.129 - Register tag) { 1.130 +// Helpers for swap and dup 1.131 +void InterpreterMacroAssembler::load_ptr(int n, Register val) { 1.132 movptr(val, Address(rsp, Interpreter::expr_offset_in_bytes(n))); 1.133 - if (TaggedStackInterpreter) { 1.134 - movptr(tag, Address(rsp, Interpreter::expr_tag_offset_in_bytes(n))); 1.135 - } 1.136 } 1.137 1.138 -void InterpreterMacroAssembler::store_ptr_and_tag(int n, Register val, 1.139 - Register tag) { 1.140 +void InterpreterMacroAssembler::store_ptr(int n, Register val) { 1.141 movptr(Address(rsp, Interpreter::expr_offset_in_bytes(n)), val); 1.142 - if (TaggedStackInterpreter) { 1.143 - movptr(Address(rsp, Interpreter::expr_tag_offset_in_bytes(n)), tag); 1.144 - } 1.145 } 1.146 1.147 1.148 -// Tagged local support 1.149 -void InterpreterMacroAssembler::tag_local(frame::Tag tag, int n) { 1.150 - if (TaggedStackInterpreter) { 1.151 - if (tag == frame::TagCategory2) { 1.152 - movptr(Address(r14, Interpreter::local_tag_offset_in_bytes(n+1)), 1.153 - (int32_t)frame::TagValue); 1.154 - movptr(Address(r14, Interpreter::local_tag_offset_in_bytes(n)), 1.155 - (int32_t)frame::TagValue); 1.156 - } else { 1.157 - movptr(Address(r14, Interpreter::local_tag_offset_in_bytes(n)), (int32_t)tag); 1.158 - } 1.159 - } 1.160 -} 1.161 - 1.162 -void InterpreterMacroAssembler::tag_local(frame::Tag tag, Register idx) { 1.163 - if (TaggedStackInterpreter) { 1.164 - if (tag == frame::TagCategory2) { 1.165 - movptr(Address(r14, idx, Address::times_8, 1.166 - Interpreter::local_tag_offset_in_bytes(1)), (int32_t)frame::TagValue); 1.167 - movptr(Address(r14, idx, Address::times_8, 1.168 - Interpreter::local_tag_offset_in_bytes(0)), (int32_t)frame::TagValue); 1.169 - } else { 1.170 - movptr(Address(r14, idx, Address::times_8, Interpreter::local_tag_offset_in_bytes(0)), 1.171 - (int32_t)tag); 1.172 - } 1.173 - } 1.174 -} 1.175 - 1.176 -void InterpreterMacroAssembler::tag_local(Register tag, Register idx) { 1.177 - if (TaggedStackInterpreter) { 1.178 - // can only be TagValue or TagReference 1.179 - movptr(Address(r14, idx, Address::times_8, Interpreter::local_tag_offset_in_bytes(0)), tag); 1.180 - } 1.181 -} 1.182 - 1.183 - 1.184 -void InterpreterMacroAssembler::tag_local(Register tag, int n) { 1.185 - if (TaggedStackInterpreter) { 1.186 - // can only be TagValue or TagReference 1.187 - movptr(Address(r14, Interpreter::local_tag_offset_in_bytes(n)), tag); 1.188 - } 1.189 -} 1.190 - 1.191 -#ifdef ASSERT 1.192 -void InterpreterMacroAssembler::verify_local_tag(frame::Tag tag, int n) { 1.193 - if (TaggedStackInterpreter) { 1.194 - frame::Tag t = tag; 1.195 - if (tag == frame::TagCategory2) { 1.196 - Label nbl; 1.197 - t = frame::TagValue; // change to what is stored in locals 1.198 - cmpptr(Address(r14, Interpreter::local_tag_offset_in_bytes(n+1)), (int32_t)t); 1.199 - jcc(Assembler::equal, nbl); 1.200 - stop("Local tag is bad for long/double"); 1.201 - bind(nbl); 1.202 - } 1.203 - Label notBad; 1.204 - cmpq(Address(r14, Interpreter::local_tag_offset_in_bytes(n)), (int32_t)t); 1.205 - jcc(Assembler::equal, notBad); 1.206 - // Also compare if the local value is zero, then the tag might 1.207 - // not have been set coming from deopt. 1.208 - cmpptr(Address(r14, Interpreter::local_offset_in_bytes(n)), 0); 1.209 - jcc(Assembler::equal, notBad); 1.210 - stop("Local tag is bad"); 1.211 - bind(notBad); 1.212 - } 1.213 -} 1.214 - 1.215 -void InterpreterMacroAssembler::verify_local_tag(frame::Tag tag, Register idx) { 1.216 - if (TaggedStackInterpreter) { 1.217 - frame::Tag t = tag; 1.218 - if (tag == frame::TagCategory2) { 1.219 - Label nbl; 1.220 - t = frame::TagValue; // change to what is stored in locals 1.221 - cmpptr(Address(r14, idx, Address::times_8, Interpreter::local_tag_offset_in_bytes(1)), (int32_t)t); 1.222 - jcc(Assembler::equal, nbl); 1.223 - stop("Local tag is bad for long/double"); 1.224 - bind(nbl); 1.225 - } 1.226 - Label notBad; 1.227 - cmpptr(Address(r14, idx, Address::times_8, Interpreter::local_tag_offset_in_bytes(0)), (int32_t)t); 1.228 - jcc(Assembler::equal, notBad); 1.229 - // Also compare if the local value is zero, then the tag might 1.230 - // not have been set coming from deopt. 1.231 - cmpptr(Address(r14, idx, Address::times_8, Interpreter::local_offset_in_bytes(0)), 0); 1.232 - jcc(Assembler::equal, notBad); 1.233 - stop("Local tag is bad"); 1.234 - bind(notBad); 1.235 - } 1.236 -} 1.237 -#endif // ASSERT 1.238 - 1.239 - 1.240 void InterpreterMacroAssembler::super_call_VM_leaf(address entry_point) { 1.241 MacroAssembler::call_VM_leaf_base(entry_point, 0); 1.242 }