[heap] Avoid overzealous inclusion of heap internal headers.
authormstarzinger <mstarzinger@chromium.org>
Mon, 10 Aug 2015 16:32:08 +0000 (09:32 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 10 Aug 2015 16:32:29 +0000 (16:32 +0000)
This is a first step towards constraining down the heap interface to
just the heap.h file. Note that many includes still leak through that
file to the global "src" directory, but there now is a single place
controlling which declarations leak that way. Especially inclusion of
inline header files within "heap" has been limited drastically.

R=hpayer@chromium.org,mlippautz@chromium.org

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

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

20 files changed:
src/DEPS
src/api.cc
src/builtins.cc
src/frames.cc
src/heap/heap.cc
src/heap/incremental-marking.cc
src/heap/mark-compact-inl.h
src/heap/mark-compact.cc
src/heap/mark-compact.h
src/heap/objects-visiting.cc
src/isolate.cc
src/json-parser.h
src/messages.cc
src/objects-debug.cc
src/objects-inl.h
src/objects-printer.cc
src/objects.cc
src/runtime-profiler.cc
src/v8.cc
src/v8.h

index 94d6ec68e00fabd9936a92f60afd454368af7118..80dab6ba70c6b915b121d9e3950cdb29cf8e27f7 100644 (file)
--- a/src/DEPS
+++ b/src/DEPS
@@ -2,6 +2,9 @@ include_rules = [
   "+src",
   "-src/compiler",
   "+src/compiler/pipeline.h",
+  "-src/heap",
+  "+src/heap/heap.h",
+  "+src/heap/heap-inl.h",
   "-src/interpreter",
   "+src/interpreter/bytecodes.h",
   "+src/interpreter/interpreter.h",
@@ -13,4 +16,13 @@ specific_include_rules = {
   "d8\.cc": [
     "+include/libplatform/libplatform.h",
   ],
+  # TODO(mstarzinger): Get rid of grab-bag includes from heap in v8.h soon.
+  "v8\.h": [
+    "+src/heap/spaces-inl.h",
+    "+src/heap/incremental-marking-inl.h",
+  ],
+  # TODO(mstarzinger): Only needed because of Code::CodeIterateBody cyclicity.
+  "objects\.cc": [
+    "+src/heap/objects-visiting-inl.h",
+  ],
 }
index 8615d8245d68b3386470c2c00b0dfe9890336529..107e168bd183c38dd9b178eb72c26e4607fc34c8 100644 (file)
@@ -31,7 +31,6 @@
 #include "src/deoptimizer.h"
 #include "src/execution.h"
 #include "src/global-handles.h"
-#include "src/heap/spaces.h"
 #include "src/heap-profiler.h"
 #include "src/heap-snapshot-generator-inl.h"
 #include "src/icu_util.h"
index 42ef5ecc91230fdb74dee1f71a4063af9fd705c7..6b0b2229cdfc8d500feb69ef3622ae97325bccdf 100644 (file)
@@ -13,7 +13,6 @@
 #include "src/cpu-profiler.h"
 #include "src/elements.h"
 #include "src/gdb-jit.h"
-#include "src/heap/mark-compact.h"
 #include "src/heap-profiler.h"
 #include "src/ic/handler-compiler.h"
 #include "src/ic/ic.h"
index ebe0cb121c34d0eec9a2f11272bdb9ddef53bf3d..c4a93c87e5089f571671e4fa86c57e7ad40f1ece 100644 (file)
@@ -13,7 +13,6 @@
 #include "src/deoptimizer.h"
 #include "src/frames-inl.h"
 #include "src/full-codegen/full-codegen.h"
-#include "src/heap/mark-compact.h"
 #include "src/safepoint-table.h"
 #include "src/scopeinfo.h"
 #include "src/string-stream.h"
index eb18925b20e6b430fb18d89038195fe496fe9673..66abc6d00ba9b96163ac793bd63f632ddb50f047 100644 (file)
@@ -19,6 +19,7 @@
 #include "src/global-handles.h"
 #include "src/heap/gc-idle-time-handler.h"
 #include "src/heap/incremental-marking.h"
+#include "src/heap/mark-compact-inl.h"
 #include "src/heap/mark-compact.h"
 #include "src/heap/memory-reducer.h"
 #include "src/heap/objects-visiting-inl.h"
index 109f4ea84802df419bb0e1a4a9ec492f39487030..db19165f0a310eb0dec219df1226b8333c17e96e 100644 (file)
@@ -9,6 +9,7 @@
 #include "src/code-stubs.h"
 #include "src/compilation-cache.h"
 #include "src/conversions.h"
+#include "src/heap/mark-compact-inl.h"
 #include "src/heap/objects-visiting.h"
 #include "src/heap/objects-visiting-inl.h"
 
index c78ae650df9ffea23cd42705abdc4d60f75fb09c..0acbe07662c93a21dc47c61c3260e296f6fa95b8 100644 (file)
@@ -13,12 +13,6 @@ namespace v8 {
 namespace internal {
 
 
-MarkBit Marking::MarkBitFrom(Address addr) {
-  MemoryChunk* p = MemoryChunk::FromAddress(addr);
-  return p->markbits()->MarkBitFromIndex(p->AddressToMarkbitIndex(addr));
-}
-
-
 void MarkCompactCollector::SetFlags(int flags) {
   reduce_memory_footprint_ = ((flags & Heap::kReduceMemoryFootprintMask) != 0);
   abort_incremental_marking_ =
index 8b9a9c38ac1470f80617a1ae9c06f697e9f7bbec..4de8b0e019a1f6e21462632388b68586fbe2ff3a 100644 (file)
@@ -15,6 +15,7 @@
 #include "src/global-handles.h"
 #include "src/heap/incremental-marking.h"
 #include "src/heap/mark-compact.h"
+#include "src/heap/mark-compact-inl.h"
 #include "src/heap/objects-visiting.h"
 #include "src/heap/objects-visiting-inl.h"
 #include "src/heap/spaces-inl.h"
index 2610cfb5cabc324e8c4cd1f7e16c28377dac8a63..8db7f45c2629bd4322dd737ec98b8bbc19cf1b1f 100644 (file)
@@ -28,7 +28,10 @@ class RootMarkingVisitor;
 
 class Marking : public AllStatic {
  public:
-  INLINE(static MarkBit MarkBitFrom(Address addr));
+  INLINE(static MarkBit MarkBitFrom(Address addr)) {
+    MemoryChunk* p = MemoryChunk::FromAddress(addr);
+    return p->markbits()->MarkBitFromIndex(p->AddressToMarkbitIndex(addr));
+  }
 
   INLINE(static MarkBit MarkBitFrom(HeapObject* obj)) {
     return MarkBitFrom(reinterpret_cast<Address>(obj));
index dc22d0e93968bfd34627ec5ccb896205f3f2b0a3..1c8e20dd97318a847cc0379472dad4c43729ed65 100644 (file)
@@ -4,6 +4,7 @@
 
 #include "src/v8.h"
 
+#include "src/heap/mark-compact-inl.h"
 #include "src/heap/objects-visiting.h"
 
 namespace v8 {
index f5d6bc955884acc3e7c3c83501f79b9a4c6a37d3..1a83b70e93a745b92b952ffcf8ff412c5ab69e77 100644 (file)
@@ -21,7 +21,6 @@
 #include "src/cpu-profiler.h"
 #include "src/debug/debug.h"
 #include "src/deoptimizer.h"
-#include "src/heap/spaces.h"
 #include "src/heap-profiler.h"
 #include "src/hydrogen.h"
 #include "src/ic/stub-cache.h"
index f1fa5647f848673055e767d605f270d83403e7ff..7be799b0e55bf8555663c248330a3c8dedf1fe4f 100644 (file)
@@ -9,7 +9,6 @@
 
 #include "src/char-predicates-inl.h"
 #include "src/conversions.h"
-#include "src/heap/spaces-inl.h"
 #include "src/messages.h"
 #include "src/token.h"
 
index ebec3532fe2a4ca9b1505af9e0bc35281dd95a88..55edfa89c45f96198c3d4df3dfa3499321a6a9b3 100644 (file)
@@ -6,7 +6,6 @@
 
 #include "src/api.h"
 #include "src/execution.h"
-#include "src/heap/spaces-inl.h"
 #include "src/messages.h"
 #include "src/string-builder.h"
 
index da1ed6a4420cb6195a1e234316e04aad38dd3087..9d90f5163fba9bf16004679fcb6d5ddc6d94a6f8 100644 (file)
@@ -6,7 +6,6 @@
 
 #include "src/disasm.h"
 #include "src/disassembler.h"
-#include "src/heap/objects-visiting.h"
 #include "src/jsregexp.h"
 #include "src/macro-assembler.h"
 #include "src/ostreams.h"
index fd0c6025a20b8547933499175a4ffca02b09b8a6..991253fd645e4aec1e1f06bcf8e162c14e35631c 100644 (file)
 #include "src/field-index-inl.h"
 #include "src/heap/heap-inl.h"
 #include "src/heap/heap.h"
-#include "src/heap/incremental-marking.h"
-#include "src/heap/objects-visiting.h"
-#include "src/heap/spaces.h"
-#include "src/heap/store-buffer.h"
 #include "src/isolate.h"
 #include "src/layout-descriptor-inl.h"
 #include "src/lookup.h"
index 3414e2134d02c617157962bc254d7ffc366beea9..82648e1352e7f111e7fbd9a35ac3efb329effd16 100644 (file)
@@ -6,7 +6,6 @@
 
 #include "src/disasm.h"
 #include "src/disassembler.h"
-#include "src/heap/objects-visiting.h"
 #include "src/interpreter/bytecodes.h"
 #include "src/jsregexp.h"
 #include "src/ostreams.h"
index 3b3eb93d29d63c160284b45e06b6c9ed9b81eece..658c0d78b68d8fe889ceff508bb59592cb8a6971 100644 (file)
@@ -27,7 +27,6 @@
 #include "src/field-index-inl.h"
 #include "src/field-index.h"
 #include "src/full-codegen/full-codegen.h"
-#include "src/heap/mark-compact.h"
 #include "src/heap/objects-visiting-inl.h"
 #include "src/hydrogen.h"
 #include "src/ic/ic.h"
index 1825a7fbf72ce9d44ac17d57b04977334b6653f7..865c574f1075ed0480a4d8f136a047c16790631d 100644 (file)
@@ -14,7 +14,6 @@
 #include "src/execution.h"
 #include "src/full-codegen/full-codegen.h"
 #include "src/global-handles.h"
-#include "src/heap/mark-compact.h"
 #include "src/scopeinfo.h"
 
 namespace v8 {
index d16dbee255397455a2f8a78cc01f65a1ee50658b..bd6f2c2b28486d45b0b5164781ad99eb1fefc0c2 100644 (file)
--- a/src/v8.cc
+++ b/src/v8.cc
@@ -12,7 +12,6 @@
 #include "src/deoptimizer.h"
 #include "src/elements.h"
 #include "src/frames.h"
-#include "src/heap/store-buffer.h"
 #include "src/heap-profiler.h"
 #include "src/hydrogen.h"
 #include "src/isolate.h"
index 71dd42f49df8dae580a36492e306a07432d728d5..41d4c36b4ddb074a7c06775892a16964937e6d12 100644 (file)
--- a/src/v8.h
+++ b/src/v8.h
@@ -38,9 +38,7 @@
 // Objects & heap
 #include "src/objects-inl.h"  // NOLINT
 #include "src/heap/spaces-inl.h"               // NOLINT
-#include "src/heap/heap-inl.h"                 // NOLINT
 #include "src/heap/incremental-marking-inl.h"  // NOLINT
-#include "src/heap/mark-compact-inl.h"         // NOLINT
 #include "src/log-inl.h"  // NOLINT
 #include "src/handles-inl.h"  // NOLINT
 #include "src/types-inl.h"  // NOLINT