| 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 static const int kNumRegisters = Code::kAfterLast; | 117 static const int kNumRegisters = Code::kAfterLast; |
| 118 | 118 |
| 119 static Register from_code(int code) { | 119 static Register from_code(int code) { |
| 120 DCHECK(code >= 0); | 120 DCHECK(code >= 0); |
| 121 DCHECK(code < kNumRegisters); | 121 DCHECK(code < kNumRegisters); |
| 122 Register r = {code}; | 122 Register r = {code}; |
| 123 return r; | 123 return r; |
| 124 } | 124 } |
| 125 const char* ToString(); | 125 const char* ToString(); |
| 126 bool IsAllocatable() const; | 126 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = |
| 127 RegisterConfiguration::CRANKSHAFT) const; |
| 127 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } | 128 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } |
| 128 bool is(Register reg) const { return reg_code == reg.reg_code; } | 129 bool is(Register reg) const { return reg_code == reg.reg_code; } |
| 129 int code() const { | 130 int code() const { |
| 130 DCHECK(is_valid()); | 131 DCHECK(is_valid()); |
| 131 return reg_code; | 132 return reg_code; |
| 132 } | 133 } |
| 133 int bit() const { | 134 int bit() const { |
| 134 DCHECK(is_valid()); | 135 DCHECK(is_valid()); |
| 135 return 1 << reg_code; | 136 return 1 << reg_code; |
| 136 } | 137 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 157 }; | 158 }; |
| 158 | 159 |
| 159 static const int kMaxNumRegisters = Code::kAfterLast; | 160 static const int kMaxNumRegisters = Code::kAfterLast; |
| 160 static const int kMaxNumAllocatableRegisters = 6; | 161 static const int kMaxNumAllocatableRegisters = 6; |
| 161 | 162 |
| 162 static X87Register from_code(int code) { | 163 static X87Register from_code(int code) { |
| 163 X87Register result = {code}; | 164 X87Register result = {code}; |
| 164 return result; | 165 return result; |
| 165 } | 166 } |
| 166 | 167 |
| 167 bool IsAllocatable() const; | 168 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = |
| 169 RegisterConfiguration::CRANKSHAFT) const; |
| 168 bool is_valid() const { return 0 <= reg_code && reg_code < kMaxNumRegisters; } | 170 bool is_valid() const { return 0 <= reg_code && reg_code < kMaxNumRegisters; } |
| 169 | 171 |
| 170 int code() const { | 172 int code() const { |
| 171 DCHECK(is_valid()); | 173 DCHECK(is_valid()); |
| 172 return reg_code; | 174 return reg_code; |
| 173 } | 175 } |
| 174 | 176 |
| 175 bool is(X87Register reg) const { return reg_code == reg.reg_code; } | 177 bool is(X87Register reg) const { return reg_code == reg.reg_code; } |
| 176 | 178 |
| 177 const char* ToString(); | 179 const char* ToString(); |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 Assembler* assembler_; | 1114 Assembler* assembler_; |
| 1113 #ifdef DEBUG | 1115 #ifdef DEBUG |
| 1114 int space_before_; | 1116 int space_before_; |
| 1115 #endif | 1117 #endif |
| 1116 }; | 1118 }; |
| 1117 | 1119 |
| 1118 } // namespace internal | 1120 } // namespace internal |
| 1119 } // namespace v8 | 1121 } // namespace v8 |
| 1120 | 1122 |
| 1121 #endif // V8_X87_ASSEMBLER_X87_H_ | 1123 #endif // V8_X87_ASSEMBLER_X87_H_ |
| OLD | NEW |