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 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 #ifdef TARGET_ARCH_x86 32 # include "interp_masm_x86.hpp" 33 #endif 34 #ifdef TARGET_ARCH_MODEL_sparc 35 # include "interp_masm_sparc.hpp" 36 #endif 37 #ifdef TARGET_ARCH_MODEL_zero 38 # include "interp_masm_zero.hpp" 39 #endif 40 #ifdef TARGET_ARCH_MODEL_arm 41 # include "interp_masm_arm.hpp" 42 #endif 43 #ifdef TARGET_ARCH_MODEL_ppc_32 44 # include "interp_masm_ppc_32.hpp" 45 #endif 46 #ifdef TARGET_ARCH_MODEL_ppc_64 47 # include "interp_masm_ppc_64.hpp" 48 #endif 49 50 #ifndef CC_INTERP 51 // All the necessary definitions used for (bytecode) template generation. Instead of 52 // spreading the implementation functionality for each bytecode in the interpreter 53 // and the snippet generator, a template is assigned to each bytecode which can be 54 // used to generate the bytecode's implementation if needed. 55 56 57 // A Template describes the properties of a code template for a given bytecode 58 // and provides a generator to generate the code template. 59 60 class Template VALUE_OBJ_CLASS_SPEC { 61 private: 62 enum Flags { 63 uses_bcp_bit, // set if template needs the bcp pointing to bytecode 64 does_dispatch_bit, // set if template dispatches on its own 65 calls_vm_bit, // set if template calls the vm 66 wide_bit // set if template belongs to a wide instruction 341 static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(bool arg ), bool arg ); 342 static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(TosState tos), TosState tos); 343 static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(Operation op), Operation op); 344 static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(Condition cc), Condition cc); 345 346 friend class Template; 347 348 // InterpreterMacroAssembler::is_a(), etc., need TemplateTable::call_VM(). 349 friend class InterpreterMacroAssembler; 350 351 public: 352 // Initialization 353 static void initialize(); 354 static void pd_initialize(); 355 356 // Templates 357 static Template* template_for (Bytecodes::Code code) { Bytecodes::check (code); return &_template_table [code]; } 358 static Template* template_for_wide(Bytecodes::Code code) { Bytecodes::wide_check(code); return &_template_table_wide[code]; } 359 360 // Platform specifics 361 #ifdef TARGET_ARCH_MODEL_x86_32 362 # include "templateTable_x86_32.hpp" 363 #endif 364 #ifdef TARGET_ARCH_MODEL_x86_64 365 # include "templateTable_x86_64.hpp" 366 #endif 367 #ifdef TARGET_ARCH_MODEL_sparc 368 # include "templateTable_sparc.hpp" 369 #endif 370 #ifdef TARGET_ARCH_MODEL_zero 371 # include "templateTable_zero.hpp" 372 #endif 373 #ifdef TARGET_ARCH_MODEL_arm 374 # include "templateTable_arm.hpp" 375 #endif 376 #ifdef TARGET_ARCH_MODEL_ppc_32 377 # include "templateTable_ppc_32.hpp" 378 #endif 379 #ifdef TARGET_ARCH_MODEL_ppc_64 380 # include "templateTable_ppc_64.hpp" 381 #endif 382 383 }; 384 #endif /* !CC_INTERP */ 385 386 #endif // SHARE_VM_INTERPRETER_TEMPLATETABLE_HPP | 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 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_32 40 # include "interp_masm_ppc_32.hpp" 41 #elif defined TARGET_ARCH_MODEL_ppc_64 42 # include "interp_masm_ppc_64.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 336 static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(bool arg ), bool arg ); 337 static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(TosState tos), TosState tos); 338 static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(Operation op), Operation op); 339 static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(Condition cc), Condition cc); 340 341 friend class Template; 342 343 // InterpreterMacroAssembler::is_a(), etc., need TemplateTable::call_VM(). 344 friend class InterpreterMacroAssembler; 345 346 public: 347 // Initialization 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 #endif 369 370 }; 371 #endif /* !CC_INTERP */ 372 373 #endif // SHARE_VM_INTERPRETER_TEMPLATETABLE_HPP |