comparison src/share/vm/code/vmreg.hpp @ 14465:28f281e8de1d

Merge
author kvn
date Thu, 20 Feb 2014 12:20:56 -0800
parents bdd155477289
children 4ca6dc0799b6
comparison
equal deleted inserted replaced
14382:805784307dca 14465:28f281e8de1d
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