| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 } else { | 116 } else { |
| 117 if (CodeGeneratorScope::Current()->IsUnsafeSmi(handle())) { | 117 if (CodeGeneratorScope::Current()->IsUnsafeSmi(handle())) { |
| 118 CodeGeneratorScope::Current()->MoveUnsafeSmi(fresh.reg(), handle()); | 118 CodeGeneratorScope::Current()->MoveUnsafeSmi(fresh.reg(), handle()); |
| 119 } else { | 119 } else { |
| 120 CodeGeneratorScope::Current()->masm()->Set(fresh.reg(), | 120 CodeGeneratorScope::Current()->masm()->Set(fresh.reg(), |
| 121 Immediate(handle())); | 121 Immediate(handle())); |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 fresh.set_number_info(number_info()); |
| 125 fresh.set_untagged_int32(is_untagged_int32()); | 126 fresh.set_untagged_int32(is_untagged_int32()); |
| 126 *this = fresh; | 127 *this = fresh; |
| 127 } else if (is_register() && reg().is(target)) { | 128 } else if (is_register() && reg().is(target)) { |
| 128 ASSERT(CodeGeneratorScope::Current()->has_valid_frame()); | 129 ASSERT(CodeGeneratorScope::Current()->has_valid_frame()); |
| 129 CodeGeneratorScope::Current()->frame()->Spill(target); | 130 CodeGeneratorScope::Current()->frame()->Spill(target); |
| 130 ASSERT(CodeGeneratorScope::Current()->allocator()->count(target) == 1); | 131 ASSERT(CodeGeneratorScope::Current()->allocator()->count(target) == 1); |
| 131 } | 132 } |
| 132 ASSERT(is_register()); | 133 ASSERT(is_register()); |
| 133 ASSERT(reg().is(target)); | 134 ASSERT(reg().is(target)); |
| 134 } | 135 } |
| 135 | 136 |
| 136 | 137 |
| 137 // ------------------------------------------------------------------------- | 138 // ------------------------------------------------------------------------- |
| 138 // RegisterAllocator implementation. | 139 // RegisterAllocator implementation. |
| 139 | 140 |
| 140 Result RegisterAllocator::AllocateByteRegisterWithoutSpilling() { | 141 Result RegisterAllocator::AllocateByteRegisterWithoutSpilling() { |
| 141 Result result = AllocateWithoutSpilling(); | 142 Result result = AllocateWithoutSpilling(); |
| 142 // Check that the register is a byte register. If not, unuse the | 143 // Check that the register is a byte register. If not, unuse the |
| 143 // register if valid and return an invalid result. | 144 // register if valid and return an invalid result. |
| 144 if (result.is_valid() && !result.reg().is_byte_register()) { | 145 if (result.is_valid() && !result.reg().is_byte_register()) { |
| 145 result.Unuse(); | 146 result.Unuse(); |
| 146 return Result(); | 147 return Result(); |
| 147 } | 148 } |
| 148 return result; | 149 return result; |
| 149 } | 150 } |
| 150 | 151 |
| 151 | 152 |
| 152 } } // namespace v8::internal | 153 } } // namespace v8::internal |
| OLD | NEW |