Commit 58109a2c authored by mstarzinger's avatar mstarzinger Committed by Commit bot

Remove several grab-bag includes from the v8.h header.

This is the first step of turning the v8.h file into a normal header
instead of an include-the-world header. The new rule is that no other
header files are allowed to include v8.h, which is enforced by DEPS.

Also the number of includes inside the v8.h file has been drastically
reduced. Basically the last missing piece is the inclusion of the big
objects-inl.h file.

This in turn makes many headers follow the IWYU principle.

R=bmeurer@chromium.org,hpayer@chromium.org,titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#30102}
parent 31a3f68d
......@@ -13,6 +13,12 @@ include_rules = [
]
specific_include_rules = {
".*\.h": [
# Note that src/v8.h is the top header for some .cc files, it shouldn't be
# included in any .h files though. In the long run we should make src/v8.h
# act like any normal header file, instead of a grab-bag include.
"-src/v8.h",
],
"d8\.cc": [
"+include/libplatform/libplatform.h",
],
......
......@@ -5,8 +5,11 @@
#ifndef V8_ACCESSORS_H_
#define V8_ACCESSORS_H_
#include "include/v8.h"
#include "src/allocation.h"
#include "src/globals.h"
#include "src/handles.h"
#include "src/property-details.h"
namespace v8 {
namespace internal {
......
......@@ -50,6 +50,7 @@
#include "src/snapshot/natives.h"
#include "src/snapshot/snapshot.h"
#include "src/unicode-inl.h"
#include "src/v8.h"
#include "src/v8threads.h"
#include "src/version.h"
#include "src/vm-state-inl.h"
......
......@@ -5,13 +5,12 @@
#ifndef V8_API_H_
#define V8_API_H_
#include "src/v8.h"
#include "include/v8-testing.h"
#include "src/contexts.h"
#include "src/factory.h"
#include "src/isolate.h"
#include "src/list-inl.h"
#include "src/objects-inl.h"
namespace v8 {
......
......@@ -5,8 +5,6 @@
#ifndef V8_ARM_LITHIUM_GAP_RESOLVER_ARM_H_
#define V8_ARM_LITHIUM_GAP_RESOLVER_ARM_H_
#include "src/v8.h"
#include "src/lithium.h"
namespace v8 {
......
......@@ -5,6 +5,8 @@
#ifndef V8_ARM64_CONSTANTS_ARM64_H_
#define V8_ARM64_CONSTANTS_ARM64_H_
#include "src/base/macros.h"
#include "src/globals.h"
// Assert that this is an LP64 system.
STATIC_ASSERT(sizeof(int) == sizeof(int32_t)); // NOLINT(runtime/sizeof)
......
......@@ -5,8 +5,6 @@
#ifndef V8_ARM64_DISASM_ARM64_H
#define V8_ARM64_DISASM_ARM64_H
#include "src/v8.h"
#include "src/arm64/decoder-arm64.h"
#include "src/arm64/instructions-arm64.h"
#include "src/globals.h"
......
......@@ -5,8 +5,6 @@
#ifndef V8_ARM64_LITHIUM_GAP_RESOLVER_ARM64_H_
#define V8_ARM64_LITHIUM_GAP_RESOLVER_ARM64_H_
#include "src/v8.h"
#include "src/arm64/delayed-masm-arm64.h"
#include "src/lithium.h"
......
......@@ -8,8 +8,6 @@
#include <stdarg.h>
#include <vector>
#include "src/v8.h"
#include "src/allocation.h"
#include "src/arm64/assembler-arm64.h"
#include "src/arm64/decoder-arm64.h"
......
......@@ -6,7 +6,6 @@
#define V8_ARM64_UTILS_ARM64_H_
#include <cmath>
#include "src/v8.h"
#include "src/arm64/constants-arm64.h"
......
......@@ -35,12 +35,10 @@
#ifndef V8_ASSEMBLER_H_
#define V8_ASSEMBLER_H_
#include "src/v8.h"
#include "src/allocation.h"
#include "src/builtins.h"
#include "src/gdb-jit.h"
#include "src/isolate.h"
#include "src/objects-inl.h"
#include "src/runtime/runtime.h"
#include "src/token.h"
......
......@@ -5,8 +5,6 @@
#ifndef V8_AST_LITERAL_REINDEXER
#define V8_AST_LITERAL_REINDEXER
#include "src/v8.h"
#include "src/ast.h"
#include "src/scopes.h"
......
......@@ -5,8 +5,6 @@
#ifndef V8_AST_H_
#define V8_AST_H_
#include "src/v8.h"
#include "src/assembler.h"
#include "src/ast-value-factory.h"
#include "src/bailout-reason.h"
......
......@@ -8,8 +8,9 @@
#include <iosfwd>
#include <list>
#include <string>
#include <vector>
#include "src/v8.h"
#include "src/base/macros.h"
namespace v8 {
namespace internal {
......
......@@ -19,6 +19,7 @@
#include "src/gdb-jit.h"
#include "src/hydrogen.h"
#include "src/lithium.h"
#include "src/log-inl.h"
#include "src/messages.h"
#include "src/parser.h"
#include "src/prettyprinter.h"
......
......@@ -5,6 +5,7 @@
#ifndef V8_COMPILER_BASIC_BLOCK_INSTRUMENTOR_H_
#define V8_COMPILER_BASIC_BLOCK_INSTRUMENTOR_H_
#include "src/allocation.h"
#include "src/basic-block-profiler.h"
namespace v8 {
......
......@@ -9,7 +9,7 @@
#include "src/allocation.h"
#include "src/hashmap.h"
#include "src/list.h"
#include "src/v8.h"
#include "src/objects-inl.h"
#else
#include "include/v8.h"
#include "src/base/compiler-specific.h"
......
......@@ -5,8 +5,6 @@
#ifndef V8_DEOPTIMIZER_H_
#define V8_DEOPTIMIZER_H_
#include "src/v8.h"
#include "src/allocation.h"
#include "src/macro-assembler.h"
......
......@@ -5,8 +5,6 @@
#ifndef V8_EFFECTS_H_
#define V8_EFFECTS_H_
#include "src/v8.h"
#include "src/types.h"
namespace v8 {
......
......@@ -5,8 +5,6 @@
#ifndef V8_EXPRESSION_CLASSIFIER_H
#define V8_EXPRESSION_CLASSIFIER_H
#include "src/v8.h"
#include "src/messages.h"
#include "src/scanner.h"
#include "src/token.h"
......
......@@ -4,6 +4,10 @@
#include "src/extensions/externalize-string-extension.h"
#include "src/api.h"
#include "src/handles.h"
#include "src/isolate.h"
namespace v8 {
namespace internal {
......
......@@ -5,7 +5,7 @@
#ifndef V8_EXTENSIONS_EXTERNALIZE_STRING_EXTENSION_H_
#define V8_EXTENSIONS_EXTERNALIZE_STRING_EXTENSION_H_
#include "src/v8.h"
#include "include/v8.h"
namespace v8 {
namespace internal {
......
......@@ -5,7 +5,7 @@
#ifndef V8_EXTENSIONS_FREE_BUFFER_EXTENSION_H_
#define V8_EXTENSIONS_FREE_BUFFER_EXTENSION_H_
#include "src/v8.h"
#include "include/v8.h"
namespace v8 {
namespace internal {
......
......@@ -5,7 +5,8 @@
#ifndef V8_EXTENSIONS_GC_EXTENSION_H_
#define V8_EXTENSIONS_GC_EXTENSION_H_
#include "src/v8.h"
#include "include/v8.h"
#include "src/utils.h"
namespace v8 {
namespace internal {
......
......@@ -4,6 +4,8 @@
#include "src/extensions/statistics-extension.h"
#include "src/v8.h"
namespace v8 {
namespace internal {
......
......@@ -5,7 +5,7 @@
#ifndef V8_EXTENSIONS_STATISTICS_EXTENSION_H_
#define V8_EXTENSIONS_STATISTICS_EXTENSION_H_
#include "src/v8.h"
#include "include/v8.h"
namespace v8 {
namespace internal {
......
......@@ -5,7 +5,7 @@
#ifndef V8_EXTENSIONS_TRIGGER_FAILURE_EXTENSION_H_
#define V8_EXTENSIONS_TRIGGER_FAILURE_EXTENSION_H_
#include "src/v8.h"
#include "include/v8.h"
namespace v8 {
namespace internal {
......
......@@ -5,8 +5,6 @@
#ifndef V8_FULL_CODEGEN_FULL_CODEGEN_H_
#define V8_FULL_CODEGEN_FULL_CODEGEN_H_
#include "src/v8.h"
#include "src/allocation.h"
#include "src/assert-scope.h"
#include "src/ast.h"
......
......@@ -5,7 +5,7 @@
#ifndef V8_GDB_JIT_H_
#define V8_GDB_JIT_H_
#include "src/v8.h"
#include "include/v8.h"
//
// GDB has two ways of interacting with JIT code. With the "JIT compilation
......
......@@ -515,6 +515,8 @@ enum VisitMode {
// Flag indicating whether code is built into the VM (one of the natives files).
enum NativesFlag { NOT_NATIVES_CODE, NATIVES_CODE };
// JavaScript defines two kinds of 'nil'.
enum NilValue { kNullValue, kUndefinedValue };
// ParseRestriction is used to restrict the set of valid statements in a
// unit of compilation. Restriction violations cause a syntax error.
......
......@@ -8,8 +8,6 @@
#include <cstring>
#include <iosfwd>
#include "src/v8.h"
#include "src/allocation.h"
#include "src/base/bits.h"
#include "src/bit-vector.h"
......
......@@ -5,8 +5,6 @@
#ifndef V8_HYDROGEN_H_
#define V8_HYDROGEN_H_
#include "src/v8.h"
#include "src/accessors.h"
#include "src/allocation.h"
#include "src/ast.h"
......
......@@ -5,6 +5,9 @@
#include "src/i18n.h"
#include "src/api.h"
#include "src/factory.h"
#include "src/isolate.h"
#include "unicode/brkiter.h"
#include "unicode/calendar.h"
#include "unicode/coll.h"
......
......@@ -6,7 +6,7 @@
#ifndef V8_I18N_H_
#define V8_I18N_H_
#include "src/v8.h"
#include "src/handles.h"
#include "unicode/uversion.h"
namespace U_ICU_NAMESPACE {
......
......@@ -5,8 +5,6 @@
#ifndef V8_IA32_LITHIUM_GAP_RESOLVER_IA32_H_
#define V8_IA32_LITHIUM_GAP_RESOLVER_IA32_H_
#include "src/v8.h"
#include "src/lithium.h"
namespace v8 {
......
......@@ -5,8 +5,6 @@
#ifndef V8_JSON_PARSER_H_
#define V8_JSON_PARSER_H_
#include "src/v8.h"
#include "src/char-predicates-inl.h"
#include "src/conversions.h"
#include "src/messages.h"
......
......@@ -5,8 +5,6 @@
#ifndef V8_JSON_STRINGIFIER_H_
#define V8_JSON_STRINGIFIER_H_
#include "src/v8.h"
#include "src/conversions.h"
#include "src/messages.h"
#include "src/string-builder.h"
......
......@@ -5,8 +5,6 @@
#ifndef V8_LITHIUM_ALLOCATOR_H_
#define V8_LITHIUM_ALLOCATOR_H_
#include "src/v8.h"
#include "src/allocation.h"
#include "src/lithium.h"
#include "src/zone.h"
......
......@@ -5,8 +5,6 @@
#ifndef V8_LITHIUM_CODEGEN_H_
#define V8_LITHIUM_CODEGEN_H_
#include "src/v8.h"
#include "src/bailout-reason.h"
#include "src/compiler.h"
#include "src/deoptimizer.h"
......
......@@ -5,8 +5,6 @@
#ifndef V8_MIPS_LITHIUM_GAP_RESOLVER_MIPS_H_
#define V8_MIPS_LITHIUM_GAP_RESOLVER_MIPS_H_
#include "src/v8.h"
#include "src/lithium.h"
namespace v8 {
......
......@@ -5,8 +5,6 @@
#ifndef V8_MIPS_LITHIUM_GAP_RESOLVER_MIPS_H_
#define V8_MIPS_LITHIUM_GAP_RESOLVER_MIPS_H_
#include "src/v8.h"
#include "src/lithium.h"
namespace v8 {
......
......@@ -28,6 +28,7 @@
#include "src/prototype.h"
#include "src/transitions-inl.h"
#include "src/type-feedback-vector-inl.h"
#include "src/types-inl.h"
#include "src/v8memory.h"
namespace v8 {
......
......@@ -5,8 +5,6 @@
#ifndef V8_PPC_LITHIUM_GAP_RESOLVER_PPC_H_
#define V8_PPC_LITHIUM_GAP_RESOLVER_PPC_H_
#include "src/v8.h"
#include "src/lithium.h"
namespace v8 {
......
......@@ -5,8 +5,6 @@
#ifndef V8_PREPARSER_H
#define V8_PREPARSER_H
#include "src/v8.h"
#include "src/bailout-reason.h"
#include "src/expression-classifier.h"
#include "src/func-name-inferrer.h"
......
......@@ -2,17 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// A light-weight assembler for the Irregexp byte code.
#include "src/v8.h"
#ifndef V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_INL_H_
#define V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_INL_H_
#include "src/ast.h"
#include "src/bytecodes-irregexp.h"
#ifndef V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_INL_H_
#define V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_INL_H_
namespace v8 {
namespace internal {
......
......@@ -12,6 +12,7 @@ namespace internal {
#ifdef V8_INTERPRETED_REGEXP
// A light-weight assembler for the Irregexp byte code.
class RegExpMacroAssemblerIrregexp: public RegExpMacroAssembler {
public:
// Create an assembler. Instructions and relocation information are emitted
......
......@@ -5,7 +5,8 @@
#ifndef V8_STRING_BUILDER_H_
#define V8_STRING_BUILDER_H_
#include "src/v8.h"
#include "src/objects-inl.h"
#include "src/utils.h"
namespace v8 {
namespace internal {
......
......@@ -5,8 +5,6 @@
#ifndef V8_TYPING_H_
#define V8_TYPING_H_
#include "src/v8.h"
#include "src/allocation.h"
#include "src/ast.h"
#include "src/effects.h"
......
......@@ -27,19 +27,10 @@
// Basic includes
#include "include/v8.h"
#include "include/v8-platform.h"
#include "src/checks.h" // NOLINT
#include "src/allocation.h" // NOLINT
#include "src/assert-scope.h" // NOLINT
#include "src/utils.h" // NOLINT
#include "src/flags.h" // NOLINT
#include "src/globals.h" // NOLINT
#include "src/allocation.h"
// Objects
#include "src/objects-inl.h" // NOLINT
#include "src/log-inl.h" // NOLINT
#include "src/handles-inl.h" // NOLINT
#include "src/types-inl.h" // NOLINT
#include "src/objects-inl.h"
namespace v8 {
namespace internal {
......@@ -80,11 +71,6 @@ class V8 : public AllStatic {
static v8::Platform* platform_;
};
// JavaScript defines two kinds of 'nil'.
enum NilValue { kNullValue, kUndefinedValue };
} } // namespace v8::internal
#endif // V8_V8_H_
......@@ -5,8 +5,6 @@
#ifndef V8_X64_LITHIUM_GAP_RESOLVER_X64_H_
#define V8_X64_LITHIUM_GAP_RESOLVER_X64_H_
#include "src/v8.h"
#include "src/lithium.h"
namespace v8 {
......
......@@ -5,8 +5,6 @@
#ifndef V8_X87_LITHIUM_GAP_RESOLVER_X87_H_
#define V8_X87_LITHIUM_GAP_RESOLVER_X87_H_
#include "src/v8.h"
#include "src/lithium.h"
namespace v8 {
......
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