Mercurial > hg > truffle
comparison src/share/vm/code/vmreg.hpp @ 18041:52b4284cb496
Merge with jdk8u20-b26
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 15 Oct 2014 16:02:50 +0200 |
parents | 4ca6dc0799b6 |
children |
comparison
equal
deleted
inserted
replaced
17606:45d7b2c7029d | 18041:52b4284cb496 |
---|---|
45 # include "adfiles/adGlobals_zero.hpp" | 45 # include "adfiles/adGlobals_zero.hpp" |
46 #endif | 46 #endif |
47 #ifdef TARGET_ARCH_MODEL_arm | 47 #ifdef TARGET_ARCH_MODEL_arm |
48 # include "adfiles/adGlobals_arm.hpp" | 48 # include "adfiles/adGlobals_arm.hpp" |
49 #endif | 49 #endif |
50 #ifdef TARGET_ARCH_MODEL_ppc | 50 #ifdef TARGET_ARCH_MODEL_ppc_32 |
51 # include "adfiles/adGlobals_ppc.hpp" | 51 # include "adfiles/adGlobals_ppc_32.hpp" |
52 #endif | |
53 #ifdef TARGET_ARCH_MODEL_ppc_64 | |
54 # include "adfiles/adGlobals_ppc_64.hpp" | |
52 #endif | 55 #endif |
53 #endif | 56 #endif |
54 | 57 |
55 //------------------------------VMReg------------------------------------------ | 58 //------------------------------VMReg------------------------------------------ |
56 // The VM uses 'unwarped' stack slots; the compiler uses 'warped' stack slots. | 59 // The VM uses 'unwarped' stack slots; the compiler uses 'warped' stack slots. |
68 friend class VMStructs; | 71 friend class VMStructs; |
69 friend class OptoReg; | 72 friend class OptoReg; |
70 // friend class Location; | 73 // friend class Location; |
71 private: | 74 private: |
72 enum { | 75 enum { |
73 BAD = -1 | 76 BAD_REG = -1 |
74 }; | 77 }; |
75 | 78 |
76 | 79 |
77 | 80 |
78 static VMReg stack0; | 81 static VMReg stack0; |
81 static const int register_count; | 84 static const int register_count; |
82 | 85 |
83 | 86 |
84 public: | 87 public: |
85 | 88 |
86 static VMReg as_VMReg(int val, bool bad_ok = false) { assert(val > BAD || bad_ok, "invalid"); return (VMReg) (intptr_t) val; } | 89 static VMReg as_VMReg(int val, bool bad_ok = false) { assert(val > BAD_REG || bad_ok, "invalid"); return (VMReg) (intptr_t) val; } |
87 | 90 |
88 const char* name() { | 91 const char* name() { |
89 if (is_reg()) { | 92 if (is_reg()) { |
90 return regName[value()]; | 93 return regName[value()]; |
91 } else if (!is_valid()) { | 94 } else if (!is_valid()) { |
93 } else { | 96 } else { |
94 // shouldn't really be called with stack | 97 // shouldn't really be called with stack |
95 return "STACKED REG"; | 98 return "STACKED REG"; |
96 } | 99 } |
97 } | 100 } |
98 static VMReg Bad() { return (VMReg) (intptr_t) BAD; } | 101 static VMReg Bad() { return (VMReg) (intptr_t) BAD_REG; } |
99 bool is_valid() const { return ((intptr_t) this) != BAD; } | 102 bool is_valid() const { return ((intptr_t) this) != BAD_REG; } |
100 bool is_stack() const { return (intptr_t) this >= (intptr_t) stack0; } | 103 bool is_stack() const { return (intptr_t) this >= (intptr_t) stack0; } |
101 bool is_reg() const { return is_valid() && !is_stack(); } | 104 bool is_reg() const { return is_valid() && !is_stack(); } |
102 | 105 |
103 // A concrete register is a value that returns true for is_reg() and is | 106 // A concrete register is a value that returns true for is_reg() and is |
104 // also a register you could use in the assembler. On machines with | 107 // also a register you could use in the assembler. On machines with |