| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 } | 126 } |
| 127 | 127 |
| 128 LUnallocated(Policy policy, Lifetime lifetime) : LOperand(UNALLOCATED, 0) { | 128 LUnallocated(Policy policy, Lifetime lifetime) : LOperand(UNALLOCATED, 0) { |
| 129 Initialize(policy, 0, lifetime); | 129 Initialize(policy, 0, lifetime); |
| 130 } | 130 } |
| 131 | 131 |
| 132 // The superclass has a KindField. Some policies have a signed fixed | 132 // The superclass has a KindField. Some policies have a signed fixed |
| 133 // index in the upper bits. | 133 // index in the upper bits. |
| 134 static const int kPolicyWidth = 3; | 134 static const int kPolicyWidth = 3; |
| 135 static const int kLifetimeWidth = 1; | 135 static const int kLifetimeWidth = 1; |
| 136 static const int kVirtualRegisterWidth = 15; | 136 static const int kVirtualRegisterWidth = 18; |
| 137 | 137 |
| 138 static const int kPolicyShift = kKindFieldWidth; | 138 static const int kPolicyShift = kKindFieldWidth; |
| 139 static const int kLifetimeShift = kPolicyShift + kPolicyWidth; | 139 static const int kLifetimeShift = kPolicyShift + kPolicyWidth; |
| 140 static const int kVirtualRegisterShift = kLifetimeShift + kLifetimeWidth; | 140 static const int kVirtualRegisterShift = kLifetimeShift + kLifetimeWidth; |
| 141 static const int kFixedIndexShift = | 141 static const int kFixedIndexShift = |
| 142 kVirtualRegisterShift + kVirtualRegisterWidth; | 142 kVirtualRegisterShift + kVirtualRegisterWidth; |
| 143 static const int kFixedIndexWidth = 32 - kFixedIndexShift; | |
| 144 STATIC_ASSERT(kFixedIndexWidth > 5); | |
| 145 | 143 |
| 146 class PolicyField : public BitField<Policy, kPolicyShift, kPolicyWidth> { }; | 144 class PolicyField : public BitField<Policy, kPolicyShift, kPolicyWidth> { }; |
| 147 | 145 |
| 148 class LifetimeField | 146 class LifetimeField |
| 149 : public BitField<Lifetime, kLifetimeShift, kLifetimeWidth> { | 147 : public BitField<Lifetime, kLifetimeShift, kLifetimeWidth> { |
| 150 }; | 148 }; |
| 151 | 149 |
| 152 class VirtualRegisterField | 150 class VirtualRegisterField |
| 153 : public BitField<unsigned, | 151 : public BitField<unsigned, |
| 154 kVirtualRegisterShift, | 152 kVirtualRegisterShift, |
| 155 kVirtualRegisterWidth> { | 153 kVirtualRegisterWidth> { |
| 156 }; | 154 }; |
| 157 | 155 |
| 158 static const int kMaxVirtualRegisters = 1 << kVirtualRegisterWidth; | 156 static const int kMaxVirtualRegisters = 1 << kVirtualRegisterWidth; |
| 159 static const int kMaxFixedIndex = (1 << kFixedIndexWidth) - 1; | 157 static const int kMaxFixedIndex = 63; |
| 160 static const int kMinFixedIndex = -(1 << kFixedIndexWidth); | 158 static const int kMinFixedIndex = -64; |
| 161 | 159 |
| 162 bool HasAnyPolicy() const { | 160 bool HasAnyPolicy() const { |
| 163 return policy() == ANY; | 161 return policy() == ANY; |
| 164 } | 162 } |
| 165 bool HasFixedPolicy() const { | 163 bool HasFixedPolicy() const { |
| 166 return policy() == FIXED_REGISTER || | 164 return policy() == FIXED_REGISTER || |
| 167 policy() == FIXED_DOUBLE_REGISTER || | 165 policy() == FIXED_DOUBLE_REGISTER || |
| 168 policy() == FIXED_SLOT; | 166 policy() == FIXED_SLOT; |
| 169 } | 167 } |
| 170 bool HasRegisterPolicy() const { | 168 bool HasRegisterPolicy() const { |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 ZoneList<Handle<JSFunction> > inlined_closures_; | 701 ZoneList<Handle<JSFunction> > inlined_closures_; |
| 704 }; | 702 }; |
| 705 | 703 |
| 706 | 704 |
| 707 int ElementsKindToShiftSize(ElementsKind elements_kind); | 705 int ElementsKindToShiftSize(ElementsKind elements_kind); |
| 708 | 706 |
| 709 | 707 |
| 710 } } // namespace v8::internal | 708 } } // namespace v8::internal |
| 711 | 709 |
| 712 #endif // V8_LITHIUM_H_ | 710 #endif // V8_LITHIUM_H_ |
| OLD | NEW |