hotspot/src/cpu/x86/vm/register_x86.hpp
changeset 25715 d5a8dbdc5150
parent 13104 657b387034fb
child 30624 2e1803c8a26d
equal deleted inserted replaced
25469:3bcfa1db9717 25715:d5a8dbdc5150
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    24 
    24 
    25 #ifndef CPU_X86_VM_REGISTER_X86_HPP
    25 #ifndef CPU_X86_VM_REGISTER_X86_HPP
    26 #define CPU_X86_VM_REGISTER_X86_HPP
    26 #define CPU_X86_VM_REGISTER_X86_HPP
    27 
    27 
    28 #include "asm/register.hpp"
    28 #include "asm/register.hpp"
    29 #include "vm_version_x86.hpp"
       
    30 
    29 
    31 class VMRegImpl;
    30 class VMRegImpl;
    32 typedef VMRegImpl* VMReg;
    31 typedef VMRegImpl* VMReg;
    33 
    32 
    34 // Use Register as shortcut
    33 // Use Register as shortcut
    57   Register successor() const                          { return as_Register(encoding() + 1); }
    56   Register successor() const                          { return as_Register(encoding() + 1); }
    58 
    57 
    59   // construction
    58   // construction
    60   inline friend Register as_Register(int encoding);
    59   inline friend Register as_Register(int encoding);
    61 
    60 
    62   VMReg as_VMReg();
    61   inline VMReg as_VMReg();
    63 
    62 
    64   // accessors
    63   // accessors
    65   int   encoding() const                         { assert(is_valid(), "invalid register"); return (intptr_t)this; }
    64   int   encoding() const                         { assert(is_valid(), "invalid register"); return (intptr_t)this; }
    66   bool  is_valid() const                         { return 0 <= (intptr_t)this && (intptr_t)this < number_of_registers; }
    65   bool  is_valid() const                         { return 0 <= (intptr_t)this && (intptr_t)this < number_of_registers; }
    67   bool  has_byte_register() const                { return 0 <= (intptr_t)this && (intptr_t)this < number_of_byte_registers; }
    66   bool  has_byte_register() const                { return 0 <= (intptr_t)this && (intptr_t)this < number_of_byte_registers; }
   108   };
   107   };
   109 
   108 
   110   // construction
   109   // construction
   111   inline friend FloatRegister as_FloatRegister(int encoding);
   110   inline friend FloatRegister as_FloatRegister(int encoding);
   112 
   111 
   113   VMReg as_VMReg();
   112   inline VMReg as_VMReg();
   114 
   113 
   115   // derived registers, offsets, and addresses
   114   // derived registers, offsets, and addresses
       
   115 
   116   FloatRegister successor() const                          { return as_FloatRegister(encoding() + 1); }
   116   FloatRegister successor() const                          { return as_FloatRegister(encoding() + 1); }
   117 
   117 
   118   // accessors
   118   // accessors
   119   int   encoding() const                          { assert(is_valid(), "invalid register"); return (intptr_t)this; }
   119   int   encoding() const                          { assert(is_valid(), "invalid register"); return (intptr_t)this; }
   120   bool  is_valid() const                          { return 0 <= (intptr_t)this && (intptr_t)this < number_of_registers; }
   120   bool  is_valid() const                          { return 0 <= (intptr_t)this && (intptr_t)this < number_of_registers; }
   150   };
   150   };
   151 
   151 
   152   // construction
   152   // construction
   153   friend XMMRegister as_XMMRegister(int encoding);
   153   friend XMMRegister as_XMMRegister(int encoding);
   154 
   154 
   155   VMReg as_VMReg();
   155   inline VMReg as_VMReg();
   156 
   156 
   157   // derived registers, offsets, and addresses
   157   // derived registers, offsets, and addresses
   158   XMMRegister successor() const                          { return as_XMMRegister(encoding() + 1); }
   158   XMMRegister successor() const                          { return as_XMMRegister(encoding() + 1); }
   159 
   159 
   160   // accessors
   160   // accessors