< prev index next >

src/share/vm/interpreter/templateTable.hpp

Print this page




  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_INTERPRETER_TEMPLATETABLE_HPP
  26 #define SHARE_VM_INTERPRETER_TEMPLATETABLE_HPP
  27 
  28 #include "interpreter/bytecodes.hpp"
  29 #include "memory/allocation.hpp"
  30 #include "runtime/frame.hpp"
  31 #if defined INTERP_MASM_MD_HPP
  32 # include INTERP_MASM_MD_HPP
  33 #elif defined TARGET_ARCH_x86
  34 # include "interp_masm_x86.hpp"
  35 #elif defined TARGET_ARCH_MODEL_sparc
  36 # include "interp_masm_sparc.hpp"
  37 #elif defined TARGET_ARCH_MODEL_zero
  38 # include "interp_masm_zero.hpp"
  39 #elif defined TARGET_ARCH_MODEL_ppc_64
  40 # include "interp_masm_ppc_64.hpp"


  41 #endif
  42 
  43 #ifndef CC_INTERP
  44 // All the necessary definitions used for (bytecode) template generation. Instead of
  45 // spreading the implementation functionality for each bytecode in the interpreter
  46 // and the snippet generator, a template is assigned to each bytecode which can be
  47 // used to generate the bytecode's implementation if needed.
  48 
  49 
  50 // A Template describes the properties of a code template for a given bytecode
  51 // and provides a generator to generate the code template.
  52 
  53 class Template VALUE_OBJ_CLASS_SPEC {
  54  private:
  55   enum Flags {
  56     uses_bcp_bit,                                // set if template needs the bcp pointing to bytecode
  57     does_dispatch_bit,                           // set if template dispatches on its own
  58     calls_vm_bit,                                // set if template calls the vm
  59     wide_bit                                     // set if template belongs to a wide instruction
  60   };


 346   static void initialize();
 347   static void pd_initialize();
 348 
 349   // Templates
 350   static Template* template_for     (Bytecodes::Code code)  { Bytecodes::check     (code); return &_template_table     [code]; }
 351   static Template* template_for_wide(Bytecodes::Code code)  { Bytecodes::wide_check(code); return &_template_table_wide[code]; }
 352 
 353   // Platform specifics
 354 #if defined TEMPLATETABLE_MD_HPP
 355 # include TEMPLATETABLE_MD_HPP
 356 #elif defined TARGET_ARCH_MODEL_x86_32
 357 # include "templateTable_x86_32.hpp"
 358 #elif defined TARGET_ARCH_MODEL_x86_64
 359 # include "templateTable_x86_64.hpp"
 360 #elif defined TARGET_ARCH_MODEL_sparc
 361 # include "templateTable_sparc.hpp"
 362 #elif defined TARGET_ARCH_MODEL_zero
 363 # include "templateTable_zero.hpp"
 364 #elif defined TARGET_ARCH_MODEL_ppc_64
 365 # include "templateTable_ppc_64.hpp"


 366 #endif
 367 
 368 };
 369 #endif /* !CC_INTERP */
 370 
 371 #endif // SHARE_VM_INTERPRETER_TEMPLATETABLE_HPP


  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_INTERPRETER_TEMPLATETABLE_HPP
  26 #define SHARE_VM_INTERPRETER_TEMPLATETABLE_HPP
  27 
  28 #include "interpreter/bytecodes.hpp"
  29 #include "memory/allocation.hpp"
  30 #include "runtime/frame.hpp"
  31 #if defined INTERP_MASM_MD_HPP
  32 # include INTERP_MASM_MD_HPP
  33 #elif defined TARGET_ARCH_x86
  34 # include "interp_masm_x86.hpp"
  35 #elif defined TARGET_ARCH_MODEL_sparc
  36 # include "interp_masm_sparc.hpp"
  37 #elif defined TARGET_ARCH_MODEL_zero
  38 # include "interp_masm_zero.hpp"
  39 #elif defined TARGET_ARCH_MODEL_ppc_64
  40 # include "interp_masm_ppc_64.hpp"
  41 #elif defined TARGET_ARCH_MODEL_aarch32
  42 # include "interp_masm_aarch32.hpp"
  43 #endif
  44 
  45 #ifndef CC_INTERP
  46 // All the necessary definitions used for (bytecode) template generation. Instead of
  47 // spreading the implementation functionality for each bytecode in the interpreter
  48 // and the snippet generator, a template is assigned to each bytecode which can be
  49 // used to generate the bytecode's implementation if needed.
  50 
  51 
  52 // A Template describes the properties of a code template for a given bytecode
  53 // and provides a generator to generate the code template.
  54 
  55 class Template VALUE_OBJ_CLASS_SPEC {
  56  private:
  57   enum Flags {
  58     uses_bcp_bit,                                // set if template needs the bcp pointing to bytecode
  59     does_dispatch_bit,                           // set if template dispatches on its own
  60     calls_vm_bit,                                // set if template calls the vm
  61     wide_bit                                     // set if template belongs to a wide instruction
  62   };


 348   static void initialize();
 349   static void pd_initialize();
 350 
 351   // Templates
 352   static Template* template_for     (Bytecodes::Code code)  { Bytecodes::check     (code); return &_template_table     [code]; }
 353   static Template* template_for_wide(Bytecodes::Code code)  { Bytecodes::wide_check(code); return &_template_table_wide[code]; }
 354 
 355   // Platform specifics
 356 #if defined TEMPLATETABLE_MD_HPP
 357 # include TEMPLATETABLE_MD_HPP
 358 #elif defined TARGET_ARCH_MODEL_x86_32
 359 # include "templateTable_x86_32.hpp"
 360 #elif defined TARGET_ARCH_MODEL_x86_64
 361 # include "templateTable_x86_64.hpp"
 362 #elif defined TARGET_ARCH_MODEL_sparc
 363 # include "templateTable_sparc.hpp"
 364 #elif defined TARGET_ARCH_MODEL_zero
 365 # include "templateTable_zero.hpp"
 366 #elif defined TARGET_ARCH_MODEL_ppc_64
 367 # include "templateTable_ppc_64.hpp"
 368 #elif defined TARGET_ARCH_MODEL_aarch32
 369 # include "templateTable_aarch32.hpp"
 370 #endif
 371 
 372 };
 373 #endif /* !CC_INTERP */
 374 
 375 #endif // SHARE_VM_INTERPRETER_TEMPLATETABLE_HPP
< prev index next >