src/share/vm/interpreter/templateTable.hpp

Print this page




  65   Bytecodes::Code bytecode() const;
  66   bool      is_valid() const                     { return _gen != NULL; }
  67   bool      uses_bcp() const                     { return (_flags & (1 << uses_bcp_bit     )) != 0; }
  68   bool      does_dispatch() const                { return (_flags & (1 << does_dispatch_bit)) != 0; }
  69   bool      calls_vm() const                     { return (_flags & (1 << calls_vm_bit     )) != 0; }
  70   bool      is_wide() const                      { return (_flags & (1 << wide_bit         )) != 0; }
  71   TosState  tos_in() const                       { return _tos_in; }
  72   TosState  tos_out() const                      { return _tos_out; }
  73   void      generate(InterpreterMacroAssembler* masm);
  74 };
  75 
  76 
  77 // The TemplateTable defines all Templates and provides accessor functions
  78 // to get the template for a given bytecode.
  79 
  80 class TemplateTable: AllStatic {
  81  public:
  82   enum Operation { add, sub, mul, div, rem, _and, _or, _xor, shl, shr, ushr };
  83   enum Condition { equal, not_equal, less, less_equal, greater, greater_equal };
  84   enum CacheByte { f1_byte = 1, f2_byte = 2 };  // byte_no codes

  85 
  86  private:
  87   static bool            _is_initialized;        // true if TemplateTable has been initialized
  88   static Template        _template_table     [Bytecodes::number_of_codes];
  89   static Template        _template_table_wide[Bytecodes::number_of_codes];
  90 
  91   static Template*       _desc;                  // the current template to be generated
  92   static Bytecodes::Code bytecode()              { return _desc->bytecode(); }
  93 
  94   static BarrierSet*     _bs;                    // Cache the barrier set.
  95  public:
  96   //%note templates_1
  97   static InterpreterMacroAssembler* _masm;       // the assembler used when generating templates
  98 
  99  private:
 100 
 101   // special registers
 102   static inline Address at_bcp(int offset);
 103 
 104   // helpers


 148   static void wide_lload();
 149   static void wide_fload();
 150   static void wide_dload();
 151   static void wide_aload();
 152 
 153   static void iaload();
 154   static void laload();
 155   static void faload();
 156   static void daload();
 157   static void aaload();
 158   static void baload();
 159   static void caload();
 160   static void saload();
 161 
 162   static void iload(int n);
 163   static void lload(int n);
 164   static void fload(int n);
 165   static void dload(int n);
 166   static void aload(int n);
 167   static void aload_0();




 168 
 169   static void istore();
 170   static void lstore();
 171   static void fstore();
 172   static void dstore();
 173   static void astore();
 174 
 175   static void wide_istore();
 176   static void wide_lstore();
 177   static void wide_fstore();
 178   static void wide_dstore();
 179   static void wide_astore();
 180 
 181   static void iastore();
 182   static void lastore();
 183   static void fastore();
 184   static void dastore();
 185   static void aastore();
 186   static void bastore();
 187   static void castore();


 262                                          Register method,
 263                                          Register itable_index,
 264                                          Register flags,
 265                                          bool is_invokevirtual,
 266                                          bool is_virtual_final,
 267                                          bool is_invokedynamic);
 268   static void load_field_cp_cache_entry(Register obj,
 269                                         Register cache,
 270                                         Register index,
 271                                         Register offset,
 272                                         Register flags,
 273                                         bool is_static);
 274   static void invokevirtual(int byte_no);
 275   static void invokespecial(int byte_no);
 276   static void invokestatic(int byte_no);
 277   static void invokeinterface(int byte_no);
 278   static void invokedynamic(int byte_no);
 279   static void invokehandle(int byte_no);
 280   static void fast_invokevfinal(int byte_no);
 281 
 282   static void getfield_or_static(int byte_no, bool is_static);
 283   static void putfield_or_static(int byte_no, bool is_static);

 284   static void getfield(int byte_no);
 285   static void putfield(int byte_no);


 286   static void getstatic(int byte_no);
 287   static void putstatic(int byte_no);
 288   static void pop_and_check_object(Register obj);
 289 
 290   static void _new();
 291   static void newarray();
 292   static void anewarray();
 293   static void arraylength();
 294   static void checkcast();
 295   static void instanceof();
 296 
 297   static void athrow();
 298 
 299   static void monitorenter();
 300   static void monitorexit();
 301 
 302   static void wide();
 303   static void multianewarray();
 304 
 305   static void fast_xaccess(TosState state);




  65   Bytecodes::Code bytecode() const;
  66   bool      is_valid() const                     { return _gen != NULL; }
  67   bool      uses_bcp() const                     { return (_flags & (1 << uses_bcp_bit     )) != 0; }
  68   bool      does_dispatch() const                { return (_flags & (1 << does_dispatch_bit)) != 0; }
  69   bool      calls_vm() const                     { return (_flags & (1 << calls_vm_bit     )) != 0; }
  70   bool      is_wide() const                      { return (_flags & (1 << wide_bit         )) != 0; }
  71   TosState  tos_in() const                       { return _tos_in; }
  72   TosState  tos_out() const                      { return _tos_out; }
  73   void      generate(InterpreterMacroAssembler* masm);
  74 };
  75 
  76 
  77 // The TemplateTable defines all Templates and provides accessor functions
  78 // to get the template for a given bytecode.
  79 
  80 class TemplateTable: AllStatic {
  81  public:
  82   enum Operation { add, sub, mul, div, rem, _and, _or, _xor, shl, shr, ushr };
  83   enum Condition { equal, not_equal, less, less_equal, greater, greater_equal };
  84   enum CacheByte { f1_byte = 1, f2_byte = 2 };  // byte_no codes
  85   enum RewriteControl { may_rewrite, may_not_rewrite };  // control for fast code under CDS
  86 
  87  private:
  88   static bool            _is_initialized;        // true if TemplateTable has been initialized
  89   static Template        _template_table     [Bytecodes::number_of_codes];
  90   static Template        _template_table_wide[Bytecodes::number_of_codes];
  91 
  92   static Template*       _desc;                  // the current template to be generated
  93   static Bytecodes::Code bytecode()              { return _desc->bytecode(); }
  94 
  95   static BarrierSet*     _bs;                    // Cache the barrier set.
  96  public:
  97   //%note templates_1
  98   static InterpreterMacroAssembler* _masm;       // the assembler used when generating templates
  99 
 100  private:
 101 
 102   // special registers
 103   static inline Address at_bcp(int offset);
 104 
 105   // helpers


 149   static void wide_lload();
 150   static void wide_fload();
 151   static void wide_dload();
 152   static void wide_aload();
 153 
 154   static void iaload();
 155   static void laload();
 156   static void faload();
 157   static void daload();
 158   static void aaload();
 159   static void baload();
 160   static void caload();
 161   static void saload();
 162 
 163   static void iload(int n);
 164   static void lload(int n);
 165   static void fload(int n);
 166   static void dload(int n);
 167   static void aload(int n);
 168   static void aload_0();
 169   static void nofast_aload_0();
 170   static void nofast_iload();
 171   static void iload_internal(RewriteControl rc = may_rewrite);
 172   static void aload_0_internal(RewriteControl rc = may_rewrite);
 173   
 174   static void istore();
 175   static void lstore();
 176   static void fstore();
 177   static void dstore();
 178   static void astore();
 179 
 180   static void wide_istore();
 181   static void wide_lstore();
 182   static void wide_fstore();
 183   static void wide_dstore();
 184   static void wide_astore();
 185 
 186   static void iastore();
 187   static void lastore();
 188   static void fastore();
 189   static void dastore();
 190   static void aastore();
 191   static void bastore();
 192   static void castore();


 267                                          Register method,
 268                                          Register itable_index,
 269                                          Register flags,
 270                                          bool is_invokevirtual,
 271                                          bool is_virtual_final,
 272                                          bool is_invokedynamic);
 273   static void load_field_cp_cache_entry(Register obj,
 274                                         Register cache,
 275                                         Register index,
 276                                         Register offset,
 277                                         Register flags,
 278                                         bool is_static);
 279   static void invokevirtual(int byte_no);
 280   static void invokespecial(int byte_no);
 281   static void invokestatic(int byte_no);
 282   static void invokeinterface(int byte_no);
 283   static void invokedynamic(int byte_no);
 284   static void invokehandle(int byte_no);
 285   static void fast_invokevfinal(int byte_no);
 286 
 287   static void getfield_or_static(int byte_no, bool is_static, RewriteControl rc = may_rewrite);
 288   static void putfield_or_static(int byte_no, bool is_static, RewriteControl rc = may_rewrite);
 289 
 290   static void getfield(int byte_no);
 291   static void putfield(int byte_no);
 292   static void nofast_getfield(int byte_no);
 293   static void nofast_putfield(int byte_no);
 294   static void getstatic(int byte_no);
 295   static void putstatic(int byte_no);
 296   static void pop_and_check_object(Register obj);
 297 
 298   static void _new();
 299   static void newarray();
 300   static void anewarray();
 301   static void arraylength();
 302   static void checkcast();
 303   static void instanceof();
 304 
 305   static void athrow();
 306 
 307   static void monitorenter();
 308   static void monitorexit();
 309 
 310   static void wide();
 311   static void multianewarray();
 312 
 313   static void fast_xaccess(TosState state);