Chromium Code Reviews| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 // and best performance in optimized code. | 75 // and best performance in optimized code. |
| 76 // | 76 // |
| 77 | 77 |
| 78 struct Register { | 78 struct Register { |
| 79 static Register toRegister(int code) { | 79 static Register toRegister(int code) { |
| 80 Register r = { code }; | 80 Register r = { code }; |
| 81 return r; | 81 return r; |
| 82 } | 82 } |
| 83 bool is_valid() const { return 0 <= code_ && code_ < 16; } | 83 bool is_valid() const { return 0 <= code_ && code_ < 16; } |
| 84 bool is(Register reg) const { return code_ == reg.code_; } | 84 bool is(Register reg) const { return code_ == reg.code_; } |
| 85 // The byte-register distinction of ai32 has dissapeared. | |
|
William Hesse
2009/06/25 10:46:05
ia32
| |
| 86 bool is_byte_register() const { return false; } | |
| 87 int code() const { | 85 int code() const { |
| 88 ASSERT(is_valid()); | 86 ASSERT(is_valid()); |
| 89 return code_; | 87 return code_; |
| 90 } | 88 } |
| 91 int bit() const { | 89 int bit() const { |
| 92 return 1 << code_; | 90 return 1 << code_; |
| 93 } | 91 } |
| 94 | 92 |
| 95 // Return the high bit of the register code as a 0 or 1. Used often | 93 // Return the high bit of the register code as a 0 or 1. Used often |
| 96 // when constructing the REX prefix byte. | 94 // when constructing the REX prefix byte. |
| (...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1155 private: | 1153 private: |
| 1156 Assembler* assembler_; | 1154 Assembler* assembler_; |
| 1157 #ifdef DEBUG | 1155 #ifdef DEBUG |
| 1158 int space_before_; | 1156 int space_before_; |
| 1159 #endif | 1157 #endif |
| 1160 }; | 1158 }; |
| 1161 | 1159 |
| 1162 } } // namespace v8::internal | 1160 } } // namespace v8::internal |
| 1163 | 1161 |
| 1164 #endif // V8_X64_ASSEMBLER_X64_H_ | 1162 #endif // V8_X64_ASSEMBLER_X64_H_ |
| OLD | NEW |