Revision: 10481
Author: [email protected]
Date: Mon Jan 23 18:13:28 2012
Log: Remove unnecessary IGNORE policy from Lithium operands.
1. This policy was only used for unused spill operands. I'm assigning
an INVALID LOperand to those instead. As a result, we only need
3 bits to encode the policy and have one more available for virtual
registers.
2. Furthermore, corrected the calculation of the maximal number of virtual
registers and changed the upper limit for the size of the Hydrogen IR
accordingly.
3. Doubled the maximal number of deoptimization entries to 8K.
Review URL: http://codereview.chromium.org/9160018
http://code.google.com/p/v8/source/detail?r=10481
Modified:
/branches/bleeding_edge/src/deoptimizer.h
/branches/bleeding_edge/src/lithium-allocator.cc
/branches/bleeding_edge/src/lithium.cc
/branches/bleeding_edge/src/lithium.h
=======================================
--- /branches/bleeding_edge/src/deoptimizer.h Fri Oct 28 01:14:46 2011
+++ /branches/bleeding_edge/src/deoptimizer.h Mon Jan 23 18:13:28 2012
@@ -258,7 +258,7 @@
};
private:
- static const int kNumberOfEntries = 4096;
+ static const int kNumberOfEntries = 8192;
Deoptimizer(Isolate* isolate,
JSFunction* function,
=======================================
--- /branches/bleeding_edge/src/lithium-allocator.cc Fri Jan 13 05:09:52
2012
+++ /branches/bleeding_edge/src/lithium-allocator.cc Mon Jan 23 18:13:28
2012
@@ -161,9 +161,8 @@
next_(NULL),
current_interval_(NULL),
last_processed_use_(NULL),
- spill_start_index_(kMaxInt) {
- spill_operand_ = new LUnallocated(LUnallocated::IGNORE);
-}
+ spill_operand_(new LOperand()),
+ spill_start_index_(kMaxInt) { }
void LiveRange::set_assigned_register(int reg, RegisterKind register_kind)
{
@@ -184,14 +183,15 @@
bool LiveRange::HasAllocatedSpillOperand() const {
- return spill_operand_ != NULL && !spill_operand_->IsUnallocated();
+ ASSERT(spill_operand_ != NULL);
+ return !spill_operand_->IsIgnored();
}
void LiveRange::SetSpillOperand(LOperand* operand) {
ASSERT(!operand->IsUnallocated());
ASSERT(spill_operand_ != NULL);
- ASSERT(spill_operand_->IsUnallocated());
+ ASSERT(spill_operand_->IsIgnored());
spill_operand_->ConvertTo(operand->kind(), operand->index());
}
@@ -1643,7 +1643,7 @@
int LAllocator::max_initial_value_ids() {
- return LUnallocated::kMaxVirtualRegisters / 32;
+ return LUnallocated::kMaxVirtualRegisters / 16;
}
=======================================
--- /branches/bleeding_edge/src/lithium.cc Thu Sep 22 04:30:04 2011
+++ /branches/bleeding_edge/src/lithium.cc Mon Jan 23 18:13:28 2012
@@ -36,6 +36,7 @@
LUnallocated* unalloc = NULL;
switch (kind()) {
case INVALID:
+ stream->Add("(0)");
break;
case UNALLOCATED:
unalloc = LUnallocated::cast(this);
@@ -70,9 +71,6 @@
case LUnallocated::ANY:
stream->Add("(-)");
break;
- case LUnallocated::IGNORE:
- stream->Add("(0)");
- break;
}
break;
case CONSTANT_OPERAND:
=======================================
--- /branches/bleeding_edge/src/lithium.h Fri Jan 13 05:09:52 2012
+++ /branches/bleeding_edge/src/lithium.h Mon Jan 23 18:13:28 2012
@@ -59,6 +59,7 @@
bool IsDoubleRegister() const { return kind() == DOUBLE_REGISTER; }
bool IsArgument() const { return kind() == ARGUMENT; }
bool IsUnallocated() const { return kind() == UNALLOCATED; }
+ bool IsIgnored() const { return kind() == INVALID; }
bool Equals(LOperand* other) const { return value_ == other->value_; }
int VirtualRegister();
@@ -89,8 +90,7 @@
FIXED_SLOT,
MUST_HAVE_REGISTER,
WRITABLE_REGISTER,
- SAME_AS_FIRST_INPUT,
- IGNORE
+ SAME_AS_FIRST_INPUT
};
// Lifetime of operand inside the instruction.
@@ -121,9 +121,9 @@
// The superclass has a KindField. Some policies have a signed fixed
// index in the upper bits.
- static const int kPolicyWidth = 4;
+ static const int kPolicyWidth = 3;
static const int kLifetimeWidth = 1;
- static const int kVirtualRegisterWidth = 17;
+ static const int kVirtualRegisterWidth = 18;
static const int kPolicyShift = kKindFieldWidth;
static const int kLifetimeShift = kPolicyShift + kPolicyWidth;
@@ -143,12 +143,10 @@
kVirtualRegisterWidth> {
};
- static const int kMaxVirtualRegisters = 1 << (kVirtualRegisterWidth + 1);
+ static const int kMaxVirtualRegisters = 1 << kVirtualRegisterWidth;
static const int kMaxFixedIndex = 63;
static const int kMinFixedIndex = -64;
- bool HasIgnorePolicy() const { return policy() == IGNORE; }
- bool HasNoPolicy() const { return policy() == NONE; }
bool HasAnyPolicy() const {
return policy() == ANY;
}
@@ -234,9 +232,7 @@
}
bool IsIgnored() const {
- return destination_ != NULL &&
- destination_->IsUnallocated() &&
- LUnallocated::cast(destination_)->HasIgnorePolicy();
+ return destination_ != NULL && destination_->IsIgnored();
}
// We clear both operands to indicate move that's been eliminated.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev