| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 static const int kNumRegisters = Code::kAfterLast; | 119 static const int kNumRegisters = Code::kAfterLast; |
| 120 | 120 |
| 121 static Register from_code(int code) { | 121 static Register from_code(int code) { |
| 122 DCHECK(code >= 0); | 122 DCHECK(code >= 0); |
| 123 DCHECK(code < kNumRegisters); | 123 DCHECK(code < kNumRegisters); |
| 124 Register r = {code}; | 124 Register r = {code}; |
| 125 return r; | 125 return r; |
| 126 } | 126 } |
| 127 const char* ToString(); | 127 const char* ToString(); |
| 128 bool IsAllocatable() const; | 128 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = |
| 129 RegisterConfiguration::CRANKSHAFT) const; |
| 129 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } | 130 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } |
| 130 bool is(Register reg) const { return reg_code == reg.reg_code; } | 131 bool is(Register reg) const { return reg_code == reg.reg_code; } |
| 131 int code() const { | 132 int code() const { |
| 132 DCHECK(is_valid()); | 133 DCHECK(is_valid()); |
| 133 return reg_code; | 134 return reg_code; |
| 134 } | 135 } |
| 135 int bit() const { | 136 int bit() const { |
| 136 DCHECK(is_valid()); | 137 DCHECK(is_valid()); |
| 137 return 1 << reg_code; | 138 return 1 << reg_code; |
| 138 } | 139 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 158 kCode_no_reg = -1 | 159 kCode_no_reg = -1 |
| 159 }; | 160 }; |
| 160 | 161 |
| 161 static const int kMaxNumRegisters = Code::kAfterLast; | 162 static const int kMaxNumRegisters = Code::kAfterLast; |
| 162 | 163 |
| 163 static XMMRegister from_code(int code) { | 164 static XMMRegister from_code(int code) { |
| 164 XMMRegister result = {code}; | 165 XMMRegister result = {code}; |
| 165 return result; | 166 return result; |
| 166 } | 167 } |
| 167 | 168 |
| 168 bool IsAllocatable() const; | 169 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = |
| 170 RegisterConfiguration::CRANKSHAFT) const; |
| 169 bool is_valid() const { return 0 <= reg_code && reg_code < kMaxNumRegisters; } | 171 bool is_valid() const { return 0 <= reg_code && reg_code < kMaxNumRegisters; } |
| 170 | 172 |
| 171 int code() const { | 173 int code() const { |
| 172 DCHECK(is_valid()); | 174 DCHECK(is_valid()); |
| 173 return reg_code; | 175 return reg_code; |
| 174 } | 176 } |
| 175 | 177 |
| 176 bool is(XMMRegister reg) const { return reg_code == reg.reg_code; } | 178 bool is(XMMRegister reg) const { return reg_code == reg.reg_code; } |
| 177 | 179 |
| 178 const char* ToString(); | 180 const char* ToString(); |
| (...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1607 Assembler* assembler_; | 1609 Assembler* assembler_; |
| 1608 #ifdef DEBUG | 1610 #ifdef DEBUG |
| 1609 int space_before_; | 1611 int space_before_; |
| 1610 #endif | 1612 #endif |
| 1611 }; | 1613 }; |
| 1612 | 1614 |
| 1613 } // namespace internal | 1615 } // namespace internal |
| 1614 } // namespace v8 | 1616 } // namespace v8 |
| 1615 | 1617 |
| 1616 #endif // V8_IA32_ASSEMBLER_IA32_H_ | 1618 #endif // V8_IA32_ASSEMBLER_IA32_H_ |
| OLD | NEW |