| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 } | 90 } |
| 91 | 91 |
| 92 | 92 |
| 93 void RegisterAllocator::UnuseReserved(RegisterFile* register_file) { | 93 void RegisterAllocator::UnuseReserved(RegisterFile* register_file) { |
| 94 register_file->ref_counts_[esp.code()] = 0; | 94 register_file->ref_counts_[esp.code()] = 0; |
| 95 register_file->ref_counts_[ebp.code()] = 0; | 95 register_file->ref_counts_[ebp.code()] = 0; |
| 96 register_file->ref_counts_[esi.code()] = 0; | 96 register_file->ref_counts_[esi.code()] = 0; |
| 97 } | 97 } |
| 98 | 98 |
| 99 | 99 |
| 100 bool RegisterAllocator::IsReserved(int reg_code) { |
| 101 // Test below relies on the order of register codes. |
| 102 return reg_code >= esp.code() && reg_code <= esi.code(); |
| 103 } |
| 104 |
| 105 |
| 100 void RegisterAllocator::Initialize() { | 106 void RegisterAllocator::Initialize() { |
| 101 Reset(); | 107 Reset(); |
| 102 // The following register is live on function entry, saved in the | 108 // The following register is live on function entry, saved in the |
| 103 // frame, and available for allocation during execution. | 109 // frame, and available for allocation during execution. |
| 104 Use(edi); // JS function. | 110 Use(edi); // JS function. |
| 105 } | 111 } |
| 106 | 112 |
| 107 | 113 |
| 108 void RegisterAllocator::Reset() { | 114 void RegisterAllocator::Reset() { |
| 109 registers_.Reset(); | 115 registers_.Reset(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 121 // register if valid and return an invalid result. | 127 // register if valid and return an invalid result. |
| 122 if (result.is_valid() && !result.reg().is_byte_register()) { | 128 if (result.is_valid() && !result.reg().is_byte_register()) { |
| 123 result.Unuse(); | 129 result.Unuse(); |
| 124 return Result(cgen_); | 130 return Result(cgen_); |
| 125 } | 131 } |
| 126 return result; | 132 return result; |
| 127 } | 133 } |
| 128 | 134 |
| 129 | 135 |
| 130 } } // namespace v8::internal | 136 } } // namespace v8::internal |
| OLD | NEW |