hotspot/src/cpu/x86/vm/interp_masm_x86.cpp
changeset 35214 d86005e0b4c2
parent 35071 a0910b1d3e0d
child 37152 29e68f1d35bb
equal deleted inserted replaced
35211:3771329165d4 35214:d86005e0b4c2
    43 void InterpreterMacroAssembler::jump_to_entry(address entry) {
    43 void InterpreterMacroAssembler::jump_to_entry(address entry) {
    44   assert(entry, "Entry must have been generated by now");
    44   assert(entry, "Entry must have been generated by now");
    45   jump(RuntimeAddress(entry));
    45   jump(RuntimeAddress(entry));
    46 }
    46 }
    47 
    47 
    48 #ifndef CC_INTERP
       
    49 void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& mdo_addr) {
    48 void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& mdo_addr) {
    50   Label update, next, none;
    49   Label update, next, none;
    51 
    50 
    52   verify_oop(obj);
    51   verify_oop(obj);
    53 
    52 
   244     jcc(Assembler::positive, loop);
   243     jcc(Assembler::positive, loop);
   245 
   244 
   246     bind(profile_continue);
   245     bind(profile_continue);
   247   }
   246   }
   248 }
   247 }
   249 #endif
   248 
   250 
       
   251 #ifdef CC_INTERP
       
   252 void InterpreterMacroAssembler::get_method(Register reg) {
       
   253   movptr(reg, Address(rbp, -(sizeof(BytecodeInterpreter) + 2 * wordSize)));
       
   254   movptr(reg, Address(reg, byte_offset_of(BytecodeInterpreter, _method)));
       
   255 }
       
   256 #endif // CC_INTERP
       
   257 
       
   258 #ifndef CC_INTERP
       
   259 void InterpreterMacroAssembler::call_VM_leaf_base(address entry_point,
   249 void InterpreterMacroAssembler::call_VM_leaf_base(address entry_point,
   260                                                   int number_of_arguments) {
   250                                                   int number_of_arguments) {
   261   // interpreter specific
   251   // interpreter specific
   262   //
   252   //
   263   // Note: No need to save/restore bcp & locals registers
   253   // Note: No need to save/restore bcp & locals registers
  1044   }
  1034   }
  1045   leave();                           // remove frame anchor
  1035   leave();                           // remove frame anchor
  1046   pop(ret_addr);                     // get return address
  1036   pop(ret_addr);                     // get return address
  1047   mov(rsp, rbx);                     // set sp to sender sp
  1037   mov(rsp, rbx);                     // set sp to sender sp
  1048 }
  1038 }
  1049 #endif // !CC_INTERP
       
  1050 
  1039 
  1051 void InterpreterMacroAssembler::get_method_counters(Register method,
  1040 void InterpreterMacroAssembler::get_method_counters(Register method,
  1052                                                     Register mcs, Label& skip) {
  1041                                                     Register mcs, Label& skip) {
  1053   Label has_counters;
  1042   Label has_counters;
  1054   movptr(mcs, Address(method, Method::method_counters_offset()));
  1043   movptr(mcs, Address(method, Method::method_counters_offset()));
  1225     bind(done);
  1214     bind(done);
  1226 
  1215 
  1227     restore_bcp();
  1216     restore_bcp();
  1228   }
  1217   }
  1229 }
  1218 }
  1230 #ifndef CC_INTERP
  1219 
  1231 void InterpreterMacroAssembler::test_method_data_pointer(Register mdp,
  1220 void InterpreterMacroAssembler::test_method_data_pointer(Register mdp,
  1232                                                          Label& zero_continue) {
  1221                                                          Label& zero_continue) {
  1233   assert(ProfileInterpreter, "must be profiling interpreter");
  1222   assert(ProfileInterpreter, "must be profiling interpreter");
  1234   movptr(mdp, Address(rbp, frame::interpreter_frame_mdp_offset * wordSize));
  1223   movptr(mdp, Address(rbp, frame::interpreter_frame_mdp_offset * wordSize));
  1235   testptr(mdp, mdp);
  1224   testptr(mdp, mdp);
  1884   incrementl(scratch, increment);
  1873   incrementl(scratch, increment);
  1885   movl(counter_addr, scratch);
  1874   movl(counter_addr, scratch);
  1886   andl(scratch, mask);
  1875   andl(scratch, mask);
  1887   jcc(cond, *where);
  1876   jcc(cond, *where);
  1888 }
  1877 }
  1889 #endif // CC_INTERP
       
  1890 
  1878 
  1891 void InterpreterMacroAssembler::notify_method_entry() {
  1879 void InterpreterMacroAssembler::notify_method_entry() {
  1892   // Whenever JVMTI is interp_only_mode, method entry/exit events are sent to
  1880   // Whenever JVMTI is interp_only_mode, method entry/exit events are sent to
  1893   // track stack depth.  If it is possible to enter interp_only_mode we add
  1881   // track stack depth.  If it is possible to enter interp_only_mode we add
  1894   // the code to check if the event should be sent.
  1882   // the code to check if the event should be sent.
  1936     // Note: frame::interpreter_frame_result has a dependency on how the
  1924     // Note: frame::interpreter_frame_result has a dependency on how the
  1937     // method result is saved across the call to post_method_exit. If this
  1925     // method result is saved across the call to post_method_exit. If this
  1938     // is changed then the interpreter_frame_result implementation will
  1926     // is changed then the interpreter_frame_result implementation will
  1939     // need to be updated too.
  1927     // need to be updated too.
  1940 
  1928 
  1941     // For c++ interpreter the result is always stored at a known location in the frame
  1929     // template interpreter will leave the result on the top of the stack.
  1942     // template interpreter will leave it on the top of the stack.
  1930     push(state);
  1943     NOT_CC_INTERP(push(state);)
       
  1944     NOT_LP64(get_thread(rthread);)
  1931     NOT_LP64(get_thread(rthread);)
  1945     movl(rdx, Address(rthread, JavaThread::interp_only_mode_offset()));
  1932     movl(rdx, Address(rthread, JavaThread::interp_only_mode_offset()));
  1946     testl(rdx, rdx);
  1933     testl(rdx, rdx);
  1947     jcc(Assembler::zero, L);
  1934     jcc(Assembler::zero, L);
  1948     call_VM(noreg,
  1935     call_VM(noreg,
  1949             CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_exit));
  1936             CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_exit));
  1950     bind(L);
  1937     bind(L);
  1951     NOT_CC_INTERP(pop(state));
  1938     pop(state);
  1952   }
  1939   }
  1953 
  1940 
  1954   {
  1941   {
  1955     SkipIfEqual skip(this, &DTraceMethodProbes, false);
  1942     SkipIfEqual skip(this, &DTraceMethodProbes, false);
  1956     NOT_CC_INTERP(push(state));
  1943     push(state);
  1957     NOT_LP64(get_thread(rthread);)
  1944     NOT_LP64(get_thread(rthread);)
  1958     get_method(rarg);
  1945     get_method(rarg);
  1959     call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit),
  1946     call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit),
  1960                  rthread, rarg);
  1947                  rthread, rarg);
  1961     NOT_CC_INTERP(pop(state));
  1948     pop(state);
  1962   }
  1949   }
  1963 }
  1950 }