src/cpu/sparc/vm/assembler_sparc.hpp

Print this page




   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 class BiasedLockingCounters;
  26 
  27 // <sys/trap.h> promises that the system will not use traps 16-31
  28 #define ST_RESERVED_FOR_USER_0 0x10
  29 
  30 /* Written: David Ungar 4/19/97 */
  31 
  32 // Contains all the definitions needed for sparc assembly code generation.
  33 
  34 // Register aliases for parts of the system:
  35 
  36 // 64 bit values can be kept in g1-g5, o1-o5 and o7 and all 64 bits are safe
  37 // across context switches in V8+ ABI.  Of course, there are no 64 bit regs
  38 // in V8 ABI. All 64 bits are preserved in V9 ABI for all registers.
  39 
  40 // g2-g4 are scratch registers called "application globals".  Their
  41 // meaning is reserved to the "compilation system"--which means us!
  42 // They are are not supposed to be touched by ordinary C code, although
  43 // highly-optimized C code might steal them for temps.  They are safe
  44 // across thread switches, and the ABI requires that they be safe


2483  * jump around any code emitted between the creation of the instance and it's
2484  * automatic destruction at the end of a scope block, depending on the value of
2485  * the flag passed to the constructor, which will be checked at run-time.
2486  */
2487 class SkipIfEqual : public StackObj {
2488  private:
2489   MacroAssembler* _masm;
2490   Label _label;
2491 
2492  public:
2493    // 'temp' is a temp register that this object can use (and trash)
2494    SkipIfEqual(MacroAssembler*, Register temp,
2495                const bool* flag_addr, Assembler::Condition condition);
2496    ~SkipIfEqual();
2497 };
2498 
2499 #ifdef ASSERT
2500 // On RISC, there's no benefit to verifying instruction boundaries.
2501 inline bool AbstractAssembler::pd_check_instruction_mark() { return false; }
2502 #endif




   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 CPU_SPARC_VM_ASSEMBLER_SPARC_HPP
  26 #define CPU_SPARC_VM_ASSEMBLER_SPARC_HPP
  27 
  28 class BiasedLockingCounters;
  29 
  30 // <sys/trap.h> promises that the system will not use traps 16-31
  31 #define ST_RESERVED_FOR_USER_0 0x10
  32 
  33 /* Written: David Ungar 4/19/97 */
  34 
  35 // Contains all the definitions needed for sparc assembly code generation.
  36 
  37 // Register aliases for parts of the system:
  38 
  39 // 64 bit values can be kept in g1-g5, o1-o5 and o7 and all 64 bits are safe
  40 // across context switches in V8+ ABI.  Of course, there are no 64 bit regs
  41 // in V8 ABI. All 64 bits are preserved in V9 ABI for all registers.
  42 
  43 // g2-g4 are scratch registers called "application globals".  Their
  44 // meaning is reserved to the "compilation system"--which means us!
  45 // They are are not supposed to be touched by ordinary C code, although
  46 // highly-optimized C code might steal them for temps.  They are safe
  47 // across thread switches, and the ABI requires that they be safe


2486  * jump around any code emitted between the creation of the instance and it's
2487  * automatic destruction at the end of a scope block, depending on the value of
2488  * the flag passed to the constructor, which will be checked at run-time.
2489  */
2490 class SkipIfEqual : public StackObj {
2491  private:
2492   MacroAssembler* _masm;
2493   Label _label;
2494 
2495  public:
2496    // 'temp' is a temp register that this object can use (and trash)
2497    SkipIfEqual(MacroAssembler*, Register temp,
2498                const bool* flag_addr, Assembler::Condition condition);
2499    ~SkipIfEqual();
2500 };
2501 
2502 #ifdef ASSERT
2503 // On RISC, there's no benefit to verifying instruction boundaries.
2504 inline bool AbstractAssembler::pd_check_instruction_mark() { return false; }
2505 #endif
2506 
2507 #endif // CPU_SPARC_VM_ASSEMBLER_SPARC_HPP