Reduce the number of #includes of compiler.h.
authortitzer <titzer@chromium.org>
Wed, 11 Feb 2015 15:49:02 +0000 (07:49 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 11 Feb 2015 15:49:17 +0000 (15:49 +0000)
R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/917583004

Cr-Commit-Position: refs/heads/master@{#26589}

12 files changed:
src/accessors.cc
src/bit-vector.h
src/compiler/js-context-specialization.cc
src/compiler/js-context-specialization.h
src/compiler/linkage.h
src/hydrogen-gvn.h
src/ia32/assembler-ia32.h
src/serialize.cc
src/serialize.h
src/typing.h
src/x64/assembler-x64.h
src/x87/assembler-x87.h

index 0e6a083910e01e5f5a089334b25b8546348805d3..02b96ca6ae696a26b1bbb0c63c07a2772e5aa022 100644 (file)
@@ -6,7 +6,6 @@
 
 #include "src/accessors.h"
 #include "src/api.h"
-#include "src/compiler.h"
 #include "src/contexts.h"
 #include "src/deoptimizer.h"
 #include "src/execution.h"
index 9e1ce81db9047b921279d0b3da319b1a11a898fd..eeda0e91cb1501a40b3ee80edf5d32ab90d33113 100644 (file)
@@ -5,11 +5,8 @@
 #ifndef V8_DATAFLOW_H_
 #define V8_DATAFLOW_H_
 
-#include "src/v8.h"
-
 #include "src/allocation.h"
-#include "src/ast.h"
-#include "src/compiler.h"
+#include "src/zone.h"
 
 namespace v8 {
 namespace internal {
index 4416878de801dbfe4431e920388f8ca4c7742ebd..ffc8f1cfed5bf2abaaa160f3113d7a9d97c52d85 100644 (file)
@@ -4,7 +4,6 @@
 
 #include "src/compiler/js-context-specialization.h"
 
-#include "src/compiler.h"
 #include "src/compiler/common-operator.h"
 #include "src/compiler/js-operator.h"
 #include "src/compiler/node-matchers.h"
index 520a3cf80b9e60db4c2a4f5ed1c731032e74eeac..c524eb7b560f36da73d2920ed917f5d33a3094e4 100644 (file)
@@ -9,8 +9,6 @@
 #include "src/compiler/js-graph.h"
 #include "src/contexts.h"
 
-#include "src/compiler.h"
-
 namespace v8 {
 namespace internal {
 namespace compiler {
index 5455b2ee69fe2f7d9953516c3dfbf08040afb26e..a3bdbf9d5bc84671a8441f1ca80c7a5c6c728c9f 100644 (file)
@@ -9,6 +9,8 @@
 #include "src/compiler/frame.h"
 #include "src/compiler/machine-type.h"
 #include "src/compiler/operator.h"
+#include "src/frames.h"
+#include "src/runtime/runtime.h"
 #include "src/zone.h"
 
 namespace v8 {
index 421c6cc103b8d76eade880204367eba0e3c4e3d0..d04a6eb3aa6029b2c32e121be5f413d1f0feeaea 100644 (file)
@@ -7,7 +7,6 @@
 
 #include <iosfwd>
 
-#include "src/compiler.h"
 #include "src/hydrogen.h"
 #include "src/hydrogen-instructions.h"
 #include "src/zone.h"
index 71d894d8708730dfd353ae09195fa2ba49934838..d556e1bcada187df0e5f60ba7fa672423eb09c88 100644 (file)
@@ -39,6 +39,7 @@
 
 #include <deque>
 
+#include "src/assembler.h"
 #include "src/isolate.h"
 #include "src/serialize.h"
 
index b7277b5da563927fcd755ab97f7104feca1106e0..93882cbf0a9ba24b740eae0d87a9e7447d768658 100644 (file)
@@ -9,6 +9,7 @@
 #include "src/base/platform/platform.h"
 #include "src/bootstrapper.h"
 #include "src/code-stubs.h"
+#include "src/compiler.h"
 #include "src/deoptimizer.h"
 #include "src/execution.h"
 #include "src/global-handles.h"
@@ -2651,4 +2652,19 @@ Vector<const uint32_t> SerializedCodeData::CodeStubKeys() const {
   return Vector<const uint32_t>(reinterpret_cast<const uint32_t*>(start),
                                 GetHeaderValue(kNumCodeStubKeysOffset));
 }
+
+
+SerializedCodeData::SerializedCodeData(ScriptData* data)
+    : SerializedData(const_cast<byte*>(data->data()), data->length()) {}
+
+
+SerializedCodeData* SerializedCodeData::FromCachedData(ScriptData* cached_data,
+                                                       String* source) {
+  DisallowHeapAllocation no_gc;
+  SerializedCodeData* scd = new SerializedCodeData(cached_data);
+  if (scd->IsSane(source)) return scd;
+  cached_data->Reject();
+  delete scd;
+  return NULL;
+}
 } }  // namespace v8::internal
index 2b7f2ade9d79f6bbd02444feb0a40b4424cd4cec..ede57df5cc05d2015eb0b321199f33186851fdee 100644 (file)
@@ -5,7 +5,6 @@
 #ifndef V8_SERIALIZE_H_
 #define V8_SERIALIZE_H_
 
-#include "src/compiler.h"
 #include "src/hashmap.h"
 #include "src/heap-profiler.h"
 #include "src/isolate.h"
@@ -14,6 +13,8 @@
 namespace v8 {
 namespace internal {
 
+class ScriptData;
+
 // A TypeCode is used to distinguish different kinds of external reference.
 // It is a single bit to make testing for types easy.
 enum TypeCode {
@@ -931,14 +932,7 @@ class SerializedCodeData : public SerializedData {
  public:
   // Used when consuming.
   static SerializedCodeData* FromCachedData(ScriptData* cached_data,
-                                            String* source) {
-    DisallowHeapAllocation no_gc;
-    SerializedCodeData* scd = new SerializedCodeData(cached_data);
-    if (scd->IsSane(source)) return scd;
-    cached_data->Reject();
-    delete scd;
-    return NULL;
-  }
+                                            String* source);
 
   // Used when producing.
   SerializedCodeData(const List<byte>& payload, const CodeSerializer& cs);
@@ -953,8 +947,7 @@ class SerializedCodeData : public SerializedData {
   Vector<const uint32_t> CodeStubKeys() const;
 
  private:
-  explicit SerializedCodeData(ScriptData* data)
-      : SerializedData(const_cast<byte*>(data->data()), data->length()) {}
+  explicit SerializedCodeData(ScriptData* data);
 
   bool IsSane(String* source) const;
 
index b56c878ba8fc918601f8b52be7d78e093672884e..0ca92f3a42343b8549964350ae5251f30bf17225 100644 (file)
@@ -9,7 +9,6 @@
 
 #include "src/allocation.h"
 #include "src/ast.h"
-#include "src/compiler.h"
 #include "src/effects.h"
 #include "src/scopes.h"
 #include "src/type-info.h"
index 330daf6490cec148186c7089d0dc3d66d602b35c..126de7aaae80a2d0256457f99705aa3078d98151 100644 (file)
@@ -39,6 +39,7 @@
 
 #include <deque>
 
+#include "src/assembler.h"
 #include "src/serialize.h"
 
 namespace v8 {
index 94c814f493960a421a57a0cccef37c811775961e..fef6927b80d990b9a65748031963ad9c9f76df9e 100644 (file)
@@ -37,6 +37,7 @@
 #ifndef V8_X87_ASSEMBLER_X87_H_
 #define V8_X87_ASSEMBLER_X87_H_
 
+#include "src/assembler.h"
 #include "src/isolate.h"
 #include "src/serialize.h"