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