< prev index next >

src/share/vm/asm/assembler.hpp

Print this page




  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_ASM_ASSEMBLER_HPP
  26 #define SHARE_VM_ASM_ASSEMBLER_HPP
  27 
  28 #include "asm/codeBuffer.hpp"
  29 #include "code/oopRecorder.hpp"
  30 #include "code/relocInfo.hpp"
  31 #include "memory/allocation.hpp"
  32 #include "utilities/debug.hpp"
  33 #include "utilities/growableArray.hpp"
  34 #include "utilities/top.hpp"
  35 
  36 #ifdef TARGET_ARCH_x86
  37 # include "register_x86.hpp"
  38 # include "vm_version_x86.hpp"
  39 #endif
  40 #ifdef TARGET_ARCH_sparc
  41 # include "register_sparc.hpp"
  42 # include "vm_version_sparc.hpp"
  43 #endif
  44 #ifdef TARGET_ARCH_zero
  45 # include "register_zero.hpp"
  46 # include "vm_version_zero.hpp"
  47 #endif
  48 #ifdef TARGET_ARCH_arm
  49 # include "register_arm.hpp"
  50 # include "vm_version_arm.hpp"
  51 #endif
  52 #ifdef TARGET_ARCH_ppc
  53 # include "register_ppc.hpp"
  54 # include "vm_version_ppc.hpp"
  55 #endif




  56 
  57 // This file contains platform-independent assembler declarations.
  58 
  59 class MacroAssembler;
  60 class AbstractAssembler;
  61 class Label;
  62 
  63 /**
  64  * Labels represent destinations for control transfer instructions.  Such
  65  * instructions can accept a Label as their target argument.  A Label is
  66  * bound to the current location in the code stream by calling the
  67  * MacroAssembler's 'bind' method, which in turn calls the Label's 'bind'
  68  * method.  A Label may be referenced by an instruction before it's bound
  69  * (i.e., 'forward referenced').  'bind' stores the current code offset
  70  * in the Label object.
  71  *
  72  * If an instruction references a bound Label, the offset field(s) within
  73  * the instruction are immediately filled in based on the Label's code
  74  * offset.  If an instruction references an unbound label, that
  75  * instruction is put on a list of instructions that must be patched


 430 
 431   // Bang stack to trigger StackOverflowError at a safe location
 432   // implementation delegates to machine-specific bang_stack_with_offset
 433   void generate_stack_overflow_check( int frame_size_in_bytes );
 434   virtual void bang_stack_with_offset(int offset) = 0;
 435 
 436 
 437   /**
 438    * A platform-dependent method to patch a jump instruction that refers
 439    * to this label.
 440    *
 441    * @param branch the location of the instruction to patch
 442    * @param masm the assembler which generated the branch
 443    */
 444   void pd_patch_instruction(address branch, address target);
 445 
 446 };
 447 
 448 #ifdef TARGET_ARCH_x86
 449 # include "assembler_x86.hpp"



 450 #endif
 451 #ifdef TARGET_ARCH_sparc
 452 # include "assembler_sparc.hpp"
 453 #endif
 454 #ifdef TARGET_ARCH_zero
 455 # include "assembler_zero.hpp"
 456 #endif
 457 #ifdef TARGET_ARCH_arm
 458 # include "assembler_arm.hpp"
 459 #endif
 460 #ifdef TARGET_ARCH_ppc
 461 # include "assembler_ppc.hpp"
 462 #endif
 463 
 464 
 465 #endif // SHARE_VM_ASM_ASSEMBLER_HPP


  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_ASM_ASSEMBLER_HPP
  26 #define SHARE_VM_ASM_ASSEMBLER_HPP
  27 
  28 #include "asm/codeBuffer.hpp"
  29 #include "code/oopRecorder.hpp"
  30 #include "code/relocInfo.hpp"
  31 #include "memory/allocation.hpp"
  32 #include "utilities/debug.hpp"
  33 #include "utilities/growableArray.hpp"
  34 #include "utilities/top.hpp"

  35 #ifdef TARGET_ARCH_x86
  36 # include "register_x86.hpp"
  37 # include "vm_version_x86.hpp"
  38 #endif
  39 #ifdef TARGET_ARCH_sparc
  40 # include "register_sparc.hpp"
  41 # include "vm_version_sparc.hpp"
  42 #endif
  43 #ifdef TARGET_ARCH_zero
  44 # include "register_zero.hpp"
  45 # include "vm_version_zero.hpp"
  46 #endif
  47 #ifdef TARGET_ARCH_arm
  48 # include "register_arm.hpp"
  49 # include "vm_version_arm.hpp"
  50 #endif
  51 #ifdef TARGET_ARCH_ppc
  52 # include "register_ppc.hpp"
  53 # include "vm_version_ppc.hpp"
  54 #endif
  55 #ifdef TARGET_ARCH_aarch64
  56 # include "register_aarch64.hpp"
  57 # include "vm_version_aarch64.hpp"
  58 #endif
  59 
  60 // This file contains platform-independent assembler declarations.
  61 
  62 class MacroAssembler;
  63 class AbstractAssembler;
  64 class Label;
  65 
  66 /**
  67  * Labels represent destinations for control transfer instructions.  Such
  68  * instructions can accept a Label as their target argument.  A Label is
  69  * bound to the current location in the code stream by calling the
  70  * MacroAssembler's 'bind' method, which in turn calls the Label's 'bind'
  71  * method.  A Label may be referenced by an instruction before it's bound
  72  * (i.e., 'forward referenced').  'bind' stores the current code offset
  73  * in the Label object.
  74  *
  75  * If an instruction references a bound Label, the offset field(s) within
  76  * the instruction are immediately filled in based on the Label's code
  77  * offset.  If an instruction references an unbound label, that
  78  * instruction is put on a list of instructions that must be patched


 433 
 434   // Bang stack to trigger StackOverflowError at a safe location
 435   // implementation delegates to machine-specific bang_stack_with_offset
 436   void generate_stack_overflow_check( int frame_size_in_bytes );
 437   virtual void bang_stack_with_offset(int offset) = 0;
 438 
 439 
 440   /**
 441    * A platform-dependent method to patch a jump instruction that refers
 442    * to this label.
 443    *
 444    * @param branch the location of the instruction to patch
 445    * @param masm the assembler which generated the branch
 446    */
 447   void pd_patch_instruction(address branch, address target);
 448 
 449 };
 450 
 451 #ifdef TARGET_ARCH_x86
 452 # include "assembler_x86.hpp"
 453 #endif
 454 #ifdef TARGET_ARCH_aarch64
 455 # include "assembler_aarch64.hpp"
 456 #endif
 457 #ifdef TARGET_ARCH_sparc
 458 # include "assembler_sparc.hpp"
 459 #endif
 460 #ifdef TARGET_ARCH_zero
 461 # include "assembler_zero.hpp"
 462 #endif
 463 #ifdef TARGET_ARCH_arm
 464 # include "assembler_arm.hpp"
 465 #endif
 466 #ifdef TARGET_ARCH_ppc
 467 # include "assembler_ppc.hpp"
 468 #endif
 469 
 470 
 471 #endif // SHARE_VM_ASM_ASSEMBLER_HPP
< prev index next >