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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10481 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
fschneider@chromium.org 2012-01-24 02:13:28 +00:00
parent c6e1d11885
commit 0b3ce1dd9e
4 changed files with 14 additions and 20 deletions

View File

@ -258,7 +258,7 @@ class Deoptimizer : public Malloced {
};
private:
static const int kNumberOfEntries = 4096;
static const int kNumberOfEntries = 8192;
Deoptimizer(Isolate* isolate,
JSFunction* function,

View File

@ -161,9 +161,8 @@ LiveRange::LiveRange(int id)
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 @@ void LiveRange::MakeSpilled() {
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 @@ void LAllocator::RecordUse(HValue* value, LUnallocated* operand) {
int LAllocator::max_initial_value_ids() {
return LUnallocated::kMaxVirtualRegisters / 32;
return LUnallocated::kMaxVirtualRegisters / 16;
}

View File

@ -36,6 +36,7 @@ void LOperand::PrintTo(StringStream* stream) {
LUnallocated* unalloc = NULL;
switch (kind()) {
case INVALID:
stream->Add("(0)");
break;
case UNALLOCATED:
unalloc = LUnallocated::cast(this);
@ -70,9 +71,6 @@ void LOperand::PrintTo(StringStream* stream) {
case LUnallocated::ANY:
stream->Add("(-)");
break;
case LUnallocated::IGNORE:
stream->Add("(0)");
break;
}
break;
case CONSTANT_OPERAND:

View File

@ -59,6 +59,7 @@ class LOperand: public ZoneObject {
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 @@ class LUnallocated: public LOperand {
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 @@ class LUnallocated: public LOperand {
// 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 @@ class LUnallocated: public LOperand {
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 @@ class LMoveOperands BASE_EMBEDDED {
}
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.