Commit 02fc74ea authored by titzer's avatar titzer Committed by Commit bot

Reduce the number of #includes of compiler.h.

R=mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#26589}
parent 4c345754
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "src/accessors.h" #include "src/accessors.h"
#include "src/api.h" #include "src/api.h"
#include "src/compiler.h"
#include "src/contexts.h" #include "src/contexts.h"
#include "src/deoptimizer.h" #include "src/deoptimizer.h"
#include "src/execution.h" #include "src/execution.h"
......
...@@ -5,11 +5,8 @@ ...@@ -5,11 +5,8 @@
#ifndef V8_DATAFLOW_H_ #ifndef V8_DATAFLOW_H_
#define V8_DATAFLOW_H_ #define V8_DATAFLOW_H_
#include "src/v8.h"
#include "src/allocation.h" #include "src/allocation.h"
#include "src/ast.h" #include "src/zone.h"
#include "src/compiler.h"
namespace v8 { namespace v8 {
namespace internal { namespace internal {
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "src/compiler/js-context-specialization.h" #include "src/compiler/js-context-specialization.h"
#include "src/compiler.h"
#include "src/compiler/common-operator.h" #include "src/compiler/common-operator.h"
#include "src/compiler/js-operator.h" #include "src/compiler/js-operator.h"
#include "src/compiler/node-matchers.h" #include "src/compiler/node-matchers.h"
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
#include "src/compiler/js-graph.h" #include "src/compiler/js-graph.h"
#include "src/contexts.h" #include "src/contexts.h"
#include "src/compiler.h"
namespace v8 { namespace v8 {
namespace internal { namespace internal {
namespace compiler { namespace compiler {
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include "src/compiler/frame.h" #include "src/compiler/frame.h"
#include "src/compiler/machine-type.h" #include "src/compiler/machine-type.h"
#include "src/compiler/operator.h" #include "src/compiler/operator.h"
#include "src/frames.h"
#include "src/runtime/runtime.h"
#include "src/zone.h" #include "src/zone.h"
namespace v8 { namespace v8 {
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <iosfwd> #include <iosfwd>
#include "src/compiler.h"
#include "src/hydrogen.h" #include "src/hydrogen.h"
#include "src/hydrogen-instructions.h" #include "src/hydrogen-instructions.h"
#include "src/zone.h" #include "src/zone.h"
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <deque> #include <deque>
#include "src/assembler.h"
#include "src/isolate.h" #include "src/isolate.h"
#include "src/serialize.h" #include "src/serialize.h"
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "src/base/platform/platform.h" #include "src/base/platform/platform.h"
#include "src/bootstrapper.h" #include "src/bootstrapper.h"
#include "src/code-stubs.h" #include "src/code-stubs.h"
#include "src/compiler.h"
#include "src/deoptimizer.h" #include "src/deoptimizer.h"
#include "src/execution.h" #include "src/execution.h"
#include "src/global-handles.h" #include "src/global-handles.h"
...@@ -2651,4 +2652,19 @@ Vector<const uint32_t> SerializedCodeData::CodeStubKeys() const { ...@@ -2651,4 +2652,19 @@ Vector<const uint32_t> SerializedCodeData::CodeStubKeys() const {
return Vector<const uint32_t>(reinterpret_cast<const uint32_t*>(start), return Vector<const uint32_t>(reinterpret_cast<const uint32_t*>(start),
GetHeaderValue(kNumCodeStubKeysOffset)); 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 } } // namespace v8::internal
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#ifndef V8_SERIALIZE_H_ #ifndef V8_SERIALIZE_H_
#define V8_SERIALIZE_H_ #define V8_SERIALIZE_H_
#include "src/compiler.h"
#include "src/hashmap.h" #include "src/hashmap.h"
#include "src/heap-profiler.h" #include "src/heap-profiler.h"
#include "src/isolate.h" #include "src/isolate.h"
...@@ -14,6 +13,8 @@ ...@@ -14,6 +13,8 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
class ScriptData;
// A TypeCode is used to distinguish different kinds of external reference. // A TypeCode is used to distinguish different kinds of external reference.
// It is a single bit to make testing for types easy. // It is a single bit to make testing for types easy.
enum TypeCode { enum TypeCode {
...@@ -931,14 +932,7 @@ class SerializedCodeData : public SerializedData { ...@@ -931,14 +932,7 @@ class SerializedCodeData : public SerializedData {
public: public:
// Used when consuming. // Used when consuming.
static SerializedCodeData* FromCachedData(ScriptData* cached_data, static SerializedCodeData* FromCachedData(ScriptData* cached_data,
String* source) { String* source);
DisallowHeapAllocation no_gc;
SerializedCodeData* scd = new SerializedCodeData(cached_data);
if (scd->IsSane(source)) return scd;
cached_data->Reject();
delete scd;
return NULL;
}
// Used when producing. // Used when producing.
SerializedCodeData(const List<byte>& payload, const CodeSerializer& cs); SerializedCodeData(const List<byte>& payload, const CodeSerializer& cs);
...@@ -953,8 +947,7 @@ class SerializedCodeData : public SerializedData { ...@@ -953,8 +947,7 @@ class SerializedCodeData : public SerializedData {
Vector<const uint32_t> CodeStubKeys() const; Vector<const uint32_t> CodeStubKeys() const;
private: private:
explicit SerializedCodeData(ScriptData* data) explicit SerializedCodeData(ScriptData* data);
: SerializedData(const_cast<byte*>(data->data()), data->length()) {}
bool IsSane(String* source) const; bool IsSane(String* source) const;
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "src/allocation.h" #include "src/allocation.h"
#include "src/ast.h" #include "src/ast.h"
#include "src/compiler.h"
#include "src/effects.h" #include "src/effects.h"
#include "src/scopes.h" #include "src/scopes.h"
#include "src/type-info.h" #include "src/type-info.h"
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <deque> #include <deque>
#include "src/assembler.h"
#include "src/serialize.h" #include "src/serialize.h"
namespace v8 { namespace v8 {
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#ifndef V8_X87_ASSEMBLER_X87_H_ #ifndef V8_X87_ASSEMBLER_X87_H_
#define V8_X87_ASSEMBLER_X87_H_ #define V8_X87_ASSEMBLER_X87_H_
#include "src/assembler.h"
#include "src/isolate.h" #include "src/isolate.h"
#include "src/serialize.h" #include "src/serialize.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment