src/cpu/x86/vm/interp_masm_x86_32.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/cpu/x86/vm

src/cpu/x86/vm/interp_masm_x86_32.hpp

Print this page
rev 5468 : 8026251: New type profiling points: parameters to methods
Summary: x86 interpreter and c1 type profiling for parameters on method entries
Reviewed-by:
rev 5469 : [mq]: parameters-review


   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef CPU_X86_VM_INTERP_MASM_X86_32_HPP
  26 #define CPU_X86_VM_INTERP_MASM_X86_32_HPP
  27 
  28 #include "asm/macroAssembler.hpp"
  29 #include "asm/macroAssembler.inline.hpp"
  30 #include "interpreter/invocationCounter.hpp"
  31 #include "runtime/frame.hpp"
  32 
  33 // This file specializes the assember with interpreter-specific macros
  34 
  35 
  36 class InterpreterMacroAssembler: public MacroAssembler {
  37 #ifndef CC_INTERP
  38  protected:
  39   // Interpreter specific version of call_VM_base
  40   virtual void call_VM_leaf_base(
  41     address entry_point,
  42     int     number_of_arguments
  43   );
  44 
  45   virtual void call_VM_base(
  46     Register oop_result,
  47     Register java_thread,
  48     Register last_java_sp,
  49     address  entry_point,
  50     int      number_of_arguments,
  51     bool     check_exceptions
  52   );
  53 
  54   virtual void check_and_handle_popframe(Register java_thread);
  55   virtual void check_and_handle_earlyret(Register java_thread);
  56 
  57   // base routine for all dispatches
  58   void dispatch_base(TosState state, address* table, bool verifyoop = true);
  59 #endif /* CC_INTERP */
  60 
  61  public:
  62   InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code) {}
  63 
  64   void load_earlyret_value(TosState state);
  65 
  66   // Interpreter-specific registers
  67 #ifdef CC_INTERP
  68   void save_bcp()                                          { /*  not needed in c++ interpreter and harmless */ }
  69   void restore_bcp()                                       { /*  not needed in c++ interpreter and harmless */ }
  70 
  71   // Helpers for runtime call arguments/results
  72   void get_method(Register reg);
  73 
  74 #else
  75 
  76   void save_bcp()                                          { movptr(Address(rbp, frame::interpreter_frame_bcx_offset * wordSize), rsi); }
  77   void restore_bcp()                                       { movptr(rsi, Address(rbp, frame::interpreter_frame_bcx_offset * wordSize)); }
  78   void restore_locals()                                    { movptr(rdi, Address(rbp, frame::interpreter_frame_locals_offset * wordSize)); }
  79 
  80   // Helpers for runtime call arguments/results
  81   void get_method(Register reg)                            { movptr(reg, Address(rbp, frame::interpreter_frame_method_offset * wordSize)); }
  82   void get_const(Register reg)                             { get_method(reg); movptr(reg, Address(reg, Method::const_offset())); }


 198                                Register scratch, bool preloaded,
 199                                Condition cond, Label* where);
 200   void set_mdp_flag_at(Register mdp_in, int flag_constant);
 201   void test_mdp_data_at(Register mdp_in, int offset, Register value,
 202                         Register test_value_out,
 203                         Label& not_equal_continue);
 204 
 205   void record_klass_in_profile(Register receiver, Register mdp,
 206                                Register reg2, bool is_virtual_call);
 207   void record_klass_in_profile_helper(Register receiver, Register mdp,
 208                                       Register reg2, int start_row,
 209                                       Label& done, bool is_virtual_call);
 210 
 211   void update_mdp_by_offset(Register mdp_in, int offset_of_offset);
 212   void update_mdp_by_offset(Register mdp_in, Register reg, int offset_of_disp);
 213   void update_mdp_by_constant(Register mdp_in, int constant);
 214   void update_mdp_for_ret(Register return_bci);
 215 
 216   void profile_taken_branch(Register mdp, Register bumped_count);
 217   void profile_not_taken_branch(Register mdp);
 218   void profile_obj_type(Register obj, const Address& mdo_addr);
 219   void profile_arguments_type(Register mdp, Register callee, Register tmp, bool is_virtual);
 220   void profile_return_type(Register mdp, Register ret, Register tmp);
 221   void profile_call(Register mdp);
 222   void profile_final_call(Register mdp);
 223   void profile_virtual_call(Register receiver, Register mdp, Register scratch2,
 224                             bool receiver_can_be_null = false);
 225   void profile_ret(Register return_bci, Register mdp);
 226   void profile_null_seen(Register mdp);
 227   void profile_typecheck(Register mdp, Register klass, Register scratch);
 228   void profile_typecheck_failed(Register mdp);
 229   void profile_switch_default(Register mdp);
 230   void profile_switch_case(Register index_in_scratch, Register mdp, Register scratch2);
 231 
 232 #endif /* !CC_INTERP */
 233 
 234   typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode;
 235 
 236   // support for jvmti
 237   void notify_method_entry();
 238   void notify_method_exit(TosState state, NotifyMethodExitMode mode);
 239 
 240 };
 241 
 242 #endif // CPU_X86_VM_INTERP_MASM_X86_32_HPP


   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 












  25 #ifndef CC_INTERP
  26  protected:
  27   // Interpreter specific version of call_VM_base
  28   virtual void call_VM_leaf_base(
  29     address entry_point,
  30     int     number_of_arguments
  31   );
  32 
  33   virtual void call_VM_base(
  34     Register oop_result,
  35     Register java_thread,
  36     Register last_java_sp,
  37     address  entry_point,
  38     int      number_of_arguments,
  39     bool     check_exceptions
  40   );
  41 
  42   virtual void check_and_handle_popframe(Register java_thread);
  43   virtual void check_and_handle_earlyret(Register java_thread);
  44 
  45   // base routine for all dispatches
  46   void dispatch_base(TosState state, address* table, bool verifyoop = true);
  47 #endif /* CC_INTERP */
  48 
  49  public:
  50   InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code), _locals_register(rdi), _bcp_register(rsi) {}
  51 
  52   void load_earlyret_value(TosState state);
  53 
  54   // Interpreter-specific registers
  55 #ifdef CC_INTERP
  56   void save_bcp()                                          { /*  not needed in c++ interpreter and harmless */ }
  57   void restore_bcp()                                       { /*  not needed in c++ interpreter and harmless */ }
  58 
  59   // Helpers for runtime call arguments/results
  60   void get_method(Register reg);
  61 
  62 #else
  63 
  64   void save_bcp()                                          { movptr(Address(rbp, frame::interpreter_frame_bcx_offset * wordSize), rsi); }
  65   void restore_bcp()                                       { movptr(rsi, Address(rbp, frame::interpreter_frame_bcx_offset * wordSize)); }
  66   void restore_locals()                                    { movptr(rdi, Address(rbp, frame::interpreter_frame_locals_offset * wordSize)); }
  67 
  68   // Helpers for runtime call arguments/results
  69   void get_method(Register reg)                            { movptr(reg, Address(rbp, frame::interpreter_frame_method_offset * wordSize)); }
  70   void get_const(Register reg)                             { get_method(reg); movptr(reg, Address(reg, Method::const_offset())); }


 186                                Register scratch, bool preloaded,
 187                                Condition cond, Label* where);
 188   void set_mdp_flag_at(Register mdp_in, int flag_constant);
 189   void test_mdp_data_at(Register mdp_in, int offset, Register value,
 190                         Register test_value_out,
 191                         Label& not_equal_continue);
 192 
 193   void record_klass_in_profile(Register receiver, Register mdp,
 194                                Register reg2, bool is_virtual_call);
 195   void record_klass_in_profile_helper(Register receiver, Register mdp,
 196                                       Register reg2, int start_row,
 197                                       Label& done, bool is_virtual_call);
 198 
 199   void update_mdp_by_offset(Register mdp_in, int offset_of_offset);
 200   void update_mdp_by_offset(Register mdp_in, Register reg, int offset_of_disp);
 201   void update_mdp_by_constant(Register mdp_in, int constant);
 202   void update_mdp_for_ret(Register return_bci);
 203 
 204   void profile_taken_branch(Register mdp, Register bumped_count);
 205   void profile_not_taken_branch(Register mdp);



 206   void profile_call(Register mdp);
 207   void profile_final_call(Register mdp);
 208   void profile_virtual_call(Register receiver, Register mdp, Register scratch2,
 209                             bool receiver_can_be_null = false);
 210   void profile_ret(Register return_bci, Register mdp);
 211   void profile_null_seen(Register mdp);
 212   void profile_typecheck(Register mdp, Register klass, Register scratch);
 213   void profile_typecheck_failed(Register mdp);
 214   void profile_switch_default(Register mdp);
 215   void profile_switch_case(Register index_in_scratch, Register mdp, Register scratch2);
 216 
 217 #endif /* !CC_INTERP */
 218 
 219   typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode;
 220 
 221   // support for jvmti
 222   void notify_method_entry();
 223   void notify_method_exit(TosState state, NotifyMethodExitMode mode);




src/cpu/x86/vm/interp_masm_x86_32.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File