< prev index next >

src/share/vm/interpreter/templateTable.hpp

Print this page
rev 11647 : 8161258: Simplify including platform files.
Summary: Include patform files with macros cpu_header() etc. Do various cleanups of macro usages. Remove _64/_32 from adlc generated files and platform .hpp files. Merge stubRoutines_x86*.hpp. Remove empty mutex_<os>* files.
Reviewed-by: dholmes, coleenp, kbarrett
   1 /*
   2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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 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 
  32 #ifndef CC_INTERP
  33 // All the necessary definitions used for (bytecode) template generation. Instead of
  34 // spreading the implementation functionality for each bytecode in the interpreter
  35 // and the snippet generator, a template is assigned to each bytecode which can be
  36 // used to generate the bytecode's implementation if needed.
  37 
  38 class InterpreterMacroAssembler;
  39 
  40 // A Template describes the properties of a code template for a given bytecode
  41 // and provides a generator to generate the code template.
  42 
  43 class Template VALUE_OBJ_CLASS_SPEC {
  44  private:
  45   enum Flags {
  46     uses_bcp_bit,                                // set if template needs the bcp pointing to bytecode
  47     does_dispatch_bit,                           // set if template dispatches on its own
  48     calls_vm_bit,                                // set if template calls the vm
  49     wide_bit                                     // set if template belongs to a wide instruction
  50   };


 332  static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(bool arg    ), bool arg    );
 333   static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(TosState tos), TosState tos);
 334   static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(Operation op), Operation op);
 335   static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(Condition cc), Condition cc);
 336 
 337   friend class Template;
 338 
 339   // InterpreterMacroAssembler::is_a(), etc., need TemplateTable::call_VM().
 340   friend class InterpreterMacroAssembler;
 341 
 342  public:
 343   // Initialization
 344   static void initialize();
 345   static void pd_initialize();
 346 
 347   // Templates
 348   static Template* template_for     (Bytecodes::Code code)  { Bytecodes::check     (code); return &_template_table     [code]; }
 349   static Template* template_for_wide(Bytecodes::Code code)  { Bytecodes::wide_check(code); return &_template_table_wide[code]; }
 350 
 351   // Platform specifics
 352 #if defined TEMPLATETABLE_MD_HPP
 353 # include TEMPLATETABLE_MD_HPP
 354 #elif defined (TARGET_ARCH_MODEL_x86_32) || defined (TARGET_ARCH_MODEL_x86_64)
 355 # include "templateTable_x86.hpp"
 356 #elif defined TARGET_ARCH_MODEL_sparc
 357 # include "templateTable_sparc.hpp"
 358 #elif defined TARGET_ARCH_MODEL_ppc_64
 359 # include "templateTable_ppc_64.hpp"
 360 #elif defined TARGET_ARCH_MODEL_aarch64
 361 # include "templateTable_aarch64.hpp"
 362 #endif
 363 
 364 };
 365 #endif /* !CC_INTERP */
 366 
 367 #endif // SHARE_VM_INTERPRETER_TEMPLATETABLE_HPP
   1 /*
   2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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 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 #include "utilities/macros.hpp"
  32 
  33 #ifndef CC_INTERP
  34 // All the necessary definitions used for (bytecode) template generation. Instead of
  35 // spreading the implementation functionality for each bytecode in the interpreter
  36 // and the snippet generator, a template is assigned to each bytecode which can be
  37 // used to generate the bytecode's implementation if needed.
  38 
  39 class InterpreterMacroAssembler;
  40 
  41 // A Template describes the properties of a code template for a given bytecode
  42 // and provides a generator to generate the code template.
  43 
  44 class Template VALUE_OBJ_CLASS_SPEC {
  45  private:
  46   enum Flags {
  47     uses_bcp_bit,                                // set if template needs the bcp pointing to bytecode
  48     does_dispatch_bit,                           // set if template dispatches on its own
  49     calls_vm_bit,                                // set if template calls the vm
  50     wide_bit                                     // set if template belongs to a wide instruction
  51   };


 333  static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(bool arg    ), bool arg    );
 334   static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(TosState tos), TosState tos);
 335   static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(Operation op), Operation op);
 336   static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(Condition cc), Condition cc);
 337 
 338   friend class Template;
 339 
 340   // InterpreterMacroAssembler::is_a(), etc., need TemplateTable::call_VM().
 341   friend class InterpreterMacroAssembler;
 342 
 343  public:
 344   // Initialization
 345   static void initialize();
 346   static void pd_initialize();
 347 
 348   // Templates
 349   static Template* template_for     (Bytecodes::Code code)  { Bytecodes::check     (code); return &_template_table     [code]; }
 350   static Template* template_for_wide(Bytecodes::Code code)  { Bytecodes::wide_check(code); return &_template_table_wide[code]; }
 351 
 352   // Platform specifics
 353 #include CPU_HEADER(templateTable)










 354 
 355 };
 356 #endif /* !CC_INTERP */
 357 
 358 #endif // SHARE_VM_INTERPRETER_TEMPLATETABLE_HPP
< prev index next >