Remove a bunch of unnecessary includes from header files in favor of
authorkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 20 Mar 2009 09:35:31 +0000 (09:35 +0000)
committerkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 20 Mar 2009 09:35:31 +0000 (09:35 +0000)
forward declarations.

Review URL: http://codereview.chromium.org/42389

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1559 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

17 files changed:
src/codegen-arm.cc
src/codegen-arm.h
src/codegen-ia32.cc
src/codegen-ia32.h
src/codegen-inl.h
src/codegen.cc
src/jump-target-arm.cc
src/jump-target-ia32.cc
src/jump-target.cc
src/jump-target.h
src/register-allocator-ia32.cc
src/register-allocator.cc
src/virtual-frame-arm.cc
src/virtual-frame-arm.h
src/virtual-frame-ia32.cc
src/virtual-frame-ia32.h
src/virtual-frame.h

index 3236859..8c8f588 100644 (file)
@@ -30,8 +30,9 @@
 #include "bootstrapper.h"
 #include "codegen-inl.h"
 #include "debug.h"
-#include "scopes.h"
 #include "runtime.h"
+#include "scopes.h"
+#include "virtual-frame.h"
 
 namespace v8 { namespace internal {
 
@@ -376,6 +377,22 @@ MemOperand CodeGenerator::ContextSlotOperandCheckExtensions(
 }
 
 
+void CodeGenerator::LoadConditionAndSpill(Expression* expression,
+                                          TypeofState typeof_state,
+                                          JumpTarget* true_target,
+                                          JumpTarget* false_target,
+                                          bool force_control) {
+  ASSERT(in_spilled_code());
+  set_in_spilled_code(false);
+  LoadCondition(expression, typeof_state, true_target, false_target,
+                force_control);
+  if (frame_ != NULL) {
+    frame_->SpillAll();
+  }
+  set_in_spilled_code(true);
+}
+
+
 // Loads a value on TOS. If it is a boolean value, the result may have been
 // (partially) translated into branches, or it may have set the condition
 // code register. If force_cc is set, the value is forced to set the
@@ -421,6 +438,16 @@ void CodeGenerator::LoadCondition(Expression* x,
 }
 
 
+void CodeGenerator::LoadAndSpill(Expression* expression,
+                                 TypeofState typeof_state) {
+  ASSERT(in_spilled_code());
+  set_in_spilled_code(false);
+  Load(expression, typeof_state);
+  frame_->SpillAll();
+  set_in_spilled_code(true);
+}
+
+
 void CodeGenerator::Load(Expression* x, TypeofState typeof_state) {
 #ifdef DEBUG
   int original_height = frame_->height();
@@ -1113,6 +1140,28 @@ void CodeGenerator::CheckStack() {
 }
 
 
+void CodeGenerator::VisitAndSpill(Statement* statement) {
+  ASSERT(in_spilled_code());
+  set_in_spilled_code(false);
+  Visit(statement);
+  if (frame_ != NULL) {
+    frame_->SpillAll();
+    }
+  set_in_spilled_code(true);
+}
+
+
+void CodeGenerator::VisitStatementsAndSpill(ZoneList<Statement*>* statements) {
+  ASSERT(in_spilled_code());
+  set_in_spilled_code(false);
+  VisitStatements(statements);
+  if (frame_ != NULL) {
+    frame_->SpillAll();
+  }
+  set_in_spilled_code(true);
+}
+
+
 void CodeGenerator::VisitStatements(ZoneList<Statement*>* statements) {
 #ifdef DEBUG
   int original_height = frame_->height();
@@ -3974,6 +4023,15 @@ Handle<String> Reference::GetName() {
 }
 
 
+void Reference::GetValueAndSpill(TypeofState typeof_state) {
+  ASSERT(cgen_->in_spilled_code());
+  cgen_->set_in_spilled_code(false);
+  GetValue(typeof_state);
+  cgen_->frame()->SpillAll();
+  cgen_->set_in_spilled_code(true);
+}
+
+
 void Reference::GetValue(TypeofState typeof_state) {
   ASSERT(!cgen_->in_spilled_code());
   ASSERT(cgen_->HasValidEntryRegisters());
index 29fe2d4..7c4b069 100644 (file)
 #ifndef V8_CODEGEN_ARM_H_
 #define V8_CODEGEN_ARM_H_
 
-#include "scopes.h"
-
 namespace v8 { namespace internal {
 
 // Forward declarations
 class DeferredCode;
+class RegisterAllocator;
+class RegisterFile;
 
 // Mode to overwrite BinaryExpression values.
 enum OverwriteMode { NO_OVERWRITE, OVERWRITE_LEFT, OVERWRITE_RIGHT };
@@ -220,27 +220,11 @@ class CodeGenerator: public AstVisitor {
   // reach the end of the statement (ie, it does not exit via break,
   // continue, return, or throw).  This function is used temporarily while
   // the code generator is being transformed.
-  void VisitAndSpill(Statement* statement) {
-    ASSERT(in_spilled_code());
-    set_in_spilled_code(false);
-    Visit(statement);
-    if (frame_ != NULL) {
-      frame_->SpillAll();
-    }
-    set_in_spilled_code(true);
-  }
+  void VisitAndSpill(Statement* statement);
 
   // Visit a list of statements and then spill the virtual frame if control
   // flow can reach the end of the list.
-  void VisitStatementsAndSpill(ZoneList<Statement*>* statements) {
-    ASSERT(in_spilled_code());
-    set_in_spilled_code(false);
-    VisitStatements(statements);
-    if (frame_ != NULL) {
-      frame_->SpillAll();
-    }
-    set_in_spilled_code(true);
-  }
+  void VisitStatementsAndSpill(ZoneList<Statement*>* statements);
 
   // Main code generation function
   void GenCode(FunctionLiteral* fun);
@@ -278,13 +262,7 @@ class CodeGenerator: public AstVisitor {
   // and then spill the frame fully to memory.  This function is used
   // temporarily while the code generator is being transformed.
   void LoadAndSpill(Expression* expression,
-                    TypeofState typeof_state = NOT_INSIDE_TYPEOF) {
-    ASSERT(in_spilled_code());
-    set_in_spilled_code(false);
-    Load(expression, typeof_state);
-    frame_->SpillAll();
-    set_in_spilled_code(true);
-  }
+                    TypeofState typeof_state = NOT_INSIDE_TYPEOF);
 
   // Call LoadCondition and then spill the virtual frame unless control flow
   // cannot reach the end of the expression (ie, by emitting only
@@ -293,16 +271,7 @@ class CodeGenerator: public AstVisitor {
                              TypeofState typeof_state,
                              JumpTarget* true_target,
                              JumpTarget* false_target,
-                             bool force_control) {
-    ASSERT(in_spilled_code());
-    set_in_spilled_code(false);
-    LoadCondition(expression, typeof_state, true_target, false_target,
-                  force_control);
-    if (frame_ != NULL) {
-      frame_->SpillAll();
-    }
-    set_in_spilled_code(true);
-  }
+                             bool force_control);
 
   // Read a value from a slot and leave it on top of the expression stack.
   void LoadFromSlot(Slot* slot, TypeofState typeof_state);
@@ -470,15 +439,6 @@ class CodeGenerator: public AstVisitor {
 };
 
 
-void Reference::GetValueAndSpill(TypeofState typeof_state) {
-  ASSERT(cgen_->in_spilled_code());
-  cgen_->set_in_spilled_code(false);
-  GetValue(typeof_state);
-  cgen_->frame()->SpillAll();
-  cgen_->set_in_spilled_code(true);
-}
-
-
 } }  // namespace v8::internal
 
 #endif  // V8_CODEGEN_ARM_H_
index 9cdec3b..7dd9e7f 100644 (file)
@@ -30,8 +30,9 @@
 #include "bootstrapper.h"
 #include "codegen-inl.h"
 #include "debug.h"
-#include "scopes.h"
 #include "runtime.h"
+#include "scopes.h"
+#include "virtual-frame.h"
 
 namespace v8 { namespace internal {
 
@@ -439,6 +440,16 @@ void CodeGenerator::LoadCondition(Expression* x,
 }
 
 
+void CodeGenerator::LoadAndSpill(Expression* expression,
+                                 TypeofState typeof_state) {
+  ASSERT(in_spilled_code());
+  set_in_spilled_code(false);
+  Load(expression, typeof_state);
+  frame_->SpillAll();
+  set_in_spilled_code(true);
+}
+
+
 void CodeGenerator::Load(Expression* x, TypeofState typeof_state) {
 #ifdef DEBUG
   int original_height = frame_->height();
@@ -1553,6 +1564,28 @@ void CodeGenerator::CheckStack() {
 }
 
 
+void CodeGenerator::VisitAndSpill(Statement* statement) {
+  ASSERT(in_spilled_code());
+  set_in_spilled_code(false);
+  Visit(statement);
+  if (frame_ != NULL) {
+    frame_->SpillAll();
+  }
+  set_in_spilled_code(true);
+}
+
+
+void CodeGenerator::VisitStatementsAndSpill(ZoneList<Statement*>* statements) {
+  ASSERT(in_spilled_code());
+  set_in_spilled_code(false);
+  VisitStatements(statements);
+  if (frame_ != NULL) {
+    frame_->SpillAll();
+  }
+  set_in_spilled_code(true);
+}
+
+
 void CodeGenerator::VisitStatements(ZoneList<Statement*>* statements) {
   ASSERT(!in_spilled_code());
   for (int i = 0; has_valid_frame() && i < statements->length(); i++) {
index dfa5978..a7e9b5e 100644 (file)
 #ifndef V8_CODEGEN_IA32_H_
 #define V8_CODEGEN_IA32_H_
 
-#include "scopes.h"
-#include "register-allocator.h"
-
 namespace v8 { namespace internal {
 
 // Forward declarations
 class DeferredCode;
+class RegisterAllocator;
+class RegisterFile;
 
 // Mode to overwrite BinaryExpression values.
 enum OverwriteMode { NO_OVERWRITE, OVERWRITE_LEFT, OVERWRITE_RIGHT };
@@ -82,11 +81,6 @@ class Reference BASE_EMBEDDED {
   // the expression stack, and it is left in place with its value above it.
   void GetValue(TypeofState typeof_state);
 
-  // Generate code to push the value of a reference on top of the expression
-  // stack and then spill the stack frame.  This function is used temporarily
-  // while the code generator is being transformed.
-  inline void GetValueAndSpill(TypeofState typeof_state);
-
   // Like GetValue except that the slot is expected to be written to before
   // being read from again.  Thae value of the reference may be invalidated,
   // causing subsequent attempts to read it to fail.
@@ -368,27 +362,11 @@ class CodeGenerator: public AstVisitor {
   // reach the end of the statement (ie, it does not exit via break,
   // continue, return, or throw).  This function is used temporarily while
   // the code generator is being transformed.
-  void VisitAndSpill(Statement* statement) {
-    ASSERT(in_spilled_code());
-    set_in_spilled_code(false);
-    Visit(statement);
-    if (frame_ != NULL) {
-      frame_->SpillAll();
-    }
-    set_in_spilled_code(true);
-  }
+  void VisitAndSpill(Statement* statement);
 
   // Visit a list of statements and then spill the virtual frame if control
   // flow can reach the end of the list.
-  void VisitStatementsAndSpill(ZoneList<Statement*>* statements) {
-    ASSERT(in_spilled_code());
-    set_in_spilled_code(false);
-    VisitStatements(statements);
-    if (frame_ != NULL) {
-      frame_->SpillAll();
-    }
-    set_in_spilled_code(true);
-  }
+  void VisitStatementsAndSpill(ZoneList<Statement*>* statements);
 
   // Main code generation function
   void GenCode(FunctionLiteral* fun);
@@ -430,29 +408,7 @@ class CodeGenerator: public AstVisitor {
   // and then spill the frame fully to memory.  This function is used
   // temporarily while the code generator is being transformed.
   void LoadAndSpill(Expression* expression,
-                    TypeofState typeof_state = NOT_INSIDE_TYPEOF) {
-    ASSERT(in_spilled_code());
-    set_in_spilled_code(false);
-    Load(expression, typeof_state);
-    frame_->SpillAll();
-    set_in_spilled_code(true);
-  }
-
-  // Call LoadCondition and then spill the virtual frame unless control flow
-  // cannot reach the end of the expression (ie, by emitting only
-  // unconditional jumps to the control targets).
-  void LoadConditionAndSpill(Expression* expression,
-                             TypeofState typeof_state,
-                             ControlDestination* destination,
-                             bool force_control) {
-    ASSERT(in_spilled_code());
-    set_in_spilled_code(false);
-    LoadCondition(expression, typeof_state, destination, force_control);
-    if (frame_ != NULL) {
-      frame_->SpillAll();
-    }
-    set_in_spilled_code(true);
-  }
+                    TypeofState typeof_state = NOT_INSIDE_TYPEOF);
 
   // Read a value from a slot and leave it on top of the expression stack.
   void LoadFromSlot(Slot* slot, TypeofState typeof_state);
@@ -644,15 +600,6 @@ class CodeGenerator: public AstVisitor {
 };
 
 
-void Reference::GetValueAndSpill(TypeofState typeof_state) {
-  ASSERT(cgen_->in_spilled_code());
-  cgen_->set_in_spilled_code(false);
-  GetValue(typeof_state);
-  cgen_->frame()->SpillAll();
-  cgen_->set_in_spilled_code(true);
-}
-
-
 } }  // namespace v8::internal
 
 #endif  // V8_CODEGEN_IA32_H_
index c6abbec..c42f5ac 100644 (file)
@@ -31,7 +31,6 @@
 
 #include "codegen.h"
 
-
 namespace v8 { namespace internal {
 
 
index 0e623ac..13014d0 100644 (file)
 #include "codegen-inl.h"
 #include "debug.h"
 #include "prettyprinter.h"
-#include "scopeinfo.h"
 #include "runtime.h"
+#include "scopeinfo.h"
 #include "stub-cache.h"
+#include "virtual-frame.h"
 
 namespace v8 { namespace internal {
 
index f889d25..282bebf 100644 (file)
@@ -28,7 +28,7 @@
 #include "v8.h"
 
 #include "codegen.h"
-#include "jump-target.h"
+#include "virtual-frame.h"
 
 namespace v8 { namespace internal {
 
index 7c3ece1..8f89f05 100644 (file)
@@ -28,7 +28,7 @@
 #include "v8.h"
 
 #include "codegen.h"
-#include "jump-target.h"
+#include "virtual-frame.h"
 
 namespace v8 { namespace internal {
 
index 6cee057..0974efb 100644 (file)
@@ -28,7 +28,7 @@
 #include "v8.h"
 
 #include "codegen.h"
-#include "jump-target.h"
+#include "virtual-frame.h"
 
 namespace v8 { namespace internal {
 
index 1c1a818..3a57302 100644 (file)
 #ifndef V8_JUMP_TARGET_H_
 #define V8_JUMP_TARGET_H_
 
-#include "virtual-frame.h"
-
 namespace v8 { namespace internal {
 
+// Forward declarations.
+class FrameElement;
+class Result;
+class VirtualFrame;
+
+
 // -------------------------------------------------------------------------
 // Jump targets
 //
index 6149187..5b784f3 100644 (file)
@@ -28,7 +28,7 @@
 #include "v8.h"
 
 #include "codegen.h"
-#include "register-allocator.h"
+#include "virtual-frame.h"
 
 namespace v8 { namespace internal {
 
index b702af4..2d410c2 100644 (file)
@@ -28,7 +28,7 @@
 #include "v8.h"
 
 #include "codegen.h"
-#include "register-allocator.h"
+#include "virtual-frame.h"
 
 namespace v8 { namespace internal {
 
index d375638..b79ee00 100644 (file)
@@ -27,8 +27,8 @@
 
 #include "v8.h"
 
-#include "codegen.h"
 #include "codegen-inl.h"
+#include "scopes.h"
 #include "virtual-frame.h"
 
 namespace v8 { namespace internal {
index 157ea1a..fc1d7cb 100644 (file)
@@ -28,6 +28,8 @@
 #ifndef V8_VIRTUAL_FRAME_ARM_H_
 #define V8_VIRTUAL_FRAME_ARM_H_
 
+#include "register-allocator.h"
+
 namespace v8 { namespace internal {
 
 // -------------------------------------------------------------------------
index 2a5c416..ad956f3 100644 (file)
@@ -27,8 +27,8 @@
 
 #include "v8.h"
 
-#include "codegen.h"
 #include "codegen-inl.h"
+#include "scopes.h"
 #include "virtual-frame.h"
 
 namespace v8 { namespace internal {
index ac1081a..98de6a2 100644 (file)
@@ -28,6 +28,8 @@
 #ifndef V8_VIRTUAL_FRAME_IA32_H_
 #define V8_VIRTUAL_FRAME_IA32_H_
 
+#include "register-allocator.h"
+
 namespace v8 { namespace internal {
 
 // -------------------------------------------------------------------------
index 71f21c3..6c33e62 100644 (file)
@@ -29,7 +29,6 @@
 #define V8_VIRTUAL_FRAME_H_
 
 #include "macro-assembler.h"
-#include "register-allocator.h"
 
 namespace v8 { namespace internal {