| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 Result Allocate(); | 204 Result Allocate(); |
| 205 | 205 |
| 206 // Allocate a specific register if possible, spilling it from the frame if | 206 // Allocate a specific register if possible, spilling it from the frame if |
| 207 // necessary, or else fail and return an invalid result. | 207 // necessary, or else fail and return an invalid result. |
| 208 Result Allocate(Register target); | 208 Result Allocate(Register target); |
| 209 | 209 |
| 210 // Allocate a free register without spilling any from the current frame or | 210 // Allocate a free register without spilling any from the current frame or |
| 211 // fail and return an invalid result. | 211 // fail and return an invalid result. |
| 212 Result AllocateWithoutSpilling(); | 212 Result AllocateWithoutSpilling(); |
| 213 | 213 |
| 214 // Allocate a free byte register without spilling any from the |
| 215 // current frame or fail and return an invalid result. |
| 216 Result AllocateByteRegisterWithoutSpilling(); |
| 217 |
| 214 // Copy the internal state to a register file, to be restored later by | 218 // Copy the internal state to a register file, to be restored later by |
| 215 // RestoreFrom. | 219 // RestoreFrom. |
| 216 void SaveTo(RegisterFile* register_file) { | 220 void SaveTo(RegisterFile* register_file) { |
| 217 registers_.CopyTo(register_file); | 221 registers_.CopyTo(register_file); |
| 218 } | 222 } |
| 219 | 223 |
| 220 void RestoreFrom(RegisterFile* register_file) { | 224 void RestoreFrom(RegisterFile* register_file) { |
| 221 register_file->CopyTo(®isters_); | 225 register_file->CopyTo(®isters_); |
| 222 } | 226 } |
| 223 | 227 |
| 224 private: | 228 private: |
| 225 CodeGenerator* cgen_; | 229 CodeGenerator* cgen_; |
| 226 RegisterFile registers_; | 230 RegisterFile registers_; |
| 227 }; | 231 }; |
| 228 | 232 |
| 229 } } // namespace v8::internal | 233 } } // namespace v8::internal |
| 230 | 234 |
| 231 #endif // V8_REGISTER_ALLOCATOR_IA32_H_ | 235 #endif // V8_REGISTER_ALLOCATOR_IA32_H_ |
| OLD | NEW |