| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 } | 90 } |
| 91 int bit() const { | 91 int bit() const { |
| 92 ASSERT(is_valid()); | 92 ASSERT(is_valid()); |
| 93 return 1 << code_; | 93 return 1 << code_; |
| 94 } | 94 } |
| 95 | 95 |
| 96 // Unfortunately we can't make this private in a struct. | 96 // Unfortunately we can't make this private in a struct. |
| 97 int code_; | 97 int code_; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 const int kRegister_eax_Code = 0; | |
| 101 const int kRegister_ecx_Code = 1; | |
| 102 const int kRegister_edx_Code = 2; | |
| 103 const int kRegister_ebx_Code = 3; | |
| 104 const int kRegister_esp_Code = 4; | |
| 105 const int kRegister_ebp_Code = 5; | |
| 106 const int kRegister_esi_Code = 6; | |
| 107 const int kRegister_edi_Code = 7; | |
| 108 const int kRegister_no_reg_Code = -1; | |
| 109 | 100 |
| 110 const Register eax = { kRegister_eax_Code }; | 101 const Register eax = { 0 }; |
| 111 const Register ecx = { kRegister_ecx_Code }; | 102 const Register ecx = { 1 }; |
| 112 const Register edx = { kRegister_edx_Code }; | 103 const Register edx = { 2 }; |
| 113 const Register ebx = { kRegister_ebx_Code }; | 104 const Register ebx = { 3 }; |
| 114 const Register esp = { kRegister_esp_Code }; | 105 const Register esp = { 4 }; |
| 115 const Register ebp = { kRegister_ebp_Code }; | 106 const Register ebp = { 5 }; |
| 116 const Register esi = { kRegister_esi_Code }; | 107 const Register esi = { 6 }; |
| 117 const Register edi = { kRegister_edi_Code }; | 108 const Register edi = { 7 }; |
| 118 const Register no_reg = { kRegister_no_reg_Code }; | 109 const Register no_reg = { -1 }; |
| 119 | 110 |
| 120 | 111 |
| 121 inline const char* Register::AllocationIndexToString(int index) { | 112 inline const char* Register::AllocationIndexToString(int index) { |
| 122 ASSERT(index >= 0 && index < kNumAllocatableRegisters); | 113 ASSERT(index >= 0 && index < kNumAllocatableRegisters); |
| 123 // This is the mapping of allocation indices to registers. | 114 // This is the mapping of allocation indices to registers. |
| 124 const char* const kNames[] = { "eax", "ecx", "edx", "ebx", "esi", "edi" }; | 115 const char* const kNames[] = { "eax", "ecx", "edx", "ebx", "esi", "edi" }; |
| 125 return kNames[index]; | 116 return kNames[index]; |
| 126 } | 117 } |
| 127 | 118 |
| 128 | 119 |
| (...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 private: | 1202 private: |
| 1212 Assembler* assembler_; | 1203 Assembler* assembler_; |
| 1213 #ifdef DEBUG | 1204 #ifdef DEBUG |
| 1214 int space_before_; | 1205 int space_before_; |
| 1215 #endif | 1206 #endif |
| 1216 }; | 1207 }; |
| 1217 | 1208 |
| 1218 } } // namespace v8::internal | 1209 } } // namespace v8::internal |
| 1219 | 1210 |
| 1220 #endif // V8_IA32_ASSEMBLER_IA32_H_ | 1211 #endif // V8_IA32_ASSEMBLER_IA32_H_ |
| OLD | NEW |