Change the location set size from kPointerSize to kBitsPerPointer.
authorkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 11 Aug 2009 11:47:41 +0000 (11:47 +0000)
committerkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 11 Aug 2009 11:47:41 +0000 (11:47 +0000)
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

src/cfg.cc
src/cfg.h

index d714887..d2dff52 100644 (file)
@@ -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();
index af482aa..0eb0f92 100644 (file)
--- 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: