Commit 180ba0c0 authored by Maya Lekova's avatar Maya Lekova Committed by Commit Bot

[turbofan] Disentangle header include chains

Got rid of the following circular header dependency chains:
compilation-dependencies <-> js-heap-broker <-> access-info
types <-> js-heap-broker <-> access-info

Extracted former CompilationDependencies::Dependency class into its own header.
Extracted *Ref classes into their own header.

This should enable building on older GCC versions, e.g. 5.4.0.

Bug: v8:9440
Change-Id: Ia345bc227d8f7806d0b8622b706346a7ce6d01ea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1687415
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62541}
parent 3e546664
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "src/builtins/accessors.h" #include "src/builtins/accessors.h"
#include "src/compiler/compilation-dependencies.h" #include "src/compiler/compilation-dependencies.h"
#include "src/compiler/compilation-dependency.h"
#include "src/compiler/type-cache.h" #include "src/compiler/type-cache.h"
#include "src/ic/call-optimization.h" #include "src/ic/call-optimization.h"
#include "src/logging/counters.h" #include "src/logging/counters.h"
...@@ -78,7 +79,7 @@ PropertyAccessInfo PropertyAccessInfo::NotFound(Zone* zone, ...@@ -78,7 +79,7 @@ PropertyAccessInfo PropertyAccessInfo::NotFound(Zone* zone,
// static // static
PropertyAccessInfo PropertyAccessInfo::DataField( PropertyAccessInfo PropertyAccessInfo::DataField(
Zone* zone, Handle<Map> receiver_map, Zone* zone, Handle<Map> receiver_map,
ZoneVector<CompilationDependencies::Dependency const*>&& dependencies, ZoneVector<CompilationDependency const*>&& dependencies,
FieldIndex field_index, Representation field_representation, FieldIndex field_index, Representation field_representation,
Type field_type, MaybeHandle<Map> field_map, MaybeHandle<JSObject> holder, Type field_type, MaybeHandle<Map> field_map, MaybeHandle<JSObject> holder,
MaybeHandle<Map> transition_map) { MaybeHandle<Map> transition_map) {
...@@ -90,7 +91,7 @@ PropertyAccessInfo PropertyAccessInfo::DataField( ...@@ -90,7 +91,7 @@ PropertyAccessInfo PropertyAccessInfo::DataField(
// static // static
PropertyAccessInfo PropertyAccessInfo::DataConstant( PropertyAccessInfo PropertyAccessInfo::DataConstant(
Zone* zone, Handle<Map> receiver_map, Zone* zone, Handle<Map> receiver_map,
ZoneVector<CompilationDependencies::Dependency const*>&& dependencies, ZoneVector<CompilationDependency const*>&& dependencies,
FieldIndex field_index, Representation field_representation, FieldIndex field_index, Representation field_representation,
Type field_type, MaybeHandle<Map> field_map, MaybeHandle<JSObject> holder, Type field_type, MaybeHandle<Map> field_map, MaybeHandle<JSObject> holder,
MaybeHandle<Map> transition_map) { MaybeHandle<Map> transition_map) {
...@@ -156,8 +157,7 @@ PropertyAccessInfo::PropertyAccessInfo( ...@@ -156,8 +157,7 @@ PropertyAccessInfo::PropertyAccessInfo(
FieldIndex field_index, Representation field_representation, FieldIndex field_index, Representation field_representation,
Type field_type, MaybeHandle<Map> field_map, Type field_type, MaybeHandle<Map> field_map,
ZoneVector<Handle<Map>>&& receiver_maps, ZoneVector<Handle<Map>>&& receiver_maps,
ZoneVector<CompilationDependencies::Dependency const*>&& ZoneVector<CompilationDependency const*>&& unrecorded_dependencies)
unrecorded_dependencies)
: kind_(kind), : kind_(kind),
receiver_maps_(receiver_maps), receiver_maps_(receiver_maps),
unrecorded_dependencies_(std::move(unrecorded_dependencies)), unrecorded_dependencies_(std::move(unrecorded_dependencies)),
...@@ -258,11 +258,6 @@ bool PropertyAccessInfo::Merge(PropertyAccessInfo const* that, ...@@ -258,11 +258,6 @@ bool PropertyAccessInfo::Merge(PropertyAccessInfo const* that,
} }
} }
CellRef PropertyAccessInfo::export_cell(JSHeapBroker* broker) const {
DCHECK_EQ(kModuleExport, kind_);
return ObjectRef(broker, constant_).AsCell();
}
AccessInfoFactory::AccessInfoFactory(JSHeapBroker* broker, AccessInfoFactory::AccessInfoFactory(JSHeapBroker* broker,
CompilationDependencies* dependencies, CompilationDependencies* dependencies,
Zone* zone) Zone* zone)
...@@ -336,8 +331,7 @@ PropertyAccessInfo AccessInfoFactory::ComputeDataFieldAccessInfo( ...@@ -336,8 +331,7 @@ PropertyAccessInfo AccessInfoFactory::ComputeDataFieldAccessInfo(
Type field_type = Type::NonInternal(); Type field_type = Type::NonInternal();
MaybeHandle<Map> field_map; MaybeHandle<Map> field_map;
MapRef map_ref(broker(), map); MapRef map_ref(broker(), map);
ZoneVector<CompilationDependencies::Dependency const*> ZoneVector<CompilationDependency const*> unrecorded_dependencies(zone());
unrecorded_dependencies(zone());
if (details_representation.IsSmi()) { if (details_representation.IsSmi()) {
field_type = Type::SignedSmall(); field_type = Type::SignedSmall();
map_ref.SerializeOwnDescriptor(descriptor); map_ref.SerializeOwnDescriptor(descriptor);
...@@ -608,8 +602,7 @@ void AccessInfoFactory::ComputePropertyAccessInfos( ...@@ -608,8 +602,7 @@ void AccessInfoFactory::ComputePropertyAccessInfos(
void PropertyAccessInfo::RecordDependencies( void PropertyAccessInfo::RecordDependencies(
CompilationDependencies* dependencies) { CompilationDependencies* dependencies) {
for (CompilationDependencies::Dependency const* d : for (CompilationDependency const* d : unrecorded_dependencies_) {
unrecorded_dependencies_) {
dependencies->RecordDependency(d); dependencies->RecordDependency(d);
} }
unrecorded_dependencies_.clear(); unrecorded_dependencies_.clear();
...@@ -645,6 +638,8 @@ void AccessInfoFactory::MergePropertyAccessInfos( ...@@ -645,6 +638,8 @@ void AccessInfoFactory::MergePropertyAccessInfos(
CHECK(!result->empty()); CHECK(!result->empty());
} }
Isolate* AccessInfoFactory::isolate() const { return broker()->isolate(); }
namespace { namespace {
Maybe<ElementsKind> GeneralizeElementsKind(ElementsKind this_kind, Maybe<ElementsKind> GeneralizeElementsKind(ElementsKind this_kind,
...@@ -757,8 +752,7 @@ PropertyAccessInfo AccessInfoFactory::LookupTransition( ...@@ -757,8 +752,7 @@ PropertyAccessInfo AccessInfoFactory::LookupTransition(
Type field_type = Type::NonInternal(); Type field_type = Type::NonInternal();
MaybeHandle<Map> field_map; MaybeHandle<Map> field_map;
MapRef transition_map_ref(broker(), transition_map); MapRef transition_map_ref(broker(), transition_map);
ZoneVector<CompilationDependencies::Dependency const*> ZoneVector<CompilationDependency const*> unrecorded_dependencies(zone());
unrecorded_dependencies(zone());
if (details_representation.IsSmi()) { if (details_representation.IsSmi()) {
field_type = Type::SignedSmall(); field_type = Type::SignedSmall();
transition_map_ref.SerializeOwnDescriptor(number); transition_map_ref.SerializeOwnDescriptor(number);
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <iosfwd> #include <iosfwd>
#include "src/codegen/machine-type.h" #include "src/codegen/machine-type.h"
#include "src/compiler/compilation-dependencies.h"
#include "src/compiler/types.h" #include "src/compiler/types.h"
#include "src/objects/feedback-vector.h" #include "src/objects/feedback-vector.h"
#include "src/objects/field-index.h" #include "src/objects/field-index.h"
...@@ -25,8 +24,10 @@ class Factory; ...@@ -25,8 +24,10 @@ class Factory;
namespace compiler { namespace compiler {
// Forward declarations. // Forward declarations.
class CompilationDependencies;
class CompilationDependency;
class ElementAccessFeedback; class ElementAccessFeedback;
class Type; class JSHeapBroker;
class TypeCache; class TypeCache;
std::ostream& operator<<(std::ostream&, AccessMode); std::ostream& operator<<(std::ostream&, AccessMode);
...@@ -74,16 +75,14 @@ class PropertyAccessInfo final { ...@@ -74,16 +75,14 @@ class PropertyAccessInfo final {
MaybeHandle<JSObject> holder); MaybeHandle<JSObject> holder);
static PropertyAccessInfo DataField( static PropertyAccessInfo DataField(
Zone* zone, Handle<Map> receiver_map, Zone* zone, Handle<Map> receiver_map,
ZoneVector<CompilationDependencies::Dependency const*>&& ZoneVector<CompilationDependency const*>&& unrecorded_dependencies,
unrecorded_dependencies,
FieldIndex field_index, Representation field_representation, FieldIndex field_index, Representation field_representation,
Type field_type, MaybeHandle<Map> field_map = MaybeHandle<Map>(), Type field_type, MaybeHandle<Map> field_map = MaybeHandle<Map>(),
MaybeHandle<JSObject> holder = MaybeHandle<JSObject>(), MaybeHandle<JSObject> holder = MaybeHandle<JSObject>(),
MaybeHandle<Map> transition_map = MaybeHandle<Map>()); MaybeHandle<Map> transition_map = MaybeHandle<Map>());
static PropertyAccessInfo DataConstant( static PropertyAccessInfo DataConstant(
Zone* zone, Handle<Map> receiver_map, Zone* zone, Handle<Map> receiver_map,
ZoneVector<CompilationDependencies::Dependency const*>&& ZoneVector<CompilationDependency const*>&& unrecorded_dependencies,
unrecorded_dependencies,
FieldIndex field_index, Representation field_representation, FieldIndex field_index, Representation field_representation,
Type field_type, MaybeHandle<Map> field_map, MaybeHandle<JSObject> holder, Type field_type, MaybeHandle<Map> field_map, MaybeHandle<JSObject> holder,
MaybeHandle<Map> transition_map = MaybeHandle<Map>()); MaybeHandle<Map> transition_map = MaybeHandle<Map>());
...@@ -127,7 +126,6 @@ class PropertyAccessInfo final { ...@@ -127,7 +126,6 @@ class PropertyAccessInfo final {
ZoneVector<Handle<Map>> const& receiver_maps() const { ZoneVector<Handle<Map>> const& receiver_maps() const {
return receiver_maps_; return receiver_maps_;
} }
CellRef export_cell(JSHeapBroker* broker) const;
private: private:
explicit PropertyAccessInfo(Zone* zone); explicit PropertyAccessInfo(Zone* zone);
...@@ -136,17 +134,16 @@ class PropertyAccessInfo final { ...@@ -136,17 +134,16 @@ class PropertyAccessInfo final {
PropertyAccessInfo(Zone* zone, Kind kind, MaybeHandle<JSObject> holder, PropertyAccessInfo(Zone* zone, Kind kind, MaybeHandle<JSObject> holder,
Handle<Object> constant, Handle<Object> constant,
ZoneVector<Handle<Map>>&& receiver_maps); ZoneVector<Handle<Map>>&& receiver_maps);
PropertyAccessInfo( PropertyAccessInfo(Kind kind, MaybeHandle<JSObject> holder,
Kind kind, MaybeHandle<JSObject> holder, MaybeHandle<Map> transition_map, MaybeHandle<Map> transition_map, FieldIndex field_index,
FieldIndex field_index, Representation field_representation, Representation field_representation, Type field_type,
Type field_type, MaybeHandle<Map> field_map, MaybeHandle<Map> field_map,
ZoneVector<Handle<Map>>&& receiver_maps, ZoneVector<Handle<Map>>&& receiver_maps,
ZoneVector<CompilationDependencies::Dependency const*>&& dependencies); ZoneVector<CompilationDependency const*>&& dependencies);
Kind kind_; Kind kind_;
ZoneVector<Handle<Map>> receiver_maps_; ZoneVector<Handle<Map>> receiver_maps_;
ZoneVector<CompilationDependencies::Dependency const*> ZoneVector<CompilationDependency const*> unrecorded_dependencies_;
unrecorded_dependencies_;
Handle<Object> constant_; Handle<Object> constant_;
MaybeHandle<Map> transition_map_; MaybeHandle<Map> transition_map_;
MaybeHandle<JSObject> holder_; MaybeHandle<JSObject> holder_;
...@@ -215,7 +212,7 @@ class AccessInfoFactory final { ...@@ -215,7 +212,7 @@ class AccessInfoFactory final {
CompilationDependencies* dependencies() const { return dependencies_; } CompilationDependencies* dependencies() const { return dependencies_; }
JSHeapBroker* broker() const { return broker_; } JSHeapBroker* broker() const { return broker_; }
Isolate* isolate() const { return broker()->isolate(); } Isolate* isolate() const;
Zone* zone() const { return zone_; } Zone* zone() const { return zone_; }
JSHeapBroker* const broker_; JSHeapBroker* const broker_;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "src/compiler/access-builder.h" #include "src/compiler/access-builder.h"
#include "src/compiler/bytecode-analysis.h" #include "src/compiler/bytecode-analysis.h"
#include "src/compiler/compiler-source-position-table.h" #include "src/compiler/compiler-source-position-table.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/linkage.h" #include "src/compiler/linkage.h"
#include "src/compiler/node-matchers.h" #include "src/compiler/node-matchers.h"
#include "src/compiler/operator-properties.h" #include "src/compiler/operator-properties.h"
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "src/compiler/compilation-dependencies.h" #include "src/compiler/compilation-dependencies.h"
#include "src/compiler/compilation-dependency.h"
#include "src/handles/handles-inl.h" #include "src/handles/handles-inl.h"
#include "src/objects/allocation-site-inl.h" #include "src/objects/allocation-site-inl.h"
#include "src/objects/objects-inl.h" #include "src/objects/objects-inl.h"
...@@ -17,18 +18,7 @@ CompilationDependencies::CompilationDependencies(JSHeapBroker* broker, ...@@ -17,18 +18,7 @@ CompilationDependencies::CompilationDependencies(JSHeapBroker* broker,
Zone* zone) Zone* zone)
: zone_(zone), broker_(broker), dependencies_(zone) {} : zone_(zone), broker_(broker), dependencies_(zone) {}
class CompilationDependencies::Dependency : public ZoneObject { class InitialMapDependency final : public CompilationDependency {
public:
virtual bool IsValid() const = 0;
virtual void PrepareInstall() const {}
virtual void Install(const MaybeObjectHandle& code) const = 0;
#ifdef DEBUG
virtual bool IsPretenureModeDependency() const { return false; }
#endif
};
class InitialMapDependency final : public CompilationDependencies::Dependency {
public: public:
// TODO(neis): Once the concurrent compiler frontend is always-on, we no // TODO(neis): Once the concurrent compiler frontend is always-on, we no
// longer need to explicitly store the initial map. // longer need to explicitly store the initial map.
...@@ -56,8 +46,7 @@ class InitialMapDependency final : public CompilationDependencies::Dependency { ...@@ -56,8 +46,7 @@ class InitialMapDependency final : public CompilationDependencies::Dependency {
MapRef initial_map_; MapRef initial_map_;
}; };
class PrototypePropertyDependency final class PrototypePropertyDependency final : public CompilationDependency {
: public CompilationDependencies::Dependency {
public: public:
// TODO(neis): Once the concurrent compiler frontend is always-on, we no // TODO(neis): Once the concurrent compiler frontend is always-on, we no
// longer need to explicitly store the prototype. // longer need to explicitly store the prototype.
...@@ -96,7 +85,7 @@ class PrototypePropertyDependency final ...@@ -96,7 +85,7 @@ class PrototypePropertyDependency final
ObjectRef prototype_; ObjectRef prototype_;
}; };
class StableMapDependency final : public CompilationDependencies::Dependency { class StableMapDependency final : public CompilationDependency {
public: public:
explicit StableMapDependency(const MapRef& map) : map_(map) { explicit StableMapDependency(const MapRef& map) : map_(map) {
DCHECK(map_.is_stable()); DCHECK(map_.is_stable());
...@@ -114,7 +103,7 @@ class StableMapDependency final : public CompilationDependencies::Dependency { ...@@ -114,7 +103,7 @@ class StableMapDependency final : public CompilationDependencies::Dependency {
MapRef map_; MapRef map_;
}; };
class TransitionDependency final : public CompilationDependencies::Dependency { class TransitionDependency final : public CompilationDependency {
public: public:
explicit TransitionDependency(const MapRef& map) : map_(map) { explicit TransitionDependency(const MapRef& map) : map_(map) {
DCHECK(!map_.is_deprecated()); DCHECK(!map_.is_deprecated());
...@@ -132,8 +121,7 @@ class TransitionDependency final : public CompilationDependencies::Dependency { ...@@ -132,8 +121,7 @@ class TransitionDependency final : public CompilationDependencies::Dependency {
MapRef map_; MapRef map_;
}; };
class PretenureModeDependency final class PretenureModeDependency final : public CompilationDependency {
: public CompilationDependencies::Dependency {
public: public:
// TODO(neis): Once the concurrent compiler frontend is always-on, we no // TODO(neis): Once the concurrent compiler frontend is always-on, we no
// longer need to explicitly store the mode. // longer need to explicitly store the mode.
...@@ -163,8 +151,7 @@ class PretenureModeDependency final ...@@ -163,8 +151,7 @@ class PretenureModeDependency final
AllocationType allocation_; AllocationType allocation_;
}; };
class FieldRepresentationDependency final class FieldRepresentationDependency final : public CompilationDependency {
: public CompilationDependencies::Dependency {
public: public:
// TODO(neis): Once the concurrent compiler frontend is always-on, we no // TODO(neis): Once the concurrent compiler frontend is always-on, we no
// longer need to explicitly store the representation. // longer need to explicitly store the representation.
...@@ -197,7 +184,7 @@ class FieldRepresentationDependency final ...@@ -197,7 +184,7 @@ class FieldRepresentationDependency final
Representation representation_; Representation representation_;
}; };
class FieldTypeDependency final : public CompilationDependencies::Dependency { class FieldTypeDependency final : public CompilationDependency {
public: public:
// TODO(neis): Once the concurrent compiler frontend is always-on, we no // TODO(neis): Once the concurrent compiler frontend is always-on, we no
// longer need to explicitly store the type. // longer need to explicitly store the type.
...@@ -227,8 +214,7 @@ class FieldTypeDependency final : public CompilationDependencies::Dependency { ...@@ -227,8 +214,7 @@ class FieldTypeDependency final : public CompilationDependencies::Dependency {
ObjectRef type_; ObjectRef type_;
}; };
class FieldConstnessDependency final class FieldConstnessDependency final : public CompilationDependency {
: public CompilationDependencies::Dependency {
public: public:
FieldConstnessDependency(const MapRef& owner, int descriptor) FieldConstnessDependency(const MapRef& owner, int descriptor)
: owner_(owner), descriptor_(descriptor) { : owner_(owner), descriptor_(descriptor) {
...@@ -255,8 +241,7 @@ class FieldConstnessDependency final ...@@ -255,8 +241,7 @@ class FieldConstnessDependency final
int descriptor_; int descriptor_;
}; };
class GlobalPropertyDependency final class GlobalPropertyDependency final : public CompilationDependency {
: public CompilationDependencies::Dependency {
public: public:
// TODO(neis): Once the concurrent compiler frontend is always-on, we no // TODO(neis): Once the concurrent compiler frontend is always-on, we no
// longer need to explicitly store the type and the read_only flag. // longer need to explicitly store the type and the read_only flag.
...@@ -294,7 +279,7 @@ class GlobalPropertyDependency final ...@@ -294,7 +279,7 @@ class GlobalPropertyDependency final
bool read_only_; bool read_only_;
}; };
class ProtectorDependency final : public CompilationDependencies::Dependency { class ProtectorDependency final : public CompilationDependency {
public: public:
explicit ProtectorDependency(const PropertyCellRef& cell) : cell_(cell) { explicit ProtectorDependency(const PropertyCellRef& cell) : cell_(cell) {
DCHECK_EQ(cell_.value().AsSmi(), Isolate::kProtectorValid); DCHECK_EQ(cell_.value().AsSmi(), Isolate::kProtectorValid);
...@@ -315,8 +300,7 @@ class ProtectorDependency final : public CompilationDependencies::Dependency { ...@@ -315,8 +300,7 @@ class ProtectorDependency final : public CompilationDependencies::Dependency {
PropertyCellRef cell_; PropertyCellRef cell_;
}; };
class ElementsKindDependency final class ElementsKindDependency final : public CompilationDependency {
: public CompilationDependencies::Dependency {
public: public:
// TODO(neis): Once the concurrent compiler frontend is always-on, we no // TODO(neis): Once the concurrent compiler frontend is always-on, we no
// longer need to explicitly store the elements kind. // longer need to explicitly store the elements kind.
...@@ -349,7 +333,7 @@ class ElementsKindDependency final ...@@ -349,7 +333,7 @@ class ElementsKindDependency final
}; };
class InitialMapInstanceSizePredictionDependency final class InitialMapInstanceSizePredictionDependency final
: public CompilationDependencies::Dependency { : public CompilationDependency {
public: public:
InitialMapInstanceSizePredictionDependency(const JSFunctionRef& function, InitialMapInstanceSizePredictionDependency(const JSFunctionRef& function,
int instance_size) int instance_size)
...@@ -380,7 +364,8 @@ class InitialMapInstanceSizePredictionDependency final ...@@ -380,7 +364,8 @@ class InitialMapInstanceSizePredictionDependency final
int instance_size_; int instance_size_;
}; };
void CompilationDependencies::RecordDependency(Dependency const* dependency) { void CompilationDependencies::RecordDependency(
CompilationDependency const* dependency) {
if (dependency != nullptr) dependencies_.push_front(dependency); if (dependency != nullptr) dependencies_.push_front(dependency);
} }
...@@ -640,7 +625,7 @@ CompilationDependencies::DependOnInitialMapInstanceSizePrediction( ...@@ -640,7 +625,7 @@ CompilationDependencies::DependOnInitialMapInstanceSizePrediction(
return SlackTrackingPrediction(initial_map, instance_size); return SlackTrackingPrediction(initial_map, instance_size);
} }
CompilationDependencies::Dependency const* CompilationDependency const*
CompilationDependencies::TransitionDependencyOffTheRecord( CompilationDependencies::TransitionDependencyOffTheRecord(
const MapRef& target_map) const { const MapRef& target_map) const {
if (target_map.CanBeDeprecated()) { if (target_map.CanBeDeprecated()) {
...@@ -651,7 +636,7 @@ CompilationDependencies::TransitionDependencyOffTheRecord( ...@@ -651,7 +636,7 @@ CompilationDependencies::TransitionDependencyOffTheRecord(
} }
} }
CompilationDependencies::Dependency const* CompilationDependency const*
CompilationDependencies::FieldRepresentationDependencyOffTheRecord( CompilationDependencies::FieldRepresentationDependencyOffTheRecord(
const MapRef& map, int descriptor) const { const MapRef& map, int descriptor) const {
MapRef owner = map.FindFieldOwner(descriptor); MapRef owner = map.FindFieldOwner(descriptor);
...@@ -662,7 +647,7 @@ CompilationDependencies::FieldRepresentationDependencyOffTheRecord( ...@@ -662,7 +647,7 @@ CompilationDependencies::FieldRepresentationDependencyOffTheRecord(
details.representation()); details.representation());
} }
CompilationDependencies::Dependency const* CompilationDependency const*
CompilationDependencies::FieldTypeDependencyOffTheRecord(const MapRef& map, CompilationDependencies::FieldTypeDependencyOffTheRecord(const MapRef& map,
int descriptor) const { int descriptor) const {
MapRef owner = map.FindFieldOwner(descriptor); MapRef owner = map.FindFieldOwner(descriptor);
......
...@@ -25,6 +25,8 @@ class SlackTrackingPrediction { ...@@ -25,6 +25,8 @@ class SlackTrackingPrediction {
int inobject_property_count_; int inobject_property_count_;
}; };
class CompilationDependency;
// Collects and installs dependencies of the code that is being generated. // Collects and installs dependencies of the code that is being generated.
class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject { class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject {
public: public:
...@@ -113,14 +115,13 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject { ...@@ -113,14 +115,13 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject {
// DependOnTransition(map); // DependOnTransition(map);
// is equivalent to: // is equivalent to:
// RecordDependency(TransitionDependencyOffTheRecord(map)); // RecordDependency(TransitionDependencyOffTheRecord(map));
class Dependency; void RecordDependency(CompilationDependency const* dependency);
void RecordDependency(Dependency const* dependency); CompilationDependency const* TransitionDependencyOffTheRecord(
Dependency const* TransitionDependencyOffTheRecord(
const MapRef& target_map) const; const MapRef& target_map) const;
Dependency const* FieldRepresentationDependencyOffTheRecord( CompilationDependency const* FieldRepresentationDependencyOffTheRecord(
const MapRef& map, int descriptor) const;
CompilationDependency const* FieldTypeDependencyOffTheRecord(
const MapRef& map, int descriptor) const; const MapRef& map, int descriptor) const;
Dependency const* FieldTypeDependencyOffTheRecord(const MapRef& map,
int descriptor) const;
// Exposed only for testing purposes. // Exposed only for testing purposes.
bool AreValid() const; bool AreValid() const;
...@@ -128,7 +129,7 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject { ...@@ -128,7 +129,7 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject {
private: private:
Zone* const zone_; Zone* const zone_;
JSHeapBroker* const broker_; JSHeapBroker* const broker_;
ZoneForwardList<Dependency const*> dependencies_; ZoneForwardList<CompilationDependency const*> dependencies_;
}; };
} // namespace compiler } // namespace compiler
......
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMPILER_COMPILATION_DEPENDENCY_H_
#define V8_COMPILER_COMPILATION_DEPENDENCY_H_
#include "src/zone/zone.h"
namespace v8 {
namespace internal {
class MaybeObjectHandle;
namespace compiler {
class CompilationDependency : public ZoneObject {
public:
virtual bool IsValid() const = 0;
virtual void PrepareInstall() const {}
virtual void Install(const MaybeObjectHandle& code) const = 0;
#ifdef DEBUG
virtual bool IsPretenureModeDependency() const { return false; }
#endif
};
} // namespace compiler
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_COMPILATION_DEPENDENCY_H_
This diff is collapsed.
...@@ -7260,6 +7260,10 @@ Isolate* JSCallReducer::isolate() const { return jsgraph()->isolate(); } ...@@ -7260,6 +7260,10 @@ Isolate* JSCallReducer::isolate() const { return jsgraph()->isolate(); }
Factory* JSCallReducer::factory() const { return isolate()->factory(); } Factory* JSCallReducer::factory() const { return isolate()->factory(); }
NativeContextRef JSCallReducer::native_context() const {
return broker()->native_context();
}
CommonOperatorBuilder* JSCallReducer::common() const { CommonOperatorBuilder* JSCallReducer::common() const {
return jsgraph()->common(); return jsgraph()->common();
} }
......
...@@ -251,7 +251,7 @@ class V8_EXPORT_PRIVATE JSCallReducer final : public AdvancedReducer { ...@@ -251,7 +251,7 @@ class V8_EXPORT_PRIVATE JSCallReducer final : public AdvancedReducer {
JSHeapBroker* broker() const { return broker_; } JSHeapBroker* broker() const { return broker_; }
Isolate* isolate() const; Isolate* isolate() const;
Factory* factory() const; Factory* factory() const;
NativeContextRef native_context() const { return broker()->native_context(); } NativeContextRef native_context() const;
CommonOperatorBuilder* common() const; CommonOperatorBuilder* common() const;
JSOperatorBuilder* javascript() const; JSOperatorBuilder* javascript() const;
SimplifiedOperatorBuilder* simplified() const; SimplifiedOperatorBuilder* simplified() const;
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "src/compiler/common-operator.h" #include "src/compiler/common-operator.h"
#include "src/compiler/js-graph.h" #include "src/compiler/js-graph.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/js-operator.h" #include "src/compiler/js-operator.h"
#include "src/compiler/linkage.h" #include "src/compiler/linkage.h"
#include "src/compiler/node-matchers.h" #include "src/compiler/node-matchers.h"
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "src/compiler/js-heap-broker.h" #include "src/compiler/js-heap-broker.h"
#include "src/compiler/heap-refs.h"
#ifdef ENABLE_SLOW_DCHECKS #ifdef ENABLE_SLOW_DCHECKS
#include <algorithm> #include <algorithm>
......
This diff is collapsed.
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "src/codegen/optimized-compilation-info.h" #include "src/codegen/optimized-compilation-info.h"
#include "src/compiler/common-operator.h" #include "src/compiler/common-operator.h"
#include "src/compiler/compiler-source-position-table.h" #include "src/compiler/compiler-source-position-table.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/node-matchers.h" #include "src/compiler/node-matchers.h"
#include "src/compiler/simplified-operator.h" #include "src/compiler/simplified-operator.h"
#include "src/objects/objects-inl.h" #include "src/objects/objects-inl.h"
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "src/compiler/common-operator.h" #include "src/compiler/common-operator.h"
#include "src/compiler/compiler-source-position-table.h" #include "src/compiler/compiler-source-position-table.h"
#include "src/compiler/graph-reducer.h" #include "src/compiler/graph-reducer.h"
#include "src/compiler/js-heap-broker.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"
#include "src/compiler/node-properties.h" #include "src/compiler/node-properties.h"
......
...@@ -2107,7 +2107,8 @@ JSNativeContextSpecialization::BuildPropertyLoad( ...@@ -2107,7 +2107,8 @@ JSNativeContextSpecialization::BuildPropertyLoad(
value = InlinePropertyGetterCall(receiver, context, frame_state, &effect, value = InlinePropertyGetterCall(receiver, context, frame_state, &effect,
&control, if_exceptions, access_info); &control, if_exceptions, access_info);
} else if (access_info.IsModuleExport()) { } else if (access_info.IsModuleExport()) {
Node* cell = jsgraph()->Constant(access_info.export_cell(broker())); Node* cell = jsgraph()->Constant(
ObjectRef(broker(), access_info.constant()).AsCell());
value = effect = value = effect =
graph()->NewNode(simplified()->LoadField(AccessBuilder::ForCellValue()), graph()->NewNode(simplified()->LoadField(AccessBuilder::ForCellValue()),
cell, effect, control); cell, effect, control);
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "src/base/flags.h" #include "src/base/flags.h"
#include "src/compiler/graph-reducer.h" #include "src/compiler/graph-reducer.h"
#include "src/compiler/js-heap-broker.h"
#include "src/deoptimizer/deoptimize-reason.h" #include "src/deoptimizer/deoptimize-reason.h"
#include "src/objects/map.h" #include "src/objects/map.h"
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "src/compiler/access-builder.h" #include "src/compiler/access-builder.h"
#include "src/compiler/allocation-builder.h" #include "src/compiler/allocation-builder.h"
#include "src/compiler/js-graph.h" #include "src/compiler/js-graph.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/linkage.h" #include "src/compiler/linkage.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"
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "src/compiler/node-properties.h" #include "src/compiler/node-properties.h"
#include "src/compiler/common-operator.h" #include "src/compiler/common-operator.h"
#include "src/compiler/graph.h" #include "src/compiler/graph.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/js-operator.h" #include "src/compiler/js-operator.h"
#include "src/compiler/linkage.h" #include "src/compiler/linkage.h"
#include "src/compiler/map-inference.h" #include "src/compiler/map-inference.h"
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "src/compiler/operation-typer.h" #include "src/compiler/operation-typer.h"
#include "src/compiler/common-operator.h" #include "src/compiler/common-operator.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/type-cache.h" #include "src/compiler/type-cache.h"
#include "src/compiler/types.h" #include "src/compiler/types.h"
#include "src/execution/isolate.h" #include "src/execution/isolate.h"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "src/base/compiler-specific.h" #include "src/base/compiler-specific.h"
#include "src/common/globals.h" #include "src/common/globals.h"
#include "src/compiler/js-heap-broker.h" #include "src/compiler/heap-refs.h"
#include "src/handles/handles.h" #include "src/handles/handles.h"
#include "src/numbers/conversions.h" #include "src/numbers/conversions.h"
#include "src/objects/objects.h" #include "src/objects/objects.h"
...@@ -220,6 +220,7 @@ namespace compiler { ...@@ -220,6 +220,7 @@ namespace compiler {
INTERNAL_BITSET_TYPE_LIST(V) \ INTERNAL_BITSET_TYPE_LIST(V) \
PROPER_BITSET_TYPE_LIST(V) PROPER_BITSET_TYPE_LIST(V)
class JSHeapBroker;
class HeapConstantType; class HeapConstantType;
class OtherNumberConstantType; class OtherNumberConstantType;
class TupleType; class TupleType;
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "src/compiler/access-info.h"
#include "src/compiler/compiler-source-position-table.h" #include "src/compiler/compiler-source-position-table.h"
#include "src/compiler/js-context-specialization.h" #include "src/compiler/js-context-specialization.h"
#include "src/compiler/js-graph.h" #include "src/compiler/js-graph.h"
#include "src/compiler/js-heap-broker.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"
#include "src/compiler/node-properties.h" #include "src/compiler/node-properties.h"
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "src/compiler/access-info.h"
#include "src/compiler/js-graph.h" #include "src/compiler/js-graph.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/js-typed-lowering.h" #include "src/compiler/js-typed-lowering.h"
#include "src/compiler/machine-operator.h" #include "src/compiler/machine-operator.h"
#include "src/compiler/node-properties.h" #include "src/compiler/node-properties.h"
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include <vector> #include <vector>
#include "src/compiler/access-info.h"
#include "src/compiler/types.h" #include "src/compiler/types.h"
#include "src/execution/isolate.h" #include "src/execution/isolate.h"
#include "src/heap/factory-inl.h" #include "src/heap/factory-inl.h"
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#define V8_TEST_CCTEST_TYPES_H_ #define V8_TEST_CCTEST_TYPES_H_
#include "src/base/utils/random-number-generator.h" #include "src/base/utils/random-number-generator.h"
#include "src/compiler/js-heap-broker.h"
#include "src/execution/isolate.h" #include "src/execution/isolate.h"
#include "src/heap/factory.h" #include "src/heap/factory.h"
#include "src/init/v8.h" #include "src/init/v8.h"
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "src/compiler/common-operator-reducer.h" #include "src/compiler/common-operator-reducer.h"
#include "src/codegen/machine-type.h" #include "src/codegen/machine-type.h"
#include "src/compiler/access-info.h"
#include "src/compiler/common-operator.h" #include "src/compiler/common-operator.h"
#include "src/compiler/machine-operator.h" #include "src/compiler/machine-operator.h"
#include "src/compiler/operator.h" #include "src/compiler/operator.h"
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "src/compiler/constant-folding-reducer.h" #include "src/compiler/constant-folding-reducer.h"
#include "src/codegen/code-factory.h" #include "src/codegen/code-factory.h"
#include "src/compiler/access-builder.h" #include "src/compiler/access-builder.h"
#include "src/compiler/access-info.h"
#include "src/compiler/compilation-dependencies.h" #include "src/compiler/compilation-dependencies.h"
#include "src/compiler/js-graph.h" #include "src/compiler/js-graph.h"
#include "src/compiler/js-operator.h" #include "src/compiler/js-operator.h"
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "test/unittests/compiler/graph-unittest.h" #include "test/unittests/compiler/graph-unittest.h"
#include "src/compiler/access-info.h"
#include "src/compiler/js-heap-copy-reducer.h" #include "src/compiler/js-heap-copy-reducer.h"
#include "src/compiler/node-properties.h" #include "src/compiler/node-properties.h"
#include "src/heap/factory.h" #include "src/heap/factory.h"
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "src/compiler/common-operator.h" #include "src/compiler/common-operator.h"
#include "src/compiler/compiler-source-position-table.h" #include "src/compiler/compiler-source-position-table.h"
#include "src/compiler/graph.h" #include "src/compiler/graph.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/node-origin-table.h" #include "src/compiler/node-origin-table.h"
#include "src/compiler/typer.h" #include "src/compiler/typer.h"
#include "src/handles/handles.h" #include "src/handles/handles.h"
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "src/compiler/simplified-operator-reducer.h" #include "src/compiler/simplified-operator-reducer.h"
#include "src/compiler/access-builder.h" #include "src/compiler/access-builder.h"
#include "src/compiler/access-info.h"
#include "src/compiler/js-graph.h" #include "src/compiler/js-graph.h"
#include "src/compiler/node-properties.h" #include "src/compiler/node-properties.h"
#include "src/compiler/simplified-operator.h" #include "src/compiler/simplified-operator.h"
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include <functional> #include <functional>
#include "src/base/overflowing-math.h" #include "src/base/overflowing-math.h"
#include "src/compiler/access-info.h"
#include "src/compiler/js-operator.h" #include "src/compiler/js-operator.h"
#include "src/compiler/node-properties.h" #include "src/compiler/node-properties.h"
#include "src/compiler/operator-properties.h" #include "src/compiler/operator-properties.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