Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(745)

Side by Side Diff: src/lithium.h

Issue 10966031: Lowered kMaxVirtualRegisters (fixes v8 2139 and chrome 123822 and 128252). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Settled on 15 bits, redistributed bits to kFixedIndexWidth. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 = 18; 136 static const int kVirtualRegisterWidth = 15;
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);
143 145
144 class PolicyField : public BitField<Policy, kPolicyShift, kPolicyWidth> { }; 146 class PolicyField : public BitField<Policy, kPolicyShift, kPolicyWidth> { };
145 147
146 class LifetimeField 148 class LifetimeField
147 : public BitField<Lifetime, kLifetimeShift, kLifetimeWidth> { 149 : public BitField<Lifetime, kLifetimeShift, kLifetimeWidth> {
148 }; 150 };
149 151
150 class VirtualRegisterField 152 class VirtualRegisterField
151 : public BitField<unsigned, 153 : public BitField<unsigned,
152 kVirtualRegisterShift, 154 kVirtualRegisterShift,
153 kVirtualRegisterWidth> { 155 kVirtualRegisterWidth> {
154 }; 156 };
155 157
156 static const int kMaxVirtualRegisters = 1 << kVirtualRegisterWidth; 158 static const int kMaxVirtualRegisters = 1 << kVirtualRegisterWidth;
157 static const int kMaxFixedIndex = 63; 159 static const int kMaxFixedIndex = (1 << kFixedIndexWidth) - 1;
158 static const int kMinFixedIndex = -64; 160 static const int kMinFixedIndex = -(1 << kFixedIndexWidth);
159 161
160 bool HasAnyPolicy() const { 162 bool HasAnyPolicy() const {
161 return policy() == ANY; 163 return policy() == ANY;
162 } 164 }
163 bool HasFixedPolicy() const { 165 bool HasFixedPolicy() const {
164 return policy() == FIXED_REGISTER || 166 return policy() == FIXED_REGISTER ||
165 policy() == FIXED_DOUBLE_REGISTER || 167 policy() == FIXED_DOUBLE_REGISTER ||
166 policy() == FIXED_SLOT; 168 policy() == FIXED_SLOT;
167 } 169 }
168 bool HasRegisterPolicy() const { 170 bool HasRegisterPolicy() const {
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 ZoneList<Handle<JSFunction> > inlined_closures_; 703 ZoneList<Handle<JSFunction> > inlined_closures_;
702 }; 704 };
703 705
704 706
705 int ElementsKindToShiftSize(ElementsKind elements_kind); 707 int ElementsKindToShiftSize(ElementsKind elements_kind);
706 708
707 709
708 } } // namespace v8::internal 710 } } // namespace v8::internal
709 711
710 #endif // V8_LITHIUM_H_ 712 #endif // V8_LITHIUM_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698