src/cpu/x86/vm/interp_masm_x86_32.cpp

changeset 1861
2338d41fbd81
parent 1686
576e77447e3c
child 1907
c18cbe5936b8
child 1920
ab102d5d923e
     1.1 --- a/src/cpu/x86/vm/interp_masm_x86_32.cpp	Fri Apr 30 04:27:25 2010 -0700
     1.2 +++ b/src/cpu/x86/vm/interp_masm_x86_32.cpp	Fri Apr 30 08:37:24 2010 -0700
     1.3 @@ -265,89 +265,30 @@
     1.4  
     1.5  // Java Expression Stack
     1.6  
     1.7 -#ifdef ASSERT
     1.8 -void InterpreterMacroAssembler::verify_stack_tag(frame::Tag t) {
     1.9 -  if (TaggedStackInterpreter) {
    1.10 -    Label okay;
    1.11 -    cmpptr(Address(rsp, wordSize), (int32_t)t);
    1.12 -    jcc(Assembler::equal, okay);
    1.13 -    // Also compare if the stack value is zero, then the tag might
    1.14 -    // not have been set coming from deopt.
    1.15 -    cmpptr(Address(rsp, 0), 0);
    1.16 -    jcc(Assembler::equal, okay);
    1.17 -    stop("Java Expression stack tag value is bad");
    1.18 -    bind(okay);
    1.19 -  }
    1.20 -}
    1.21 -#endif // ASSERT
    1.22 -
    1.23  void InterpreterMacroAssembler::pop_ptr(Register r) {
    1.24 -  debug_only(verify_stack_tag(frame::TagReference));
    1.25    pop(r);
    1.26 -  if (TaggedStackInterpreter) addptr(rsp, 1 * wordSize);
    1.27 -}
    1.28 -
    1.29 -void InterpreterMacroAssembler::pop_ptr(Register r, Register tag) {
    1.30 -  pop(r);
    1.31 -  // Tag may not be reference for jsr, can be returnAddress
    1.32 -  if (TaggedStackInterpreter) pop(tag);
    1.33  }
    1.34  
    1.35  void InterpreterMacroAssembler::pop_i(Register r) {
    1.36 -  debug_only(verify_stack_tag(frame::TagValue));
    1.37    pop(r);
    1.38 -  if (TaggedStackInterpreter) addptr(rsp, 1 * wordSize);
    1.39  }
    1.40  
    1.41  void InterpreterMacroAssembler::pop_l(Register lo, Register hi) {
    1.42 -  debug_only(verify_stack_tag(frame::TagValue));
    1.43    pop(lo);
    1.44 -  if (TaggedStackInterpreter) addptr(rsp, 1 * wordSize);
    1.45 -  debug_only(verify_stack_tag(frame::TagValue));
    1.46    pop(hi);
    1.47 -  if (TaggedStackInterpreter) addptr(rsp, 1 * wordSize);
    1.48  }
    1.49  
    1.50  void InterpreterMacroAssembler::pop_f() {
    1.51 -  debug_only(verify_stack_tag(frame::TagValue));
    1.52    fld_s(Address(rsp, 0));
    1.53    addptr(rsp, 1 * wordSize);
    1.54 -  if (TaggedStackInterpreter) addptr(rsp, 1 * wordSize);
    1.55  }
    1.56  
    1.57  void InterpreterMacroAssembler::pop_d() {
    1.58 -  // Write double to stack contiguously and load into ST0
    1.59 -  pop_dtos_to_rsp();
    1.60    fld_d(Address(rsp, 0));
    1.61    addptr(rsp, 2 * wordSize);
    1.62  }
    1.63  
    1.64  
    1.65 -// Pop the top of the java expression stack to execution stack (which
    1.66 -// happens to be the same place).
    1.67 -void InterpreterMacroAssembler::pop_dtos_to_rsp() {
    1.68 -  if (TaggedStackInterpreter) {
    1.69 -    // Pop double value into scratch registers
    1.70 -    debug_only(verify_stack_tag(frame::TagValue));
    1.71 -    pop(rax);
    1.72 -    addptr(rsp, 1* wordSize);
    1.73 -    debug_only(verify_stack_tag(frame::TagValue));
    1.74 -    pop(rdx);
    1.75 -    addptr(rsp, 1* wordSize);
    1.76 -    push(rdx);
    1.77 -    push(rax);
    1.78 -  }
    1.79 -}
    1.80 -
    1.81 -void InterpreterMacroAssembler::pop_ftos_to_rsp() {
    1.82 -  if (TaggedStackInterpreter) {
    1.83 -    debug_only(verify_stack_tag(frame::TagValue));
    1.84 -    pop(rax);
    1.85 -    addptr(rsp, 1 * wordSize);
    1.86 -    push(rax);  // ftos is at rsp
    1.87 -  }
    1.88 -}
    1.89 -
    1.90  void InterpreterMacroAssembler::pop(TosState state) {
    1.91    switch (state) {
    1.92      case atos: pop_ptr(rax);                                 break;
    1.93 @@ -365,54 +306,28 @@
    1.94  }
    1.95  
    1.96  void InterpreterMacroAssembler::push_ptr(Register r) {
    1.97 -  if (TaggedStackInterpreter) push(frame::TagReference);
    1.98 -  push(r);
    1.99 -}
   1.100 -
   1.101 -void InterpreterMacroAssembler::push_ptr(Register r, Register tag) {
   1.102 -  if (TaggedStackInterpreter) push(tag);  // tag first
   1.103    push(r);
   1.104  }
   1.105  
   1.106  void InterpreterMacroAssembler::push_i(Register r) {
   1.107 -  if (TaggedStackInterpreter) push(frame::TagValue);
   1.108    push(r);
   1.109  }
   1.110  
   1.111  void InterpreterMacroAssembler::push_l(Register lo, Register hi) {
   1.112 -  if (TaggedStackInterpreter) push(frame::TagValue);
   1.113    push(hi);
   1.114 -  if (TaggedStackInterpreter) push(frame::TagValue);
   1.115    push(lo);
   1.116  }
   1.117  
   1.118  void InterpreterMacroAssembler::push_f() {
   1.119 -  if (TaggedStackInterpreter) push(frame::TagValue);
   1.120    // Do not schedule for no AGI! Never write beyond rsp!
   1.121    subptr(rsp, 1 * wordSize);
   1.122    fstp_s(Address(rsp, 0));
   1.123  }
   1.124  
   1.125  void InterpreterMacroAssembler::push_d(Register r) {
   1.126 -  if (TaggedStackInterpreter) {
   1.127 -    // Double values are stored as:
   1.128 -    //   tag
   1.129 -    //   high
   1.130 -    //   tag
   1.131 -    //   low
   1.132 -    push(frame::TagValue);
   1.133 -    subptr(rsp, 3 * wordSize);
   1.134 -    fstp_d(Address(rsp, 0));
   1.135 -    // move high word up to slot n-1
   1.136 -    movl(r, Address(rsp, 1*wordSize));
   1.137 -    movl(Address(rsp, 2*wordSize), r);
   1.138 -    // move tag
   1.139 -    movl(Address(rsp, 1*wordSize), frame::TagValue);
   1.140 -  } else {
   1.141 -    // Do not schedule for no AGI! Never write beyond rsp!
   1.142 -    subptr(rsp, 2 * wordSize);
   1.143 -    fstp_d(Address(rsp, 0));
   1.144 -  }
   1.145 +  // Do not schedule for no AGI! Never write beyond rsp!
   1.146 +  subptr(rsp, 2 * wordSize);
   1.147 +  fstp_d(Address(rsp, 0));
   1.148  }
   1.149  
   1.150  
   1.151 @@ -433,118 +348,15 @@
   1.152  }
   1.153  
   1.154  
   1.155 -// Tagged stack helpers for swap and dup
   1.156 -void InterpreterMacroAssembler::load_ptr_and_tag(int n, Register val,
   1.157 -                                                 Register tag) {
   1.158 +// Helpers for swap and dup
   1.159 +void InterpreterMacroAssembler::load_ptr(int n, Register val) {
   1.160    movptr(val, Address(rsp, Interpreter::expr_offset_in_bytes(n)));
   1.161 -  if (TaggedStackInterpreter) {
   1.162 -    movptr(tag, Address(rsp, Interpreter::expr_tag_offset_in_bytes(n)));
   1.163 -  }
   1.164  }
   1.165  
   1.166 -void InterpreterMacroAssembler::store_ptr_and_tag(int n, Register val,
   1.167 -                                                  Register tag) {
   1.168 +void InterpreterMacroAssembler::store_ptr(int n, Register val) {
   1.169    movptr(Address(rsp, Interpreter::expr_offset_in_bytes(n)), val);
   1.170 -  if (TaggedStackInterpreter) {
   1.171 -    movptr(Address(rsp, Interpreter::expr_tag_offset_in_bytes(n)), tag);
   1.172 -  }
   1.173  }
   1.174  
   1.175 -
   1.176 -// Tagged local support
   1.177 -void InterpreterMacroAssembler::tag_local(frame::Tag tag, int n) {
   1.178 -  if (TaggedStackInterpreter) {
   1.179 -    if (tag == frame::TagCategory2) {
   1.180 -      movptr(Address(rdi, Interpreter::local_tag_offset_in_bytes(n+1)), (int32_t)frame::TagValue);
   1.181 -      movptr(Address(rdi, Interpreter::local_tag_offset_in_bytes(n)), (int32_t)frame::TagValue);
   1.182 -    } else {
   1.183 -      movptr(Address(rdi, Interpreter::local_tag_offset_in_bytes(n)), (int32_t)tag);
   1.184 -    }
   1.185 -  }
   1.186 -}
   1.187 -
   1.188 -void InterpreterMacroAssembler::tag_local(frame::Tag tag, Register idx) {
   1.189 -  if (TaggedStackInterpreter) {
   1.190 -    if (tag == frame::TagCategory2) {
   1.191 -      movptr(Address(rdi, idx, Interpreter::stackElementScale(),
   1.192 -                  Interpreter::local_tag_offset_in_bytes(1)), (int32_t)frame::TagValue);
   1.193 -      movptr(Address(rdi, idx, Interpreter::stackElementScale(),
   1.194 -                    Interpreter::local_tag_offset_in_bytes(0)), (int32_t)frame::TagValue);
   1.195 -    } else {
   1.196 -      movptr(Address(rdi, idx, Interpreter::stackElementScale(),
   1.197 -                               Interpreter::local_tag_offset_in_bytes(0)), (int32_t)tag);
   1.198 -    }
   1.199 -  }
   1.200 -}
   1.201 -
   1.202 -void InterpreterMacroAssembler::tag_local(Register tag, Register idx) {
   1.203 -  if (TaggedStackInterpreter) {
   1.204 -    // can only be TagValue or TagReference
   1.205 -    movptr(Address(rdi, idx, Interpreter::stackElementScale(),
   1.206 -                           Interpreter::local_tag_offset_in_bytes(0)), tag);
   1.207 -  }
   1.208 -}
   1.209 -
   1.210 -
   1.211 -void InterpreterMacroAssembler::tag_local(Register tag, int n) {
   1.212 -  if (TaggedStackInterpreter) {
   1.213 -    // can only be TagValue or TagReference
   1.214 -    movptr(Address(rdi, Interpreter::local_tag_offset_in_bytes(n)), tag);
   1.215 -  }
   1.216 -}
   1.217 -
   1.218 -#ifdef ASSERT
   1.219 -void InterpreterMacroAssembler::verify_local_tag(frame::Tag tag, int n) {
   1.220 -  if (TaggedStackInterpreter) {
   1.221 -     frame::Tag t = tag;
   1.222 -    if (tag == frame::TagCategory2) {
   1.223 -      Label nbl;
   1.224 -      t = frame::TagValue;  // change to what is stored in locals
   1.225 -      cmpptr(Address(rdi, Interpreter::local_tag_offset_in_bytes(n+1)), (int32_t)t);
   1.226 -      jcc(Assembler::equal, nbl);
   1.227 -      stop("Local tag is bad for long/double");
   1.228 -      bind(nbl);
   1.229 -    }
   1.230 -    Label notBad;
   1.231 -    cmpptr(Address(rdi, Interpreter::local_tag_offset_in_bytes(n)), (int32_t)t);
   1.232 -    jcc(Assembler::equal, notBad);
   1.233 -    // Also compare if the local value is zero, then the tag might
   1.234 -    // not have been set coming from deopt.
   1.235 -    cmpptr(Address(rdi, Interpreter::local_offset_in_bytes(n)), 0);
   1.236 -    jcc(Assembler::equal, notBad);
   1.237 -    stop("Local tag is bad");
   1.238 -    bind(notBad);
   1.239 -  }
   1.240 -}
   1.241 -
   1.242 -void InterpreterMacroAssembler::verify_local_tag(frame::Tag tag, Register idx) {
   1.243 -  if (TaggedStackInterpreter) {
   1.244 -    frame::Tag t = tag;
   1.245 -    if (tag == frame::TagCategory2) {
   1.246 -      Label nbl;
   1.247 -      t = frame::TagValue;  // change to what is stored in locals
   1.248 -      cmpptr(Address(rdi, idx, Interpreter::stackElementScale(),
   1.249 -                  Interpreter::local_tag_offset_in_bytes(1)), (int32_t)t);
   1.250 -      jcc(Assembler::equal, nbl);
   1.251 -      stop("Local tag is bad for long/double");
   1.252 -      bind(nbl);
   1.253 -    }
   1.254 -    Label notBad;
   1.255 -    cmpl(Address(rdi, idx, Interpreter::stackElementScale(),
   1.256 -                  Interpreter::local_tag_offset_in_bytes(0)), (int32_t)t);
   1.257 -    jcc(Assembler::equal, notBad);
   1.258 -    // Also compare if the local value is zero, then the tag might
   1.259 -    // not have been set coming from deopt.
   1.260 -    cmpptr(Address(rdi, idx, Interpreter::stackElementScale(),
   1.261 -                  Interpreter::local_offset_in_bytes(0)), 0);
   1.262 -    jcc(Assembler::equal, notBad);
   1.263 -    stop("Local tag is bad");
   1.264 -    bind(notBad);
   1.265 -
   1.266 -  }
   1.267 -}
   1.268 -#endif // ASSERT
   1.269 -
   1.270  void InterpreterMacroAssembler::super_call_VM_leaf(address entry_point) {
   1.271    MacroAssembler::call_VM_leaf_base(entry_point, 0);
   1.272  }

mercurial