Change the location set size from kPointerSize to kBitsPerPointer.
This was leftover from an old code review and not yet submitted. Review URL: http://codereview.chromium.org/164315 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2660 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
d1f846cb2b
commit
29b12aba42
10
src/cfg.cc
10
src/cfg.cc
@ -60,10 +60,10 @@ Cfg* Cfg::Build() {
|
|||||||
if (fun->scope()->num_heap_slots() > 0) {
|
if (fun->scope()->num_heap_slots() > 0) {
|
||||||
BAILOUT("function has context slots");
|
BAILOUT("function has context slots");
|
||||||
}
|
}
|
||||||
if (fun->scope()->num_stack_slots() > kPointerSize) {
|
if (fun->scope()->num_stack_slots() > kBitsPerPointer) {
|
||||||
BAILOUT("function has too many locals");
|
BAILOUT("function has too many locals");
|
||||||
}
|
}
|
||||||
if (fun->scope()->num_parameters() > kPointerSize - 1) {
|
if (fun->scope()->num_parameters() > kBitsPerPointer - 1) {
|
||||||
BAILOUT("function has too many parameters");
|
BAILOUT("function has too many parameters");
|
||||||
}
|
}
|
||||||
if (fun->scope()->arguments() != NULL) {
|
if (fun->scope()->arguments() != NULL) {
|
||||||
@ -320,6 +320,7 @@ void ExpressionCfgBuilder::VisitAssignment(Assignment* expr) {
|
|||||||
if (lhs->AsProperty() != NULL) {
|
if (lhs->AsProperty() != NULL) {
|
||||||
BAILOUT("unsupported property assignment");
|
BAILOUT("unsupported property assignment");
|
||||||
}
|
}
|
||||||
|
|
||||||
Variable* var = lhs->AsVariableProxy()->AsVariable();
|
Variable* var = lhs->AsVariableProxy()->AsVariable();
|
||||||
if (var == NULL) {
|
if (var == NULL) {
|
||||||
BAILOUT("unsupported invalid left-hand side");
|
BAILOUT("unsupported invalid left-hand side");
|
||||||
@ -333,6 +334,7 @@ void ExpressionCfgBuilder::VisitAssignment(Assignment* expr) {
|
|||||||
BAILOUT("unsupported slot lhs (not a parameter or local)");
|
BAILOUT("unsupported slot lhs (not a parameter or local)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Parameter and local slot assignments.
|
||||||
ExpressionCfgBuilder builder;
|
ExpressionCfgBuilder builder;
|
||||||
SlotLocation* loc = new SlotLocation(slot->type(), slot->index());
|
SlotLocation* loc = new SlotLocation(slot->type(), slot->index());
|
||||||
builder.Build(expr->value(), loc);
|
builder.Build(expr->value(), loc);
|
||||||
@ -361,11 +363,11 @@ void ExpressionCfgBuilder::VisitProperty(Property* expr) {
|
|||||||
ExpressionCfgBuilder object, key;
|
ExpressionCfgBuilder object, key;
|
||||||
object.Build(expr->obj(), NULL);
|
object.Build(expr->obj(), NULL);
|
||||||
if (object.graph() == NULL) {
|
if (object.graph() == NULL) {
|
||||||
BAILOUT("unsupported object subexpression in propref");
|
BAILOUT("unsupported object subexpression in propload");
|
||||||
}
|
}
|
||||||
key.Build(expr->key(), NULL);
|
key.Build(expr->key(), NULL);
|
||||||
if (key.graph() == NULL) {
|
if (key.graph() == NULL) {
|
||||||
BAILOUT("unsupported key subexpression in propref");
|
BAILOUT("unsupported key subexpression in propload");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (destination_ == NULL) destination_ = new TempLocation();
|
if (destination_ == NULL) destination_ = new TempLocation();
|
||||||
|
12
src/cfg.h
12
src/cfg.h
@ -415,7 +415,7 @@ class OneOperandInstruction : public Instruction {
|
|||||||
|
|
||||||
// Base class of instructions that have two input operands.
|
// Base class of instructions that have two input operands.
|
||||||
class TwoOperandInstruction : public Instruction {
|
class TwoOperandInstruction : public Instruction {
|
||||||
protected:
|
public:
|
||||||
// Support for fast-compilation mode:
|
// Support for fast-compilation mode:
|
||||||
virtual void Compile(MacroAssembler* masm) = 0;
|
virtual void Compile(MacroAssembler* masm) = 0;
|
||||||
void FastAllocate(TempLocation* temp);
|
void FastAllocate(TempLocation* temp);
|
||||||
@ -768,11 +768,11 @@ class LocationSet BASE_EMBEDDED {
|
|||||||
void AddElement(SlotLocation* location) {
|
void AddElement(SlotLocation* location) {
|
||||||
if (location->type() == Slot::PARAMETER) {
|
if (location->type() == Slot::PARAMETER) {
|
||||||
// Parameter indexes begin with -1 ('this').
|
// Parameter indexes begin with -1 ('this').
|
||||||
ASSERT(location->index() < kPointerSize - 1);
|
ASSERT(location->index() < kBitsPerPointer - 1);
|
||||||
parameters_ |= (1 << (location->index() + 1));
|
parameters_ |= (1 << (location->index() + 1));
|
||||||
} else {
|
} else {
|
||||||
ASSERT(location->type() == Slot::LOCAL);
|
ASSERT(location->type() == Slot::LOCAL);
|
||||||
ASSERT(location->index() < kPointerSize);
|
ASSERT(location->index() < kBitsPerPointer);
|
||||||
locals_ |= (1 << location->index());
|
locals_ |= (1 << location->index());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -785,11 +785,11 @@ class LocationSet BASE_EMBEDDED {
|
|||||||
|
|
||||||
bool Contains(SlotLocation* location) {
|
bool Contains(SlotLocation* location) {
|
||||||
if (location->type() == Slot::PARAMETER) {
|
if (location->type() == Slot::PARAMETER) {
|
||||||
ASSERT(location->index() < kPointerSize - 1);
|
ASSERT(location->index() < kBitsPerPointer - 1);
|
||||||
return (parameters_ & (1 << (location->index() + 1)));
|
return (parameters_ & (1 << (location->index() + 1)));
|
||||||
} else {
|
} else {
|
||||||
ASSERT(location->type() == Slot::LOCAL);
|
ASSERT(location->type() == Slot::LOCAL);
|
||||||
ASSERT(location->index() < kPointerSize);
|
ASSERT(location->index() < kBitsPerPointer);
|
||||||
return (locals_ & (1 << location->index()));
|
return (locals_ & (1 << location->index()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -834,7 +834,7 @@ class ExpressionCfgBuilder : public AstVisitor {
|
|||||||
#undef DECLARE_VISIT
|
#undef DECLARE_VISIT
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// State for the visitor. Input parameters:
|
// State for the visitor. Input parameter:
|
||||||
Location* destination_;
|
Location* destination_;
|
||||||
|
|
||||||
// Output parameters:
|
// Output parameters:
|
||||||
|
Loading…
Reference in New Issue
Block a user