Commit 913d363c authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[refactoring] Drop roots.h -> handles.h #include

This makes it possible for handles.h to #include objects.h, which
upcoming changes will need.

Bug: v8:3770
Change-Id: I4f500736028668749bb73fb24f9732df757e97d0
Reviewed-on: https://chromium-review.googlesource.com/c/1278487Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56615}
parent 71ed3d9b
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "src/handles.h" #include "src/handles.h"
#include "src/objects.h" #include "src/objects.h"
#include "src/objects/allocation-site.h"
#include "src/objects/map.h" #include "src/objects/map.h"
namespace v8 { namespace v8 {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define V8_ARGUMENTS_H_ #define V8_ARGUMENTS_H_
#include "src/allocation.h" #include "src/allocation.h"
#include "src/handles.h"
#include "src/objects.h" #include "src/objects.h"
#include "src/tracing/trace-event.h" #include "src/tracing/trace-event.h"
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "src/base/optional.h" #include "src/base/optional.h"
#include "src/compiler/refs-map.h" #include "src/compiler/refs-map.h"
#include "src/globals.h" #include "src/globals.h"
#include "src/handles.h"
#include "src/objects.h" #include "src/objects.h"
#include "src/objects/builtin-function-id.h" #include "src/objects/builtin-function-id.h"
#include "src/zone/zone-containers.h" #include "src/zone/zone-containers.h"
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "src/compiler/instruction-selector-impl.h" #include "src/compiler/instruction-selector-impl.h"
#include "src/compiler/node-matchers.h" #include "src/compiler/node-matchers.h"
#include "src/compiler/node-properties.h" #include "src/compiler/node-properties.h"
#include "src/roots-inl.h"
#include "src/turbo-assembler.h" #include "src/turbo-assembler.h"
namespace v8 { namespace v8 {
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <vector> #include <vector>
#include "src/debug/debug-interface.h" #include "src/debug/debug-interface.h"
#include "src/handles.h"
#include "src/objects.h" #include "src/objects.h"
namespace v8 { namespace v8 {
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <vector> #include <vector>
#include "src/debug/debug-interface.h" #include "src/debug/debug-interface.h"
#include "src/handles.h"
#include "src/objects.h" #include "src/objects.h"
namespace v8 { namespace v8 {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "src/isolate.h" #include "src/isolate.h"
#include "src/objects-inl.h" #include "src/objects-inl.h"
#include "src/objects/regexp-match-info.h"
namespace v8 { namespace v8 {
namespace internal { namespace internal {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "src/roots.h" #include "src/roots.h"
#include "src/handles.h"
#include "src/heap/heap-inl.h" #include "src/heap/heap-inl.h"
namespace v8 { namespace v8 {
...@@ -23,6 +24,12 @@ V8_INLINE RootIndex operator++(RootIndex& index) { ...@@ -23,6 +24,12 @@ V8_INLINE RootIndex operator++(RootIndex& index) {
return index; return index;
} }
template <typename T>
bool RootsTable::IsRootHandle(Handle<T> handle, RootIndex* index) const {
Object** handle_location = bit_cast<Object**>(handle.address());
return IsRootHandleLocation(handle_location, index);
}
ReadOnlyRoots::ReadOnlyRoots(Heap* heap) ReadOnlyRoots::ReadOnlyRoots(Heap* heap)
: roots_table_(heap->isolate()->roots_table()) {} : roots_table_(heap->isolate()->roots_table()) {}
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include "src/accessors.h" #include "src/accessors.h"
#include "src/globals.h" #include "src/globals.h"
#include "src/handles.h"
#include "src/heap-symbols.h" #include "src/heap-symbols.h"
#include "src/objects-definitions.h" #include "src/objects-definitions.h"
...@@ -17,6 +16,8 @@ namespace internal { ...@@ -17,6 +16,8 @@ namespace internal {
// Forward declarations. // Forward declarations.
enum ElementsKind : uint8_t; enum ElementsKind : uint8_t;
class FixedTypedArrayBase; class FixedTypedArrayBase;
template <typename T>
class Handle;
class Heap; class Heap;
class Isolate; class Isolate;
class Map; class Map;
...@@ -393,10 +394,7 @@ class RootsTable { ...@@ -393,10 +394,7 @@ class RootsTable {
} }
template <typename T> template <typename T>
bool IsRootHandle(Handle<T> handle, RootIndex* index) const { bool IsRootHandle(Handle<T> handle, RootIndex* index) const;
Object** handle_location = bit_cast<Object**>(handle.address());
return IsRootHandleLocation(handle_location, index);
}
Object* const& operator[](RootIndex root_index) const { Object* const& operator[](RootIndex root_index) const {
size_t index = static_cast<size_t>(root_index); size_t index = static_cast<size_t>(root_index);
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef V8_STRING_CONSTANTS_H_ #ifndef V8_STRING_CONSTANTS_H_
#define V8_STRING_CONSTANTS_H_ #define V8_STRING_CONSTANTS_H_
#include "src/handles.h"
#include "src/objects/string.h" #include "src/objects/string.h"
#include "src/zone/zone.h" #include "src/zone/zone.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