| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 policy() == FIXED_SLOT; | 158 policy() == FIXED_SLOT; |
| 159 } | 159 } |
| 160 bool HasRegisterPolicy() const { | 160 bool HasRegisterPolicy() const { |
| 161 return policy() == WRITABLE_REGISTER || policy() == MUST_HAVE_REGISTER; | 161 return policy() == WRITABLE_REGISTER || policy() == MUST_HAVE_REGISTER; |
| 162 } | 162 } |
| 163 bool HasSameAsInputPolicy() const { | 163 bool HasSameAsInputPolicy() const { |
| 164 return policy() == SAME_AS_FIRST_INPUT; | 164 return policy() == SAME_AS_FIRST_INPUT; |
| 165 } | 165 } |
| 166 Policy policy() const { return PolicyField::decode(value_); } | 166 Policy policy() const { return PolicyField::decode(value_); } |
| 167 void set_policy(Policy policy) { | 167 void set_policy(Policy policy) { |
| 168 value_ &= ~PolicyField::mask(); | 168 value_ = PolicyField::update(value_, policy); |
| 169 value_ |= PolicyField::encode(policy); | |
| 170 } | 169 } |
| 171 int fixed_index() const { | 170 int fixed_index() const { |
| 172 return static_cast<int>(value_) >> kFixedIndexShift; | 171 return static_cast<int>(value_) >> kFixedIndexShift; |
| 173 } | 172 } |
| 174 | 173 |
| 175 unsigned virtual_register() const { | 174 unsigned virtual_register() const { |
| 176 return VirtualRegisterField::decode(value_); | 175 return VirtualRegisterField::decode(value_); |
| 177 } | 176 } |
| 178 | 177 |
| 179 void set_virtual_register(unsigned id) { | 178 void set_virtual_register(unsigned id) { |
| 180 value_ &= ~VirtualRegisterField::mask(); | 179 value_ = VirtualRegisterField::update(value_, id); |
| 181 value_ |= VirtualRegisterField::encode(id); | |
| 182 } | 180 } |
| 183 | 181 |
| 184 LUnallocated* CopyUnconstrained() { | 182 LUnallocated* CopyUnconstrained() { |
| 185 LUnallocated* result = new LUnallocated(ANY); | 183 LUnallocated* result = new LUnallocated(ANY); |
| 186 result->set_virtual_register(virtual_register()); | 184 result->set_virtual_register(virtual_register()); |
| 187 return result; | 185 return result; |
| 188 } | 186 } |
| 189 | 187 |
| 190 static LUnallocated* cast(LOperand* op) { | 188 static LUnallocated* cast(LOperand* op) { |
| 191 ASSERT(op->IsUnallocated()); | 189 ASSERT(op->IsUnallocated()); |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 ShallowIterator current_iterator_; | 583 ShallowIterator current_iterator_; |
| 586 }; | 584 }; |
| 587 | 585 |
| 588 | 586 |
| 589 int ElementsKindToShiftSize(ElementsKind elements_kind); | 587 int ElementsKindToShiftSize(ElementsKind elements_kind); |
| 590 | 588 |
| 591 | 589 |
| 592 } } // namespace v8::internal | 590 } } // namespace v8::internal |
| 593 | 591 |
| 594 #endif // V8_LITHIUM_H_ | 592 #endif // V8_LITHIUM_H_ |
| OLD | NEW |