src/cpu/sparc/vm/interp_masm_sparc.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8074457 Sdiff src/cpu/sparc/vm

src/cpu/sparc/vm/interp_masm_sparc.hpp

Print this page




  37 REGISTER_DECLARATION(     Register, Otos_l1, O0); // for 1st part of longs
  38 REGISTER_DECLARATION(     Register, Otos_l2, O1); // for 2nd part of longs
  39 REGISTER_DECLARATION(FloatRegister, Ftos_f , F0); // for floats
  40 REGISTER_DECLARATION(FloatRegister, Ftos_d , F0); // for doubles
  41 REGISTER_DECLARATION(FloatRegister, Ftos_d1, F0); // for 1st part of double
  42 REGISTER_DECLARATION(FloatRegister, Ftos_d2, F1); // for 2nd part of double
  43 
  44 #ifndef DONT_USE_REGISTER_DEFINES
  45 #define Otos_i  O0
  46 #define Otos_l  O0
  47 #define Otos_l1 O0
  48 #define Otos_l2 O1
  49 #define Ftos_f  F0
  50 #define Ftos_d  F0
  51 #define Ftos_d1 F0
  52 #define Ftos_d2 F1
  53 #endif // DONT_USE_REGISTER_DEFINES
  54 
  55 class InterpreterMacroAssembler: public MacroAssembler {
  56  protected:
  57 #ifndef CC_INTERP
  58   // Interpreter specific version of call_VM_base
  59     virtual void call_VM_leaf_base(
  60     Register java_thread,
  61     address  entry_point,
  62     int      number_of_arguments
  63   );
  64 
  65   virtual void call_VM_base(
  66     Register        oop_result,
  67     Register        java_thread,
  68     Register        last_java_sp,
  69     address         entry_point,
  70     int             number_of_arguments,
  71     bool            check_exception=true
  72   );
  73 
  74   virtual void check_and_handle_popframe(Register java_thread);
  75   virtual void check_and_handle_earlyret(Register java_thread);
  76 
  77   // base routine for all dispatches
  78   void dispatch_base(TosState state, address* table);
  79 #endif /* CC_INTERP */
  80 
  81  public:
  82   InterpreterMacroAssembler(CodeBuffer* c)
  83     : MacroAssembler(c) {}
  84 
  85   void jump_to_entry(address entry);
  86 
  87 #ifndef CC_INTERP
  88   virtual void load_earlyret_value(TosState state);
  89 
  90   static const Address l_tmp ;
  91   static const Address d_tmp ;
  92 #endif /* CC_INTERP */
  93 
  94   // helper routine for frame allocation/deallocation
  95   // compute the delta by which the caller's SP has to
  96   // be adjusted to accomodate for the non-argument
  97   // locals
  98   void compute_extra_locals_size_in_bytes(Register args_size, Register locals_size, Register delta);
  99 
 100 #ifndef CC_INTERP
 101 
 102   // dispatch routines
 103   void dispatch_prolog(TosState state, int step = 0);
 104   void dispatch_epilog(TosState state, int step = 0);
 105   void dispatch_only(TosState state);
 106   void dispatch_normal(TosState state);
 107   void dispatch_next(TosState state, int step = 0);
 108   void dispatch_next_noverify_oop(TosState state, int step = 0);
 109   void dispatch_via (TosState state, address* table);
 110 
 111 
 112   // Removes the current activation (incl. unlocking of monitors).
 113   // Additionally this code is used for earlyReturn in which case we
 114   // want to skip throwing an exception and installing an exception.
 115   void remove_activation(TosState state,
 116                          bool throw_monitor_exception = true,
 117                          bool install_monitor_exception = true);
 118 
 119  protected:
 120   void dispatch_Lbyte_code(TosState state, address* table, int bcp_incr = 0, bool verify = true);
 121 #endif /* CC_INTERP */
 122 
 123  public:
 124   // Super call_VM calls - correspond to MacroAssembler::call_VM(_leaf) calls
 125   void super_call_VM(Register thread_cache,
 126                      Register oop_result,
 127                      Register last_java_sp,
 128                      address entry_point,
 129                      Register arg_1,
 130                      Register arg_2,
 131                      bool check_exception = true);
 132 
 133 #ifndef CC_INTERP
 134   void super_call_VM_leaf(Register thread_cache, address entry_point, Register arg_1, Register arg_2);
 135 
 136   // Generate a subtype check: branch to ok_is_subtype if sub_klass is
 137   // a subtype of super_klass.  Blows registers tmp1, tmp2 and tmp3.
 138   void gen_subtype_check( Register sub_klass, Register super_klass, Register tmp1, Register tmp2, Register tmp3, Label &ok_is_subtype );
 139 
 140   // helpers for tossing exceptions
 141   void throw_if_not_1_icc( Condition ok_condition, Label& ok );
 142   void throw_if_not_1_xcc( Condition ok_condition, Label& ok );
 143   void throw_if_not_1_x  ( Condition ok_condition, Label& ok ); // chooses icc or xcc based on _LP64
 144 
 145   void throw_if_not_2( address throw_entry_point, Register Rscratch, Label& ok);
 146 
 147   void throw_if_not_icc( Condition ok_condition, address throw_entry_point, Register Rscratch );
 148   void throw_if_not_xcc( Condition ok_condition, address throw_entry_point, Register Rscratch );
 149   void throw_if_not_x  ( Condition ok_condition, address throw_entry_point, Register Rscratch );
 150 
 151   // helpers for expression stack
 152 
 153   void pop_i(     Register r = Otos_i);


 248   void check_for_regarea_stomp( Register Rindex, int offset, Register Rlimit, Register Rscratch, Register Rscratch1);
 249 #endif // ASSERT
 250   void store_local_int( Register index, Register src );
 251   void store_local_ptr( Register index, Register src );
 252   void store_local_ptr( int n, Register src );
 253   void store_local_long( Register index, Register src );
 254   void store_local_float( Register index, FloatRegister src );
 255   void store_local_double( Register index, FloatRegister src );
 256 
 257   // Helpers for swap and dup
 258   void load_ptr(int n, Register val);
 259   void store_ptr(int n, Register val);
 260 
 261   // Helper for getting receiver in register.
 262   void load_receiver(Register param_count, Register recv);
 263 
 264   static int top_most_monitor_byte_offset(); // offset in bytes to top of monitor block
 265   Address top_most_monitor();
 266   void compute_stack_base( Register Rdest );
 267 
 268 #endif /* CC_INTERP */
 269   void get_method_counters(Register method, Register Rcounters, Label& skip);
 270   void increment_invocation_counter( Register Rcounters, Register Rtmp, Register Rtmp2 );
 271   void increment_backedge_counter( Register Rcounters, Register Rtmp, Register Rtmp2 );
 272 #ifndef CC_INTERP
 273   void test_backedge_count_for_osr(Register backedge_count, Register method_counters, Register branch_bcp, Register Rtmp );
 274 
 275 #endif /* CC_INTERP */
 276   // Object locking
 277   void lock_object  (Register lock_reg, Register obj_reg);
 278   void unlock_object(Register lock_reg);
 279 
 280 #ifndef CC_INTERP
 281   // Interpreter profiling operations
 282   void set_method_data_pointer();
 283   void set_method_data_pointer_for_bcp();
 284   void test_method_data_pointer(Label& zero_continue);
 285   void verify_method_data_pointer();
 286   void test_invocation_counter_for_mdp(Register invocation_count, Register method_counters, Register Rtmp, Label &profile_continue);
 287 
 288   void set_mdp_data_at(int constant, Register value);
 289   void increment_mdp_data_at(Address counter, Register bumped_count,
 290                              bool decrement = false);
 291   void increment_mdp_data_at(int constant, Register bumped_count,
 292                              bool decrement = false);
 293   void increment_mdp_data_at(Register reg, int constant,
 294                              Register bumped_count, Register scratch2,
 295                              bool decrement = false);
 296   void increment_mask_and_jump(Address counter_addr,
 297                                int increment, Address mask_addr,
 298                                Register scratch1, Register scratch2,
 299                                Condition cond, Label *where);
 300   void set_mdp_flag_at(int flag_constant, Register scratch);


 324   void profile_ret(TosState state, Register return_bci, Register scratch);
 325   void profile_null_seen(Register scratch);
 326   void profile_typecheck(Register klass, Register scratch);
 327   void profile_typecheck_failed(Register scratch);
 328   void profile_switch_default(Register scratch);
 329   void profile_switch_case(Register index,
 330                            Register scratch1,
 331                            Register scratch2,
 332                            Register scratch3);
 333 
 334   void profile_obj_type(Register obj, const Address& mdo_addr, Register tmp);
 335   void profile_arguments_type(Register callee, Register tmp1, Register tmp2, bool is_virtual);
 336   void profile_return_type(Register ret, Register tmp1, Register tmp2);
 337   void profile_parameters_type(Register tmp1, Register tmp2, Register tmp3, Register tmp4);
 338 
 339   // Debugging
 340   void interp_verify_oop(Register reg, TosState state, const char * file, int line);    // only if +VerifyOops && state == atos
 341   void verify_oop_or_return_address(Register reg, Register rtmp); // for astore
 342   void verify_FPU(int stack_depth, TosState state = ftos); // only if +VerifyFPU  && (state == ftos || state == dtos)
 343 
 344 #endif /* CC_INTERP */
 345   // support for JVMTI/Dtrace
 346   typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode;
 347   void notify_method_entry();
 348   void notify_method_exit(
 349     bool save_result, TosState state, NotifyMethodExitMode mode);
 350 
 351   void save_return_value(TosState state, bool is_native_call);
 352   void restore_return_value(TosState state, bool is_native_call);
 353 
 354 };
 355 
 356 #endif // CPU_SPARC_VM_INTERP_MASM_SPARC_HPP


  37 REGISTER_DECLARATION(     Register, Otos_l1, O0); // for 1st part of longs
  38 REGISTER_DECLARATION(     Register, Otos_l2, O1); // for 2nd part of longs
  39 REGISTER_DECLARATION(FloatRegister, Ftos_f , F0); // for floats
  40 REGISTER_DECLARATION(FloatRegister, Ftos_d , F0); // for doubles
  41 REGISTER_DECLARATION(FloatRegister, Ftos_d1, F0); // for 1st part of double
  42 REGISTER_DECLARATION(FloatRegister, Ftos_d2, F1); // for 2nd part of double
  43 
  44 #ifndef DONT_USE_REGISTER_DEFINES
  45 #define Otos_i  O0
  46 #define Otos_l  O0
  47 #define Otos_l1 O0
  48 #define Otos_l2 O1
  49 #define Ftos_f  F0
  50 #define Ftos_d  F0
  51 #define Ftos_d1 F0
  52 #define Ftos_d2 F1
  53 #endif // DONT_USE_REGISTER_DEFINES
  54 
  55 class InterpreterMacroAssembler: public MacroAssembler {
  56  protected:

  57   // Interpreter specific version of call_VM_base
  58     virtual void call_VM_leaf_base(
  59     Register java_thread,
  60     address  entry_point,
  61     int      number_of_arguments
  62   );
  63 
  64   virtual void call_VM_base(
  65     Register        oop_result,
  66     Register        java_thread,
  67     Register        last_java_sp,
  68     address         entry_point,
  69     int             number_of_arguments,
  70     bool            check_exception=true
  71   );
  72 
  73   virtual void check_and_handle_popframe(Register java_thread);
  74   virtual void check_and_handle_earlyret(Register java_thread);
  75 
  76   // base routine for all dispatches
  77   void dispatch_base(TosState state, address* table);

  78 
  79  public:
  80   InterpreterMacroAssembler(CodeBuffer* c)
  81     : MacroAssembler(c) {}
  82 
  83   void jump_to_entry(address entry);
  84 

  85   virtual void load_earlyret_value(TosState state);
  86 
  87   static const Address l_tmp ;
  88   static const Address d_tmp ;

  89 
  90   // helper routine for frame allocation/deallocation
  91   // compute the delta by which the caller's SP has to
  92   // be adjusted to accomodate for the non-argument
  93   // locals
  94   void compute_extra_locals_size_in_bytes(Register args_size, Register locals_size, Register delta);
  95 


  96   // dispatch routines
  97   void dispatch_prolog(TosState state, int step = 0);
  98   void dispatch_epilog(TosState state, int step = 0);
  99   void dispatch_only(TosState state);
 100   void dispatch_normal(TosState state);
 101   void dispatch_next(TosState state, int step = 0);
 102   void dispatch_next_noverify_oop(TosState state, int step = 0);
 103   void dispatch_via (TosState state, address* table);
 104 
 105 
 106   // Removes the current activation (incl. unlocking of monitors).
 107   // Additionally this code is used for earlyReturn in which case we
 108   // want to skip throwing an exception and installing an exception.
 109   void remove_activation(TosState state,
 110                          bool throw_monitor_exception = true,
 111                          bool install_monitor_exception = true);
 112 
 113  protected:
 114   void dispatch_Lbyte_code(TosState state, address* table, int bcp_incr = 0, bool verify = true);

 115 
 116  public:
 117   // Super call_VM calls - correspond to MacroAssembler::call_VM(_leaf) calls
 118   void super_call_VM(Register thread_cache,
 119                      Register oop_result,
 120                      Register last_java_sp,
 121                      address entry_point,
 122                      Register arg_1,
 123                      Register arg_2,
 124                      bool check_exception = true);
 125 

 126   void super_call_VM_leaf(Register thread_cache, address entry_point, Register arg_1, Register arg_2);
 127 
 128   // Generate a subtype check: branch to ok_is_subtype if sub_klass is
 129   // a subtype of super_klass.  Blows registers tmp1, tmp2 and tmp3.
 130   void gen_subtype_check( Register sub_klass, Register super_klass, Register tmp1, Register tmp2, Register tmp3, Label &ok_is_subtype );
 131 
 132   // helpers for tossing exceptions
 133   void throw_if_not_1_icc( Condition ok_condition, Label& ok );
 134   void throw_if_not_1_xcc( Condition ok_condition, Label& ok );
 135   void throw_if_not_1_x  ( Condition ok_condition, Label& ok ); // chooses icc or xcc based on _LP64
 136 
 137   void throw_if_not_2( address throw_entry_point, Register Rscratch, Label& ok);
 138 
 139   void throw_if_not_icc( Condition ok_condition, address throw_entry_point, Register Rscratch );
 140   void throw_if_not_xcc( Condition ok_condition, address throw_entry_point, Register Rscratch );
 141   void throw_if_not_x  ( Condition ok_condition, address throw_entry_point, Register Rscratch );
 142 
 143   // helpers for expression stack
 144 
 145   void pop_i(     Register r = Otos_i);


 240   void check_for_regarea_stomp( Register Rindex, int offset, Register Rlimit, Register Rscratch, Register Rscratch1);
 241 #endif // ASSERT
 242   void store_local_int( Register index, Register src );
 243   void store_local_ptr( Register index, Register src );
 244   void store_local_ptr( int n, Register src );
 245   void store_local_long( Register index, Register src );
 246   void store_local_float( Register index, FloatRegister src );
 247   void store_local_double( Register index, FloatRegister src );
 248 
 249   // Helpers for swap and dup
 250   void load_ptr(int n, Register val);
 251   void store_ptr(int n, Register val);
 252 
 253   // Helper for getting receiver in register.
 254   void load_receiver(Register param_count, Register recv);
 255 
 256   static int top_most_monitor_byte_offset(); // offset in bytes to top of monitor block
 257   Address top_most_monitor();
 258   void compute_stack_base( Register Rdest );
 259 

 260   void get_method_counters(Register method, Register Rcounters, Label& skip);
 261   void increment_invocation_counter( Register Rcounters, Register Rtmp, Register Rtmp2 );
 262   void increment_backedge_counter( Register Rcounters, Register Rtmp, Register Rtmp2 );

 263   void test_backedge_count_for_osr(Register backedge_count, Register method_counters, Register branch_bcp, Register Rtmp );
 264 

 265   // Object locking
 266   void lock_object  (Register lock_reg, Register obj_reg);
 267   void unlock_object(Register lock_reg);
 268 

 269   // Interpreter profiling operations
 270   void set_method_data_pointer();
 271   void set_method_data_pointer_for_bcp();
 272   void test_method_data_pointer(Label& zero_continue);
 273   void verify_method_data_pointer();
 274   void test_invocation_counter_for_mdp(Register invocation_count, Register method_counters, Register Rtmp, Label &profile_continue);
 275 
 276   void set_mdp_data_at(int constant, Register value);
 277   void increment_mdp_data_at(Address counter, Register bumped_count,
 278                              bool decrement = false);
 279   void increment_mdp_data_at(int constant, Register bumped_count,
 280                              bool decrement = false);
 281   void increment_mdp_data_at(Register reg, int constant,
 282                              Register bumped_count, Register scratch2,
 283                              bool decrement = false);
 284   void increment_mask_and_jump(Address counter_addr,
 285                                int increment, Address mask_addr,
 286                                Register scratch1, Register scratch2,
 287                                Condition cond, Label *where);
 288   void set_mdp_flag_at(int flag_constant, Register scratch);


 312   void profile_ret(TosState state, Register return_bci, Register scratch);
 313   void profile_null_seen(Register scratch);
 314   void profile_typecheck(Register klass, Register scratch);
 315   void profile_typecheck_failed(Register scratch);
 316   void profile_switch_default(Register scratch);
 317   void profile_switch_case(Register index,
 318                            Register scratch1,
 319                            Register scratch2,
 320                            Register scratch3);
 321 
 322   void profile_obj_type(Register obj, const Address& mdo_addr, Register tmp);
 323   void profile_arguments_type(Register callee, Register tmp1, Register tmp2, bool is_virtual);
 324   void profile_return_type(Register ret, Register tmp1, Register tmp2);
 325   void profile_parameters_type(Register tmp1, Register tmp2, Register tmp3, Register tmp4);
 326 
 327   // Debugging
 328   void interp_verify_oop(Register reg, TosState state, const char * file, int line);    // only if +VerifyOops && state == atos
 329   void verify_oop_or_return_address(Register reg, Register rtmp); // for astore
 330   void verify_FPU(int stack_depth, TosState state = ftos); // only if +VerifyFPU  && (state == ftos || state == dtos)
 331 

 332   // support for JVMTI/Dtrace
 333   typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode;
 334   void notify_method_entry();
 335   void notify_method_exit(
 336     bool save_result, TosState state, NotifyMethodExitMode mode);
 337 
 338   void save_return_value(TosState state, bool is_native_call);
 339   void restore_return_value(TosState state, bool is_native_call);
 340 
 341 };
 342 
 343 #endif // CPU_SPARC_VM_INTERP_MASM_SPARC_HPP
src/cpu/sparc/vm/interp_masm_sparc.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File