| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 -1, // ebp | 58 -1, // ebp |
| 59 -1, // esi | 59 -1, // esi |
| 60 4 // edi | 60 4 // edi |
| 61 }; | 61 }; |
| 62 return numbers[reg.code()]; | 62 return numbers[reg.code()]; |
| 63 } | 63 } |
| 64 | 64 |
| 65 | 65 |
| 66 Register RegisterAllocator::ToRegister(int num) { | 66 Register RegisterAllocator::ToRegister(int num) { |
| 67 ASSERT(num >= 0 && num < kNumRegisters); | 67 ASSERT(num >= 0 && num < kNumRegisters); |
| 68 static Register registers[] = { eax, ebx, ecx, edx, edi }; | 68 const Register registers[] = { eax, ebx, ecx, edx, edi }; |
| 69 return registers[num]; | 69 return registers[num]; |
| 70 } | 70 } |
| 71 | 71 |
| 72 | 72 |
| 73 void RegisterAllocator::Initialize() { | 73 void RegisterAllocator::Initialize() { |
| 74 Reset(); | 74 Reset(); |
| 75 // The non-reserved edi register is live on JS function entry. | 75 // The non-reserved edi register is live on JS function entry. |
| 76 Use(edi); // JS function. | 76 Use(edi); // JS function. |
| 77 } | 77 } |
| 78 | 78 |
| 79 | 79 |
| 80 } } // namespace v8::internal | 80 } } // namespace v8::internal |
| 81 | 81 |
| 82 #endif // V8_IA32_REGISTER_ALLOCATOR_IA32_INL_H_ | 82 #endif // V8_IA32_REGISTER_ALLOCATOR_IA32_INL_H_ |
| OLD | NEW |