OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // ----------------------------------------------------------------------------- | 116 // ----------------------------------------------------------------------------- |
117 // Common register code. | 117 // Common register code. |
118 | 118 |
119 const char* Register::ToString() { | 119 const char* Register::ToString() { |
120 // This is the mapping of allocation indices to registers. | 120 // This is the mapping of allocation indices to registers. |
121 DCHECK(reg_code >= 0 && reg_code < kNumRegisters); | 121 DCHECK(reg_code >= 0 && reg_code < kNumRegisters); |
122 return RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT) | 122 return RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT) |
123 ->GetGeneralRegisterName(reg_code); | 123 ->GetGeneralRegisterName(reg_code); |
124 } | 124 } |
125 | 125 |
126 | 126 bool Register::IsAllocatable( |
127 bool Register::IsAllocatable() const { | 127 RegisterConfiguration::CompilerSelector compiler) const { |
128 return ((1 << reg_code) & | 128 return ((1 << reg_code) & |
129 RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT) | 129 RegisterConfiguration::ArchDefault(compiler) |
130 ->allocatable_general_codes_mask()) != 0; | 130 ->allocatable_general_codes_mask()) != 0; |
131 } | 131 } |
132 | 132 |
133 const char* DoubleRegister::ToString() { | 133 const char* DoubleRegister::ToString() { |
134 // This is the mapping of allocation indices to registers. | 134 // This is the mapping of allocation indices to registers. |
135 DCHECK(reg_code >= 0 && reg_code < kMaxNumRegisters); | 135 DCHECK(reg_code >= 0 && reg_code < kMaxNumRegisters); |
136 return RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT) | 136 return RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT) |
137 ->GetDoubleRegisterName(reg_code); | 137 ->GetDoubleRegisterName(reg_code); |
138 } | 138 } |
139 | 139 |
140 | 140 bool DoubleRegister::IsAllocatable( |
141 bool DoubleRegister::IsAllocatable() const { | 141 RegisterConfiguration::CompilerSelector compiler) const { |
142 return ((1 << reg_code) & | 142 return ((1 << reg_code) & |
143 RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT) | 143 RegisterConfiguration::ArchDefault(compiler) |
144 ->allocatable_double_codes_mask()) != 0; | 144 ->allocatable_double_codes_mask()) != 0; |
145 } | 145 } |
146 | 146 |
147 // FloatRegister is only a distinct type on ARM. On all other platforms it's | 147 // FloatRegister is only a distinct type on ARM. On all other platforms it's |
148 // typedef'ed to DoubleRegister. | 148 // typedef'ed to DoubleRegister. |
149 #if V8_TARGET_ARCH_ARM | 149 #if V8_TARGET_ARCH_ARM |
150 const char* FloatRegister::ToString() { | 150 const char* FloatRegister::ToString() { |
151 // This is the mapping of allocation indices to registers. | 151 // This is the mapping of allocation indices to registers. |
152 DCHECK(reg_code >= 0 && reg_code < kMaxNumRegisters); | 152 DCHECK(reg_code >= 0 && reg_code < kMaxNumRegisters); |
153 return RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT) | 153 return RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT) |
154 ->GetFloatRegisterName(reg_code); | 154 ->GetFloatRegisterName(reg_code); |
155 } | 155 } |
156 | 156 |
157 bool FloatRegister::IsAllocatable() const { | 157 bool FloatRegister::IsAllocatable( |
| 158 RegisterConfiguration::CompilerSelector compiler) const { |
158 // TODO(bbudge) Update this once RegisterConfigutation handles aliasing. | 159 // TODO(bbudge) Update this once RegisterConfigutation handles aliasing. |
159 return ((1 << reg_code) & | 160 return ((1 << reg_code) & |
160 RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT) | 161 RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT) |
161 ->allocatable_double_codes_mask()) != 0; | 162 ->allocatable_double_codes_mask()) != 0; |
162 } | 163 } |
163 #endif // V8_TARGET_ARCH_ARM | 164 #endif // V8_TARGET_ARCH_ARM |
164 | 165 |
165 // ----------------------------------------------------------------------------- | 166 // ----------------------------------------------------------------------------- |
166 // Common double constants. | 167 // Common double constants. |
167 | 168 |
(...skipping 1902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2070 | 2071 |
2071 | 2072 |
2072 void Assembler::DataAlign(int m) { | 2073 void Assembler::DataAlign(int m) { |
2073 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); | 2074 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); |
2074 while ((pc_offset() & (m - 1)) != 0) { | 2075 while ((pc_offset() & (m - 1)) != 0) { |
2075 db(0); | 2076 db(0); |
2076 } | 2077 } |
2077 } | 2078 } |
2078 } // namespace internal | 2079 } // namespace internal |
2079 } // namespace v8 | 2080 } // namespace v8 |
OLD | NEW |