diff --git a/src/cfg.cc b/src/cfg.cc index d714887a53..d2dff522b5 100644 --- a/src/cfg.cc +++ b/src/cfg.cc @@ -60,10 +60,10 @@ Cfg* Cfg::Build() { if (fun->scope()->num_heap_slots() > 0) { 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"); } - if (fun->scope()->num_parameters() > kPointerSize - 1) { + if (fun->scope()->num_parameters() > kBitsPerPointer - 1) { BAILOUT("function has too many parameters"); } if (fun->scope()->arguments() != NULL) { @@ -320,6 +320,7 @@ void ExpressionCfgBuilder::VisitAssignment(Assignment* expr) { if (lhs->AsProperty() != NULL) { BAILOUT("unsupported property assignment"); } + Variable* var = lhs->AsVariableProxy()->AsVariable(); if (var == NULL) { BAILOUT("unsupported invalid left-hand side"); @@ -333,6 +334,7 @@ void ExpressionCfgBuilder::VisitAssignment(Assignment* expr) { BAILOUT("unsupported slot lhs (not a parameter or local)"); } + // Parameter and local slot assignments. ExpressionCfgBuilder builder; SlotLocation* loc = new SlotLocation(slot->type(), slot->index()); builder.Build(expr->value(), loc); @@ -361,11 +363,11 @@ void ExpressionCfgBuilder::VisitProperty(Property* expr) { ExpressionCfgBuilder object, key; object.Build(expr->obj(), NULL); if (object.graph() == NULL) { - BAILOUT("unsupported object subexpression in propref"); + BAILOUT("unsupported object subexpression in propload"); } key.Build(expr->key(), NULL); if (key.graph() == NULL) { - BAILOUT("unsupported key subexpression in propref"); + BAILOUT("unsupported key subexpression in propload"); } if (destination_ == NULL) destination_ = new TempLocation(); diff --git a/src/cfg.h b/src/cfg.h index af482aa02f..0eb0f929df 100644 --- a/src/cfg.h +++ b/src/cfg.h @@ -415,7 +415,7 @@ class OneOperandInstruction : public Instruction { // Base class of instructions that have two input operands. class TwoOperandInstruction : public Instruction { - protected: + public: // Support for fast-compilation mode: virtual void Compile(MacroAssembler* masm) = 0; void FastAllocate(TempLocation* temp); @@ -768,11 +768,11 @@ class LocationSet BASE_EMBEDDED { void AddElement(SlotLocation* location) { if (location->type() == Slot::PARAMETER) { // Parameter indexes begin with -1 ('this'). - ASSERT(location->index() < kPointerSize - 1); + ASSERT(location->index() < kBitsPerPointer - 1); parameters_ |= (1 << (location->index() + 1)); } else { ASSERT(location->type() == Slot::LOCAL); - ASSERT(location->index() < kPointerSize); + ASSERT(location->index() < kBitsPerPointer); locals_ |= (1 << location->index()); } } @@ -785,11 +785,11 @@ class LocationSet BASE_EMBEDDED { bool Contains(SlotLocation* location) { if (location->type() == Slot::PARAMETER) { - ASSERT(location->index() < kPointerSize - 1); + ASSERT(location->index() < kBitsPerPointer - 1); return (parameters_ & (1 << (location->index() + 1))); } else { ASSERT(location->type() == Slot::LOCAL); - ASSERT(location->index() < kPointerSize); + ASSERT(location->index() < kBitsPerPointer); return (locals_ & (1 << location->index())); } } @@ -834,7 +834,7 @@ class ExpressionCfgBuilder : public AstVisitor { #undef DECLARE_VISIT private: - // State for the visitor. Input parameters: + // State for the visitor. Input parameter: Location* destination_; // Output parameters: