From 3817a7ba6e5ba9fb03ab053781b6d471f75bad95 Mon Sep 17 00:00:00 2001 From: "kmillikin@chromium.org" Date: Tue, 9 Mar 2010 06:38:33 +0000 Subject: [PATCH] Small simplification of #include dependencies. Remove messages.h from v8.h and include it explicitly in only the few places it is needed. Many files relied on getting handles-inl.h implicitly from messages.h through v8.h, so include handles-inl.h explicitly in v8.h instead. Remove zone-inl.h from header files where it is not needed, can be replaced by a forward declaration, or can be replaced by zone.h (specifically, factory.h and heap.h). Include zone.h or zone-inl.h in header files where it was implicitly included via heap.h or factory.h. Prefer zone.h over zone-inl.h in header files where possible by including zone-inl.h in .cc files. Review URL: http://codereview.chromium.org/668248 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4058 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- SConstruct | 4 ++-- src/accessors.cc | 1 - src/api.cc | 2 ++ src/assembler.h | 1 - src/debug.cc | 1 + src/factory.h | 3 ++- src/frame-element.cc | 1 + src/frame-element.h | 1 + src/frames.cc | 1 - src/heap-profiler.cc | 1 + src/heap-profiler.h | 2 ++ src/heap.h | 6 ++++-- src/jsregexp.h | 1 + src/jump-target.h | 1 + src/messages.cc | 1 + src/parser.cc | 1 + src/scopeinfo.h | 1 + src/top.cc | 1 + src/v8.h | 2 +- 19 files changed, 23 insertions(+), 9 deletions(-) diff --git a/SConstruct b/SConstruct index d54c29b74..f7638e0b2 100644 --- a/SConstruct +++ b/SConstruct @@ -46,8 +46,8 @@ if ANDROID_TOP is None: # on linux we need these compiler flags to avoid crashes in the v8 test suite # and avoid dtoa.c strict aliasing issues if os.environ.get('GCC_VERSION') == '44': - GCC_EXTRA_CCFLAGS = ['-fno-tree-vrp'] - GCC_DTOA_EXTRA_CCFLAGS = ['-fno-strict-aliasing'] + GCC_EXTRA_CCFLAGS = ['-fno-tree-vrp', '-fno-strict-aliasing'] + GCC_DTOA_EXTRA_CCFLAGS = [] else: GCC_EXTRA_CCFLAGS = [] GCC_DTOA_EXTRA_CCFLAGS = [] diff --git a/src/accessors.cc b/src/accessors.cc index b05719edb..e41db9473 100644 --- a/src/accessors.cc +++ b/src/accessors.cc @@ -32,7 +32,6 @@ #include "factory.h" #include "scopeinfo.h" #include "top.h" -#include "zone-inl.h" namespace v8 { namespace internal { diff --git a/src/api.cc b/src/api.cc index 14b518cad..93fce79bd 100644 --- a/src/api.cc +++ b/src/api.cc @@ -34,9 +34,11 @@ #include "debug.h" #include "execution.h" #include "global-handles.h" +#include "messages.h" #include "platform.h" #include "serialize.h" #include "snapshot.h" +#include "top.h" #include "utils.h" #include "v8threads.h" #include "version.h" diff --git a/src/assembler.h b/src/assembler.h index 004ede358..cde7d6924 100644 --- a/src/assembler.h +++ b/src/assembler.h @@ -37,7 +37,6 @@ #include "runtime.h" #include "top.h" -#include "zone-inl.h" #include "token.h" namespace v8 { diff --git a/src/debug.cc b/src/debug.cc index b7394987b..959bea14d 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -39,6 +39,7 @@ #include "global-handles.h" #include "ic.h" #include "ic-inl.h" +#include "messages.h" #include "natives.h" #include "stub-cache.h" #include "log.h" diff --git a/src/factory.h b/src/factory.h index 2a347cd6f..36911da24 100644 --- a/src/factory.h +++ b/src/factory.h @@ -30,11 +30,12 @@ #include "globals.h" #include "heap.h" -#include "zone-inl.h" namespace v8 { namespace internal { +// Forward declarations. +class ZoneScopeInfo; // Interface for handle based allocation. diff --git a/src/frame-element.cc b/src/frame-element.cc index 14555596a..ee7be95f1 100644 --- a/src/frame-element.cc +++ b/src/frame-element.cc @@ -28,6 +28,7 @@ #include "v8.h" #include "frame-element.h" +#include "zone-inl.h" namespace v8 { namespace internal { diff --git a/src/frame-element.h b/src/frame-element.h index af53b17b2..3c5a38952 100644 --- a/src/frame-element.h +++ b/src/frame-element.h @@ -30,6 +30,7 @@ #include "number-info.h" #include "macro-assembler.h" +#include "zone.h" namespace v8 { namespace internal { diff --git a/src/frames.cc b/src/frames.cc index 5d88265c7..3bf4c93e3 100644 --- a/src/frames.cc +++ b/src/frames.cc @@ -32,7 +32,6 @@ #include "scopeinfo.h" #include "string-stream.h" #include "top.h" -#include "zone-inl.h" namespace v8 { namespace internal { diff --git a/src/heap-profiler.cc b/src/heap-profiler.cc index 3cb65eeec..90544f117 100644 --- a/src/heap-profiler.cc +++ b/src/heap-profiler.cc @@ -31,6 +31,7 @@ #include "frames-inl.h" #include "global-handles.h" #include "string-stream.h" +#include "zone-inl.h" namespace v8 { namespace internal { diff --git a/src/heap-profiler.h b/src/heap-profiler.h index c615942bf..d6f26505c 100644 --- a/src/heap-profiler.h +++ b/src/heap-profiler.h @@ -28,6 +28,8 @@ #ifndef V8_HEAP_PROFILER_H_ #define V8_HEAP_PROFILER_H_ +#include "zone.h" + namespace v8 { namespace internal { diff --git a/src/heap.h b/src/heap.h index 5cb896c59..39ce9c552 100644 --- a/src/heap.h +++ b/src/heap.h @@ -31,12 +31,14 @@ #include #include "splay-tree-inl.h" -#include "zone-inl.h" - +#include "v8-counters.h" namespace v8 { namespace internal { +// Forward declarations. +class ZoneScopeInfo; + // Defines all the roots in Heap. #define UNCONDITIONAL_STRONG_ROOT_LIST(V) \ /* Put the byte array map early. We need it to be in place by the time */ \ diff --git a/src/jsregexp.h b/src/jsregexp.h index b99a89e1b..aaab746be 100644 --- a/src/jsregexp.h +++ b/src/jsregexp.h @@ -29,6 +29,7 @@ #define V8_JSREGEXP_H_ #include "macro-assembler.h" +#include "zone.h" namespace v8 { namespace internal { diff --git a/src/jump-target.h b/src/jump-target.h index dd291c6b3..db7c11553 100644 --- a/src/jump-target.h +++ b/src/jump-target.h @@ -29,6 +29,7 @@ #define V8_JUMP_TARGET_H_ #include "macro-assembler.h" +#include "zone-inl.h" namespace v8 { namespace internal { diff --git a/src/messages.cc b/src/messages.cc index e16b1b249..7cb1d2022 100644 --- a/src/messages.cc +++ b/src/messages.cc @@ -30,6 +30,7 @@ #include "api.h" #include "execution.h" +#include "messages.h" #include "spaces-inl.h" #include "top.h" diff --git a/src/parser.cc b/src/parser.cc index 7906a7a1c..dd7266907 100644 --- a/src/parser.cc +++ b/src/parser.cc @@ -31,6 +31,7 @@ #include "ast.h" #include "bootstrapper.h" #include "compiler.h" +#include "messages.h" #include "platform.h" #include "runtime.h" #include "parser.h" diff --git a/src/scopeinfo.h b/src/scopeinfo.h index 28d169a39..927ac66fc 100644 --- a/src/scopeinfo.h +++ b/src/scopeinfo.h @@ -29,6 +29,7 @@ #define V8_SCOPEINFO_H_ #include "variables.h" +#include "zone-inl.h" namespace v8 { namespace internal { diff --git a/src/top.cc b/src/top.cc index b9db4be52..7c8a1c96e 100644 --- a/src/top.cc +++ b/src/top.cc @@ -31,6 +31,7 @@ #include "bootstrapper.h" #include "debug.h" #include "execution.h" +#include "messages.h" #include "platform.h" #include "simulator.h" #include "string-stream.h" diff --git a/src/v8.h b/src/v8.h index b3624c5d5..d58f30f3d 100644 --- a/src/v8.h +++ b/src/v8.h @@ -67,7 +67,7 @@ #include "spaces-inl.h" #include "heap-inl.h" #include "log-inl.h" -#include "messages.h" +#include "handles-inl.h" namespace v8 { namespace internal { -- 2.34.1