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 @@
#include "src/builtins/accessors.h"
#include "src/compiler/compilation-dependencies.h"
#include "src/compiler/compilation-dependency.h"
#include "src/compiler/type-cache.h"
#include "src/ic/call-optimization.h"
#include "src/logging/counters.h"
......@@ -78,7 +79,7 @@ PropertyAccessInfo PropertyAccessInfo::NotFound(Zone* zone,
// static
PropertyAccessInfo PropertyAccessInfo::DataField(
Zone* zone, Handle<Map> receiver_map,
ZoneVector<CompilationDependencies::Dependency const*>&& dependencies,
ZoneVector<CompilationDependency const*>&& dependencies,
FieldIndex field_index, Representation field_representation,
Type field_type, MaybeHandle<Map> field_map, MaybeHandle<JSObject> holder,
MaybeHandle<Map> transition_map) {
......@@ -90,7 +91,7 @@ PropertyAccessInfo PropertyAccessInfo::DataField(
// static
PropertyAccessInfo PropertyAccessInfo::DataConstant(
Zone* zone, Handle<Map> receiver_map,
ZoneVector<CompilationDependencies::Dependency const*>&& dependencies,
ZoneVector<CompilationDependency const*>&& dependencies,
FieldIndex field_index, Representation field_representation,
Type field_type, MaybeHandle<Map> field_map, MaybeHandle<JSObject> holder,
MaybeHandle<Map> transition_map) {
......@@ -156,8 +157,7 @@ PropertyAccessInfo::PropertyAccessInfo(
FieldIndex field_index, Representation field_representation,
Type field_type, MaybeHandle<Map> field_map,
ZoneVector<Handle<Map>>&& receiver_maps,
ZoneVector<CompilationDependencies::Dependency const*>&&
unrecorded_dependencies)
ZoneVector<CompilationDependency const*>&& unrecorded_dependencies)
: kind_(kind),
receiver_maps_(receiver_maps),
unrecorded_dependencies_(std::move(unrecorded_dependencies)),
......@@ -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,
CompilationDependencies* dependencies,
Zone* zone)
......@@ -336,8 +331,7 @@ PropertyAccessInfo AccessInfoFactory::ComputeDataFieldAccessInfo(
Type field_type = Type::NonInternal();
MaybeHandle<Map> field_map;
MapRef map_ref(broker(), map);
ZoneVector<CompilationDependencies::Dependency const*>
unrecorded_dependencies(zone());
ZoneVector<CompilationDependency const*> unrecorded_dependencies(zone());
if (details_representation.IsSmi()) {
field_type = Type::SignedSmall();
map_ref.SerializeOwnDescriptor(descriptor);
......@@ -608,8 +602,7 @@ void AccessInfoFactory::ComputePropertyAccessInfos(
void PropertyAccessInfo::RecordDependencies(
CompilationDependencies* dependencies) {
for (CompilationDependencies::Dependency const* d :
unrecorded_dependencies_) {
for (CompilationDependency const* d : unrecorded_dependencies_) {
dependencies->RecordDependency(d);
}
unrecorded_dependencies_.clear();
......@@ -645,6 +638,8 @@ void AccessInfoFactory::MergePropertyAccessInfos(
CHECK(!result->empty());
}
Isolate* AccessInfoFactory::isolate() const { return broker()->isolate(); }
namespace {
Maybe<ElementsKind> GeneralizeElementsKind(ElementsKind this_kind,
......@@ -757,8 +752,7 @@ PropertyAccessInfo AccessInfoFactory::LookupTransition(
Type field_type = Type::NonInternal();
MaybeHandle<Map> field_map;
MapRef transition_map_ref(broker(), transition_map);
ZoneVector<CompilationDependencies::Dependency const*>
unrecorded_dependencies(zone());
ZoneVector<CompilationDependency const*> unrecorded_dependencies(zone());
if (details_representation.IsSmi()) {
field_type = Type::SignedSmall();
transition_map_ref.SerializeOwnDescriptor(number);
......
......@@ -8,7 +8,6 @@
#include <iosfwd>
#include "src/codegen/machine-type.h"
#include "src/compiler/compilation-dependencies.h"
#include "src/compiler/types.h"
#include "src/objects/feedback-vector.h"
#include "src/objects/field-index.h"
......@@ -25,8 +24,10 @@ class Factory;
namespace compiler {
// Forward declarations.
class CompilationDependencies;
class CompilationDependency;
class ElementAccessFeedback;
class Type;
class JSHeapBroker;
class TypeCache;
std::ostream& operator<<(std::ostream&, AccessMode);
......@@ -74,16 +75,14 @@ class PropertyAccessInfo final {
MaybeHandle<JSObject> holder);
static PropertyAccessInfo DataField(
Zone* zone, Handle<Map> receiver_map,
ZoneVector<CompilationDependencies::Dependency const*>&&
unrecorded_dependencies,
ZoneVector<CompilationDependency const*>&& unrecorded_dependencies,
FieldIndex field_index, Representation field_representation,
Type field_type, MaybeHandle<Map> field_map = MaybeHandle<Map>(),
MaybeHandle<JSObject> holder = MaybeHandle<JSObject>(),
MaybeHandle<Map> transition_map = MaybeHandle<Map>());
static PropertyAccessInfo DataConstant(
Zone* zone, Handle<Map> receiver_map,
ZoneVector<CompilationDependencies::Dependency const*>&&
unrecorded_dependencies,
ZoneVector<CompilationDependency const*>&& unrecorded_dependencies,
FieldIndex field_index, Representation field_representation,
Type field_type, MaybeHandle<Map> field_map, MaybeHandle<JSObject> holder,
MaybeHandle<Map> transition_map = MaybeHandle<Map>());
......@@ -127,7 +126,6 @@ class PropertyAccessInfo final {
ZoneVector<Handle<Map>> const& receiver_maps() const {
return receiver_maps_;
}
CellRef export_cell(JSHeapBroker* broker) const;
private:
explicit PropertyAccessInfo(Zone* zone);
......@@ -136,17 +134,16 @@ class PropertyAccessInfo final {
PropertyAccessInfo(Zone* zone, Kind kind, MaybeHandle<JSObject> holder,
Handle<Object> constant,
ZoneVector<Handle<Map>>&& receiver_maps);
PropertyAccessInfo(
Kind kind, MaybeHandle<JSObject> holder, MaybeHandle<Map> transition_map,
FieldIndex field_index, Representation field_representation,
Type field_type, MaybeHandle<Map> field_map,
ZoneVector<Handle<Map>>&& receiver_maps,
ZoneVector<CompilationDependencies::Dependency const*>&& dependencies);
PropertyAccessInfo(Kind kind, MaybeHandle<JSObject> holder,
MaybeHandle<Map> transition_map, FieldIndex field_index,
Representation field_representation, Type field_type,
MaybeHandle<Map> field_map,
ZoneVector<Handle<Map>>&& receiver_maps,
ZoneVector<CompilationDependency const*>&& dependencies);
Kind kind_;
ZoneVector<Handle<Map>> receiver_maps_;
ZoneVector<CompilationDependencies::Dependency const*>
unrecorded_dependencies_;
ZoneVector<CompilationDependency const*> unrecorded_dependencies_;
Handle<Object> constant_;
MaybeHandle<Map> transition_map_;
MaybeHandle<JSObject> holder_;
......@@ -215,7 +212,7 @@ class AccessInfoFactory final {
CompilationDependencies* dependencies() const { return dependencies_; }
JSHeapBroker* broker() const { return broker_; }
Isolate* isolate() const { return broker()->isolate(); }
Isolate* isolate() const;
Zone* zone() const { return zone_; }
JSHeapBroker* const broker_;
......
......@@ -9,6 +9,7 @@
#include "src/compiler/access-builder.h"
#include "src/compiler/bytecode-analysis.h"
#include "src/compiler/compiler-source-position-table.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/linkage.h"
#include "src/compiler/node-matchers.h"
#include "src/compiler/operator-properties.h"
......
......@@ -4,6 +4,7 @@
#include "src/compiler/compilation-dependencies.h"
#include "src/compiler/compilation-dependency.h"
#include "src/handles/handles-inl.h"
#include "src/objects/allocation-site-inl.h"
#include "src/objects/objects-inl.h"
......@@ -17,18 +18,7 @@ CompilationDependencies::CompilationDependencies(JSHeapBroker* broker,
Zone* zone)
: zone_(zone), broker_(broker), dependencies_(zone) {}
class CompilationDependencies::Dependency : 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
};
class InitialMapDependency final : public CompilationDependencies::Dependency {
class InitialMapDependency final : public CompilationDependency {
public:
// TODO(neis): Once the concurrent compiler frontend is always-on, we no
// longer need to explicitly store the initial map.
......@@ -56,8 +46,7 @@ class InitialMapDependency final : public CompilationDependencies::Dependency {
MapRef initial_map_;
};
class PrototypePropertyDependency final
: public CompilationDependencies::Dependency {
class PrototypePropertyDependency final : public CompilationDependency {
public:
// TODO(neis): Once the concurrent compiler frontend is always-on, we no
// longer need to explicitly store the prototype.
......@@ -96,7 +85,7 @@ class PrototypePropertyDependency final
ObjectRef prototype_;
};
class StableMapDependency final : public CompilationDependencies::Dependency {
class StableMapDependency final : public CompilationDependency {
public:
explicit StableMapDependency(const MapRef& map) : map_(map) {
DCHECK(map_.is_stable());
......@@ -114,7 +103,7 @@ class StableMapDependency final : public CompilationDependencies::Dependency {
MapRef map_;
};
class TransitionDependency final : public CompilationDependencies::Dependency {
class TransitionDependency final : public CompilationDependency {
public:
explicit TransitionDependency(const MapRef& map) : map_(map) {
DCHECK(!map_.is_deprecated());
......@@ -132,8 +121,7 @@ class TransitionDependency final : public CompilationDependencies::Dependency {
MapRef map_;
};
class PretenureModeDependency final
: public CompilationDependencies::Dependency {
class PretenureModeDependency final : public CompilationDependency {
public:
// TODO(neis): Once the concurrent compiler frontend is always-on, we no
// longer need to explicitly store the mode.
......@@ -163,8 +151,7 @@ class PretenureModeDependency final
AllocationType allocation_;
};
class FieldRepresentationDependency final
: public CompilationDependencies::Dependency {
class FieldRepresentationDependency final : public CompilationDependency {
public:
// TODO(neis): Once the concurrent compiler frontend is always-on, we no
// longer need to explicitly store the representation.
......@@ -197,7 +184,7 @@ class FieldRepresentationDependency final
Representation representation_;
};
class FieldTypeDependency final : public CompilationDependencies::Dependency {
class FieldTypeDependency final : public CompilationDependency {
public:
// TODO(neis): Once the concurrent compiler frontend is always-on, we no
// longer need to explicitly store the type.
......@@ -227,8 +214,7 @@ class FieldTypeDependency final : public CompilationDependencies::Dependency {
ObjectRef type_;
};
class FieldConstnessDependency final
: public CompilationDependencies::Dependency {
class FieldConstnessDependency final : public CompilationDependency {
public:
FieldConstnessDependency(const MapRef& owner, int descriptor)
: owner_(owner), descriptor_(descriptor) {
......@@ -255,8 +241,7 @@ class FieldConstnessDependency final
int descriptor_;
};
class GlobalPropertyDependency final
: public CompilationDependencies::Dependency {
class GlobalPropertyDependency final : public CompilationDependency {
public:
// TODO(neis): Once the concurrent compiler frontend is always-on, we no
// longer need to explicitly store the type and the read_only flag.
......@@ -294,7 +279,7 @@ class GlobalPropertyDependency final
bool read_only_;
};
class ProtectorDependency final : public CompilationDependencies::Dependency {
class ProtectorDependency final : public CompilationDependency {
public:
explicit ProtectorDependency(const PropertyCellRef& cell) : cell_(cell) {
DCHECK_EQ(cell_.value().AsSmi(), Isolate::kProtectorValid);
......@@ -315,8 +300,7 @@ class ProtectorDependency final : public CompilationDependencies::Dependency {
PropertyCellRef cell_;
};
class ElementsKindDependency final
: public CompilationDependencies::Dependency {
class ElementsKindDependency final : public CompilationDependency {
public:
// TODO(neis): Once the concurrent compiler frontend is always-on, we no
// longer need to explicitly store the elements kind.
......@@ -349,7 +333,7 @@ class ElementsKindDependency final
};
class InitialMapInstanceSizePredictionDependency final
: public CompilationDependencies::Dependency {
: public CompilationDependency {
public:
InitialMapInstanceSizePredictionDependency(const JSFunctionRef& function,
int instance_size)
......@@ -380,7 +364,8 @@ class InitialMapInstanceSizePredictionDependency final
int instance_size_;
};
void CompilationDependencies::RecordDependency(Dependency const* dependency) {
void CompilationDependencies::RecordDependency(
CompilationDependency const* dependency) {
if (dependency != nullptr) dependencies_.push_front(dependency);
}
......@@ -640,7 +625,7 @@ CompilationDependencies::DependOnInitialMapInstanceSizePrediction(
return SlackTrackingPrediction(initial_map, instance_size);
}
CompilationDependencies::Dependency const*
CompilationDependency const*
CompilationDependencies::TransitionDependencyOffTheRecord(
const MapRef& target_map) const {
if (target_map.CanBeDeprecated()) {
......@@ -651,7 +636,7 @@ CompilationDependencies::TransitionDependencyOffTheRecord(
}
}
CompilationDependencies::Dependency const*
CompilationDependency const*
CompilationDependencies::FieldRepresentationDependencyOffTheRecord(
const MapRef& map, int descriptor) const {
MapRef owner = map.FindFieldOwner(descriptor);
......@@ -662,7 +647,7 @@ CompilationDependencies::FieldRepresentationDependencyOffTheRecord(
details.representation());
}
CompilationDependencies::Dependency const*
CompilationDependency const*
CompilationDependencies::FieldTypeDependencyOffTheRecord(const MapRef& map,
int descriptor) const {
MapRef owner = map.FindFieldOwner(descriptor);
......
......@@ -25,6 +25,8 @@ class SlackTrackingPrediction {
int inobject_property_count_;
};
class CompilationDependency;
// Collects and installs dependencies of the code that is being generated.
class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject {
public:
......@@ -113,14 +115,13 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject {
// DependOnTransition(map);
// is equivalent to:
// RecordDependency(TransitionDependencyOffTheRecord(map));
class Dependency;
void RecordDependency(Dependency const* dependency);
Dependency const* TransitionDependencyOffTheRecord(
void RecordDependency(CompilationDependency const* dependency);
CompilationDependency const* TransitionDependencyOffTheRecord(
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;
Dependency const* FieldTypeDependencyOffTheRecord(const MapRef& map,
int descriptor) const;
// Exposed only for testing purposes.
bool AreValid() const;
......@@ -128,7 +129,7 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject {
private:
Zone* const zone_;
JSHeapBroker* const broker_;
ZoneForwardList<Dependency const*> dependencies_;
ZoneForwardList<CompilationDependency const*> dependencies_;
};
} // 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_
// 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_HEAP_REFS_H_
#define V8_COMPILER_HEAP_REFS_H_
#include "src/base/optional.h"
#include "src/ic/call-optimization.h"
#include "src/objects/elements-kind.h"
#include "src/objects/feedback-vector.h"
#include "src/objects/instance-type.h"
namespace v8 {
namespace internal {
class BytecodeArray;
class CallHandlerInfo;
class FixedDoubleArray;
class FunctionTemplateInfo;
class HeapNumber;
class InternalizedString;
class JSBoundFunction;
class JSDataView;
class JSGlobalProxy;
class JSRegExp;
class JSTypedArray;
class NativeContext;
class ScriptContextTable;
class VectorSlotPair;
namespace compiler {
// Whether we are loading a property or storing to a property.
// For a store during literal creation, do not walk up the prototype chain.
enum class AccessMode { kLoad, kStore, kStoreInLiteral, kHas };
enum class OddballType : uint8_t {
kNone, // Not an Oddball.
kBoolean, // True or False.
kUndefined,
kNull,
kHole,
kUninitialized,
kOther // Oddball, but none of the above.
};
// This list is sorted such that subtypes appear before their supertypes.
// DO NOT VIOLATE THIS PROPERTY!
#define HEAP_BROKER_OBJECT_LIST(V) \
/* Subtypes of JSObject */ \
V(JSArray) \
V(JSBoundFunction) \
V(JSDataView) \
V(JSFunction) \
V(JSGlobalProxy) \
V(JSRegExp) \
V(JSTypedArray) \
/* Subtypes of Context */ \
V(NativeContext) \
/* Subtypes of FixedArray */ \
V(Context) \
V(ScopeInfo) \
V(ScriptContextTable) \
/* Subtypes of FixedArrayBase */ \
V(BytecodeArray) \
V(FixedArray) \
V(FixedDoubleArray) \
/* Subtypes of Name */ \
V(InternalizedString) \
V(String) \
V(Symbol) \
/* Subtypes of HeapObject */ \
V(AllocationSite) \
V(CallHandlerInfo) \
V(Cell) \
V(Code) \
V(DescriptorArray) \
V(FeedbackCell) \
V(FeedbackVector) \
V(FixedArrayBase) \
V(FunctionTemplateInfo) \
V(HeapNumber) \
V(JSObject) \
V(Map) \
V(MutableHeapNumber) \
V(Name) \
V(PropertyCell) \
V(SharedFunctionInfo) \
V(SourceTextModule) \
/* Subtypes of Object */ \
V(HeapObject)
class CompilationDependencies;
class JSHeapBroker;
class ObjectData;
class PerIsolateCompilerCache;
class PropertyAccessInfo;
#define FORWARD_DECL(Name) class Name##Ref;
HEAP_BROKER_OBJECT_LIST(FORWARD_DECL)
#undef FORWARD_DECL
class V8_EXPORT_PRIVATE ObjectRef {
public:
ObjectRef(JSHeapBroker* broker, Handle<Object> object);
ObjectRef(JSHeapBroker* broker, ObjectData* data)
: data_(data), broker_(broker) {
CHECK_NOT_NULL(data_);
}
Handle<Object> object() const;
bool equals(const ObjectRef& other) const;
bool IsSmi() const;
int AsSmi() const;
#define HEAP_IS_METHOD_DECL(Name) bool Is##Name() const;
HEAP_BROKER_OBJECT_LIST(HEAP_IS_METHOD_DECL)
#undef HEAP_IS_METHOD_DECL
#define HEAP_AS_METHOD_DECL(Name) Name##Ref As##Name() const;
HEAP_BROKER_OBJECT_LIST(HEAP_AS_METHOD_DECL)
#undef HEAP_AS_METHOD_DECL
bool IsNullOrUndefined() const;
bool BooleanValue() const;
Maybe<double> OddballToNumber() const;
// Return the element at key {index} if {index} is known to be an own data
// property of the object that is non-writable and non-configurable.
base::Optional<ObjectRef> GetOwnConstantElement(uint32_t index,
bool serialize = false) const;
Isolate* isolate() const;
struct Hash {
size_t operator()(const ObjectRef& ref) const {
return base::hash_combine(ref.object().address());
}
};
struct Equal {
bool operator()(const ObjectRef& lhs, const ObjectRef& rhs) const {
return lhs.equals(rhs);
}
};
protected:
JSHeapBroker* broker() const;
ObjectData* data() const;
ObjectData* data_; // Should be used only by object() getters.
private:
friend class FunctionTemplateInfoRef;
friend class JSArrayData;
friend class JSGlobalProxyRef;
friend class JSGlobalProxyData;
friend class JSObjectData;
friend class StringData;
friend std::ostream& operator<<(std::ostream& os, const ObjectRef& ref);
JSHeapBroker* broker_;
};
// Temporary class that carries information from a Map. We'd like to remove
// this class and use MapRef instead, but we can't as long as we support the
// kDisabled broker mode. That's because obtaining the MapRef via
// HeapObjectRef::map() requires a HandleScope when the broker is disabled.
// During OptimizeGraph we generally don't have a HandleScope, however. There
// are two places where we therefore use GetHeapObjectType() instead. Both that
// function and this class should eventually be removed.
class HeapObjectType {
public:
enum Flag : uint8_t { kUndetectable = 1 << 0, kCallable = 1 << 1 };
using Flags = base::Flags<Flag>;
HeapObjectType(InstanceType instance_type, Flags flags,
OddballType oddball_type)
: instance_type_(instance_type),
oddball_type_(oddball_type),
flags_(flags) {
DCHECK_EQ(instance_type == ODDBALL_TYPE,
oddball_type != OddballType::kNone);
}
OddballType oddball_type() const { return oddball_type_; }
InstanceType instance_type() const { return instance_type_; }
Flags flags() const { return flags_; }
bool is_callable() const { return flags_ & kCallable; }
bool is_undetectable() const { return flags_ & kUndetectable; }
private:
InstanceType const instance_type_;
OddballType const oddball_type_;
Flags const flags_;
};
class HeapObjectRef : public ObjectRef {
public:
using ObjectRef::ObjectRef;
Handle<HeapObject> object() const;
MapRef map() const;
// See the comment on the HeapObjectType class.
HeapObjectType GetHeapObjectType() const;
};
class PropertyCellRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<PropertyCell> object() const;
PropertyDetails property_details() const;
void Serialize();
ObjectRef value() const;
};
class JSObjectRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<JSObject> object() const;
uint64_t RawFastDoublePropertyAsBitsAt(FieldIndex index) const;
double RawFastDoublePropertyAt(FieldIndex index) const;
ObjectRef RawFastPropertyAt(FieldIndex index) const;
FixedArrayBaseRef elements() const;
void SerializeElements();
void EnsureElementsTenured();
ElementsKind GetElementsKind() const;
void SerializeObjectCreateMap();
base::Optional<MapRef> GetObjectCreateMap() const;
};
class JSDataViewRef : public JSObjectRef {
public:
using JSObjectRef::JSObjectRef;
Handle<JSDataView> object() const;
size_t byte_length() const;
size_t byte_offset() const;
};
class JSBoundFunctionRef : public JSObjectRef {
public:
using JSObjectRef::JSObjectRef;
Handle<JSBoundFunction> object() const;
void Serialize();
// The following are available only after calling Serialize().
ObjectRef bound_target_function() const;
ObjectRef bound_this() const;
FixedArrayRef bound_arguments() const;
};
class V8_EXPORT_PRIVATE JSFunctionRef : public JSObjectRef {
public:
using JSObjectRef::JSObjectRef;
Handle<JSFunction> object() const;
bool has_feedback_vector() const;
bool has_initial_map() const;
bool has_prototype() const;
bool PrototypeRequiresRuntimeLookup() const;
void Serialize();
bool serialized() const;
// The following are available only after calling Serialize().
ObjectRef prototype() const;
MapRef initial_map() const;
ContextRef context() const;
NativeContextRef native_context() const;
SharedFunctionInfoRef shared() const;
FeedbackVectorRef feedback_vector() const;
int InitialMapInstanceSizeWithMinSlack() const;
bool IsSerializedForCompilation() const;
};
class JSRegExpRef : public JSObjectRef {
public:
using JSObjectRef::JSObjectRef;
Handle<JSRegExp> object() const;
ObjectRef raw_properties_or_hash() const;
ObjectRef data() const;
ObjectRef source() const;
ObjectRef flags() const;
ObjectRef last_index() const;
};
class HeapNumberRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<HeapNumber> object() const;
double value() const;
};
class MutableHeapNumberRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<MutableHeapNumber> object() const;
double value() const;
};
class ContextRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<Context> object() const;
void SerializeContextChain();
// {previous} decrements n by 1 for each previous link successfully
// followed. If depth != 0 on function return, then it only got
// partway to the desired depth.
ContextRef previous(size_t* depth) const;
void SerializeSlot(int index);
base::Optional<ObjectRef> get(int index) const;
// We only serialize the ScopeInfo if certain Promise
// builtins are called.
void SerializeScopeInfo();
base::Optional<ScopeInfoRef> scope_info() const;
};
#define BROKER_COMPULSORY_NATIVE_CONTEXT_FIELDS(V) \
V(JSFunction, array_function) \
V(JSFunction, boolean_function) \
V(JSFunction, bigint_function) \
V(JSFunction, number_function) \
V(JSFunction, object_function) \
V(JSFunction, promise_function) \
V(JSFunction, promise_then) \
V(JSFunction, string_function) \
V(JSFunction, symbol_function) \
V(JSGlobalProxy, global_proxy_object) \
V(JSObject, promise_prototype) \
V(Map, bound_function_with_constructor_map) \
V(Map, bound_function_without_constructor_map) \
V(Map, fast_aliased_arguments_map) \
V(Map, initial_array_iterator_map) \
V(Map, initial_string_iterator_map) \
V(Map, iterator_result_map) \
V(Map, js_array_holey_double_elements_map) \
V(Map, js_array_holey_elements_map) \
V(Map, js_array_holey_smi_elements_map) \
V(Map, js_array_packed_double_elements_map) \
V(Map, js_array_packed_elements_map) \
V(Map, js_array_packed_smi_elements_map) \
V(Map, sloppy_arguments_map) \
V(Map, slow_object_with_null_prototype_map) \
V(Map, strict_arguments_map) \
V(ScriptContextTable, script_context_table) \
V(SharedFunctionInfo, promise_capability_default_reject_shared_fun) \
V(SharedFunctionInfo, promise_catch_finally_shared_fun) \
V(SharedFunctionInfo, promise_then_finally_shared_fun) \
V(SharedFunctionInfo, promise_capability_default_resolve_shared_fun)
// Those are set by Bootstrapper::ExportFromRuntime, which may not yet have
// happened when Turbofan is invoked via --always-opt.
#define BROKER_OPTIONAL_NATIVE_CONTEXT_FIELDS(V) \
V(Map, async_function_object_map) \
V(Map, map_key_iterator_map) \
V(Map, map_key_value_iterator_map) \
V(Map, map_value_iterator_map) \
V(Map, set_key_value_iterator_map) \
V(Map, set_value_iterator_map)
#define BROKER_NATIVE_CONTEXT_FIELDS(V) \
BROKER_COMPULSORY_NATIVE_CONTEXT_FIELDS(V) \
BROKER_OPTIONAL_NATIVE_CONTEXT_FIELDS(V)
class NativeContextRef : public ContextRef {
public:
using ContextRef::ContextRef;
Handle<NativeContext> object() const;
void Serialize();
#define DECL_ACCESSOR(type, name) type##Ref name() const;
BROKER_NATIVE_CONTEXT_FIELDS(DECL_ACCESSOR)
#undef DECL_ACCESSOR
ScopeInfoRef scope_info() const;
MapRef GetFunctionMapFromIndex(int index) const;
MapRef GetInitialJSArrayMap(ElementsKind kind) const;
base::Optional<JSFunctionRef> GetConstructorFunction(const MapRef& map) const;
};
class NameRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<Name> object() const;
bool IsUniqueName() const;
};
class ScriptContextTableRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<ScriptContextTable> object() const;
struct LookupResult {
ContextRef context;
bool immutable;
int index;
};
base::Optional<LookupResult> lookup(const NameRef& name) const;
};
class DescriptorArrayRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<DescriptorArray> object() const;
};
class FeedbackCellRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<FeedbackCell> object() const;
HeapObjectRef value() const;
};
class FeedbackVectorRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<FeedbackVector> object() const;
ObjectRef get(FeedbackSlot slot) const;
void SerializeSlots();
};
class CallHandlerInfoRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<CallHandlerInfo> object() const;
Address callback() const;
void Serialize();
ObjectRef data() const;
};
class AllocationSiteRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<AllocationSite> object() const;
bool PointsToLiteral() const;
AllocationType GetAllocationType() const;
ObjectRef nested_site() const;
// {IsFastLiteral} determines whether the given array or object literal
// boilerplate satisfies all limits to be considered for fast deep-copying
// and computes the total size of all objects that are part of the graph.
//
// If PointsToLiteral() is false, then IsFastLiteral() is also false.
bool IsFastLiteral() const;
// We only serialize boilerplate if IsFastLiteral is true.
base::Optional<JSObjectRef> boilerplate() const;
ElementsKind GetElementsKind() const;
bool CanInlineCall() const;
};
class V8_EXPORT_PRIVATE MapRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<Map> object() const;
int instance_size() const;
InstanceType instance_type() const;
int GetInObjectProperties() const;
int GetInObjectPropertiesStartInWords() const;
int NumberOfOwnDescriptors() const;
int GetInObjectPropertyOffset(int index) const;
int constructor_function_index() const;
int NextFreePropertyIndex() const;
int UnusedPropertyFields() const;
ElementsKind elements_kind() const;
bool is_stable() const;
bool is_extensible() const;
bool is_constructor() const;
bool has_prototype_slot() const;
bool is_access_check_needed() const;
bool is_deprecated() const;
bool CanBeDeprecated() const;
bool CanTransition() const;
bool IsInobjectSlackTrackingInProgress() const;
bool is_dictionary_map() const;
bool IsFixedCowArrayMap() const;
bool IsPrimitiveMap() const;
bool is_undetectable() const;
bool is_callable() const;
bool has_indexed_interceptor() const;
bool is_migration_target() const;
bool supports_fast_array_iteration() const;
bool supports_fast_array_resize() const;
bool IsMapOfCurrentGlobalProxy() const;
OddballType oddball_type() const;
#define DEF_TESTER(Type, ...) bool Is##Type##Map() const;
INSTANCE_TYPE_CHECKERS(DEF_TESTER)
#undef DEF_TESTER
void SerializeBackPointer();
HeapObjectRef GetBackPointer() const;
void SerializePrototype();
bool serialized_prototype() const;
HeapObjectRef prototype() const;
void SerializeForElementLoad();
void SerializeForElementStore();
bool HasOnlyStablePrototypesWithFastElements(
ZoneVector<MapRef>* prototype_maps);
// Concerning the underlying instance_descriptors:
void SerializeOwnDescriptors();
void SerializeOwnDescriptor(int descriptor_index);
MapRef FindFieldOwner(int descriptor_index) const;
PropertyDetails GetPropertyDetails(int descriptor_index) const;
NameRef GetPropertyKey(int descriptor_index) const;
FieldIndex GetFieldIndexFor(int descriptor_index) const;
ObjectRef GetFieldType(int descriptor_index) const;
bool IsUnboxedDoubleField(int descriptor_index) const;
// Available after calling JSFunctionRef::Serialize on a function that has
// this map as initial map.
ObjectRef GetConstructor() const;
base::Optional<MapRef> AsElementsKind(ElementsKind kind) const;
};
struct HolderLookupResult {
HolderLookupResult(CallOptimization::HolderLookup lookup_ =
CallOptimization::kHolderNotFound,
base::Optional<JSObjectRef> holder_ = base::nullopt)
: lookup(lookup_), holder(holder_) {}
CallOptimization::HolderLookup lookup;
base::Optional<JSObjectRef> holder;
};
class FunctionTemplateInfoRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<FunctionTemplateInfo> object() const;
bool is_signature_undefined() const;
bool accept_any_receiver() const;
// The following returns true if the CallHandlerInfo is present.
bool has_call_code() const;
void SerializeCallCode();
base::Optional<CallHandlerInfoRef> call_code() const;
HolderLookupResult LookupHolderOfExpectedType(MapRef receiver_map,
bool serialize);
};
class FixedArrayBaseRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<FixedArrayBase> object() const;
int length() const;
};
class FixedArrayRef : public FixedArrayBaseRef {
public:
using FixedArrayBaseRef::FixedArrayBaseRef;
Handle<FixedArray> object() const;
ObjectRef get(int i) const;
};
class FixedDoubleArrayRef : public FixedArrayBaseRef {
public:
using FixedArrayBaseRef::FixedArrayBaseRef;
Handle<FixedDoubleArray> object() const;
double get_scalar(int i) const;
bool is_the_hole(int i) const;
};
class BytecodeArrayRef : public FixedArrayBaseRef {
public:
using FixedArrayBaseRef::FixedArrayBaseRef;
Handle<BytecodeArray> object() const;
int register_count() const;
int parameter_count() const;
interpreter::Register incoming_new_target_or_generator_register() const;
// Bytecode access methods.
uint8_t get(int index) const;
Address GetFirstBytecodeAddress() const;
// Constant pool access.
Handle<Object> GetConstantAtIndex(int index) const;
bool IsConstantAtIndexSmi(int index) const;
Smi GetConstantAtIndexAsSmi(int index) const;
bool IsSerializedForCompilation() const;
void SerializeForCompilation();
};
class JSArrayRef : public JSObjectRef {
public:
using JSObjectRef::JSObjectRef;
Handle<JSArray> object() const;
ObjectRef length() const;
// Return the element at key {index} if the array has a copy-on-write elements
// storage and {index} is known to be an own data property.
base::Optional<ObjectRef> GetOwnCowElement(uint32_t index,
bool serialize = false) const;
};
class ScopeInfoRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<ScopeInfo> object() const;
int ContextLength() const;
};
#define BROKER_SFI_FIELDS(V) \
V(int, internal_formal_parameter_count) \
V(bool, has_duplicate_parameters) \
V(int, function_map_index) \
V(FunctionKind, kind) \
V(LanguageMode, language_mode) \
V(bool, native) \
V(bool, HasBreakInfo) \
V(bool, HasBuiltinId) \
V(bool, construct_as_builtin) \
V(bool, HasBytecodeArray) \
V(bool, is_safe_to_skip_arguments_adaptor) \
V(bool, IsInlineable) \
V(bool, is_compiled)
class V8_EXPORT_PRIVATE SharedFunctionInfoRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<SharedFunctionInfo> object() const;
int builtin_id() const;
BytecodeArrayRef GetBytecodeArray() const;
#define DECL_ACCESSOR(type, name) type name() const;
BROKER_SFI_FIELDS(DECL_ACCESSOR)
#undef DECL_ACCESSOR
bool IsSerializedForCompilation(FeedbackVectorRef feedback) const;
void SetSerializedForCompilation(FeedbackVectorRef feedback);
void SerializeFunctionTemplateInfo();
base::Optional<FunctionTemplateInfoRef> function_template_info() const;
};
class StringRef : public NameRef {
public:
using NameRef::NameRef;
Handle<String> object() const;
int length() const;
uint16_t GetFirstChar();
base::Optional<double> ToNumber();
bool IsSeqString() const;
bool IsExternalString() const;
};
class SymbolRef : public NameRef {
public:
using NameRef::NameRef;
Handle<Symbol> object() const;
};
class JSTypedArrayRef : public JSObjectRef {
public:
using JSObjectRef::JSObjectRef;
Handle<JSTypedArray> object() const;
bool is_on_heap() const;
size_t length() const;
void* external_pointer() const;
void Serialize();
bool serialized() const;
HeapObjectRef buffer() const;
};
class SourceTextModuleRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<SourceTextModule> object() const;
void Serialize();
CellRef GetCell(int cell_index) const;
};
class CellRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<Cell> object() const;
ObjectRef value() const;
};
class JSGlobalProxyRef : public JSObjectRef {
public:
using JSObjectRef::JSObjectRef;
Handle<JSGlobalProxy> object() const;
// If {serialize} is false:
// If the property is known to exist as a property cell (on the global
// object), return that property cell. Otherwise (not known to exist as a
// property cell or known not to exist as a property cell) return nothing.
// If {serialize} is true:
// Like above but potentially access the heap and serialize the necessary
// information.
base::Optional<PropertyCellRef> GetPropertyCell(NameRef const& name,
bool serialize = false) const;
};
class CodeRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<Code> object() const;
};
class InternalizedStringRef : public StringRef {
public:
using StringRef::StringRef;
Handle<InternalizedString> object() const;
};
class ElementAccessFeedback;
class NamedAccessFeedback;
class ProcessedFeedback : public ZoneObject {
public:
enum Kind { kInsufficient, kGlobalAccess, kNamedAccess, kElementAccess };
Kind kind() const { return kind_; }
ElementAccessFeedback const* AsElementAccess() const;
NamedAccessFeedback const* AsNamedAccess() const;
protected:
explicit ProcessedFeedback(Kind kind) : kind_(kind) {}
private:
Kind const kind_;
};
class InsufficientFeedback final : public ProcessedFeedback {
public:
InsufficientFeedback();
};
class GlobalAccessFeedback : public ProcessedFeedback {
public:
explicit GlobalAccessFeedback(PropertyCellRef cell);
GlobalAccessFeedback(ContextRef script_context, int slot_index,
bool immutable);
bool IsPropertyCell() const;
PropertyCellRef property_cell() const;
bool IsScriptContextSlot() const { return !IsPropertyCell(); }
ContextRef script_context() const;
int slot_index() const;
bool immutable() const;
base::Optional<ObjectRef> GetConstantHint() const;
private:
ObjectRef const cell_or_context_;
int const index_and_immutable_;
};
class KeyedAccessMode {
public:
static KeyedAccessMode FromNexus(FeedbackNexus const& nexus);
AccessMode access_mode() const;
bool IsLoad() const;
bool IsStore() const;
KeyedAccessLoadMode load_mode() const;
KeyedAccessStoreMode store_mode() const;
private:
AccessMode const access_mode_;
union LoadStoreMode {
LoadStoreMode(KeyedAccessLoadMode load_mode);
LoadStoreMode(KeyedAccessStoreMode store_mode);
KeyedAccessLoadMode load_mode;
KeyedAccessStoreMode store_mode;
} const load_store_mode_;
KeyedAccessMode(AccessMode access_mode, KeyedAccessLoadMode load_mode);
KeyedAccessMode(AccessMode access_mode, KeyedAccessStoreMode store_mode);
};
class ElementAccessFeedback : public ProcessedFeedback {
public:
ElementAccessFeedback(Zone* zone, KeyedAccessMode const& keyed_mode);
// No transition sources appear in {receiver_maps}.
// All transition targets appear in {receiver_maps}.
ZoneVector<Handle<Map>> receiver_maps;
ZoneVector<std::pair<Handle<Map>, Handle<Map>>> transitions;
KeyedAccessMode const keyed_mode;
class MapIterator {
public:
bool done() const;
void advance();
MapRef current() const;
private:
friend class ElementAccessFeedback;
explicit MapIterator(ElementAccessFeedback const& processed,
JSHeapBroker* broker);
ElementAccessFeedback const& processed_;
JSHeapBroker* const broker_;
size_t index_ = 0;
};
// Iterator over all maps: first {receiver_maps}, then transition sources.
MapIterator all_maps(JSHeapBroker* broker) const;
};
class NamedAccessFeedback : public ProcessedFeedback {
public:
NamedAccessFeedback(NameRef const& name,
ZoneVector<PropertyAccessInfo> const& access_infos);
NameRef const& name() const { return name_; }
ZoneVector<PropertyAccessInfo> const& access_infos() const {
return access_infos_;
}
private:
NameRef const name_;
ZoneVector<PropertyAccessInfo> const access_infos_;
};
} // namespace compiler
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_HEAP_REFS_H_
......@@ -7260,6 +7260,10 @@ Isolate* JSCallReducer::isolate() const { return jsgraph()->isolate(); }
Factory* JSCallReducer::factory() const { return isolate()->factory(); }
NativeContextRef JSCallReducer::native_context() const {
return broker()->native_context();
}
CommonOperatorBuilder* JSCallReducer::common() const {
return jsgraph()->common();
}
......
......@@ -251,7 +251,7 @@ class V8_EXPORT_PRIVATE JSCallReducer final : public AdvancedReducer {
JSHeapBroker* broker() const { return broker_; }
Isolate* isolate() const;
Factory* factory() const;
NativeContextRef native_context() const { return broker()->native_context(); }
NativeContextRef native_context() const;
CommonOperatorBuilder* common() const;
JSOperatorBuilder* javascript() const;
SimplifiedOperatorBuilder* simplified() const;
......
......@@ -6,6 +6,7 @@
#include "src/compiler/common-operator.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/js-operator.h"
#include "src/compiler/linkage.h"
#include "src/compiler/node-matchers.h"
......
......@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/heap-refs.h"
#ifdef ENABLE_SLOW_DCHECKS
#include <algorithm>
......
......@@ -8,877 +8,23 @@
#include "src/base/compiler-specific.h"
#include "src/base/optional.h"
#include "src/common/globals.h"
#include "src/compiler/access-info.h"
#include "src/compiler/refs-map.h"
#include "src/handles/handles.h"
#include "src/ic/call-optimization.h"
#include "src/interpreter/bytecode-array-accessor.h"
#include "src/objects/feedback-vector.h"
#include "src/objects/function-kind.h"
#include "src/objects/instance-type.h"
#include "src/objects/objects.h"
#include "src/utils/ostreams.h"
#include "src/zone/zone-containers.h"
namespace v8 {
namespace internal {
class BytecodeArray;
class CallHandlerInfo;
class FixedDoubleArray;
class FunctionTemplateInfo;
class HeapNumber;
class InternalizedString;
class JSBoundFunction;
class JSDataView;
class JSGlobalProxy;
class JSRegExp;
class JSTypedArray;
class NativeContext;
class ScriptContextTable;
class VectorSlotPair;
namespace compiler {
// Whether we are loading a property or storing to a property.
// For a store during literal creation, do not walk up the prototype chain.
enum class AccessMode { kLoad, kStore, kStoreInLiteral, kHas };
enum class OddballType : uint8_t {
kNone, // Not an Oddball.
kBoolean, // True or False.
kUndefined,
kNull,
kHole,
kUninitialized,
kOther // Oddball, but none of the above.
};
// This list is sorted such that subtypes appear before their supertypes.
// DO NOT VIOLATE THIS PROPERTY!
#define HEAP_BROKER_OBJECT_LIST(V) \
/* Subtypes of JSObject */ \
V(JSArray) \
V(JSBoundFunction) \
V(JSDataView) \
V(JSFunction) \
V(JSGlobalProxy) \
V(JSRegExp) \
V(JSTypedArray) \
/* Subtypes of Context */ \
V(NativeContext) \
/* Subtypes of FixedArray */ \
V(Context) \
V(ScopeInfo) \
V(ScriptContextTable) \
/* Subtypes of FixedArrayBase */ \
V(BytecodeArray) \
V(FixedArray) \
V(FixedDoubleArray) \
/* Subtypes of Name */ \
V(InternalizedString) \
V(String) \
V(Symbol) \
/* Subtypes of HeapObject */ \
V(AllocationSite) \
V(CallHandlerInfo) \
V(Cell) \
V(Code) \
V(DescriptorArray) \
V(FeedbackCell) \
V(FeedbackVector) \
V(FixedArrayBase) \
V(FunctionTemplateInfo) \
V(HeapNumber) \
V(JSObject) \
V(Map) \
V(MutableHeapNumber) \
V(Name) \
V(PropertyCell) \
V(SharedFunctionInfo) \
V(SourceTextModule) \
/* Subtypes of Object */ \
V(HeapObject)
class CompilationDependencies;
class JSHeapBroker;
class ObjectData;
class PerIsolateCompilerCache;
class PropertyAccessInfo;
#define FORWARD_DECL(Name) class Name##Ref;
HEAP_BROKER_OBJECT_LIST(FORWARD_DECL)
#undef FORWARD_DECL
class V8_EXPORT_PRIVATE ObjectRef {
public:
ObjectRef(JSHeapBroker* broker, Handle<Object> object);
ObjectRef(JSHeapBroker* broker, ObjectData* data)
: data_(data), broker_(broker) {
CHECK_NOT_NULL(data_);
}
Handle<Object> object() const;
bool equals(const ObjectRef& other) const;
bool IsSmi() const;
int AsSmi() const;
#define HEAP_IS_METHOD_DECL(Name) bool Is##Name() const;
HEAP_BROKER_OBJECT_LIST(HEAP_IS_METHOD_DECL)
#undef HEAP_IS_METHOD_DECL
#define HEAP_AS_METHOD_DECL(Name) Name##Ref As##Name() const;
HEAP_BROKER_OBJECT_LIST(HEAP_AS_METHOD_DECL)
#undef HEAP_AS_METHOD_DECL
bool IsNullOrUndefined() const;
bool BooleanValue() const;
Maybe<double> OddballToNumber() const;
// Return the element at key {index} if {index} is known to be an own data
// property of the object that is non-writable and non-configurable.
base::Optional<ObjectRef> GetOwnConstantElement(uint32_t index,
bool serialize = false) const;
Isolate* isolate() const;
struct Hash {
size_t operator()(const ObjectRef& ref) const {
return base::hash_combine(ref.object().address());
}
};
struct Equal {
bool operator()(const ObjectRef& lhs, const ObjectRef& rhs) const {
return lhs.equals(rhs);
}
};
protected:
JSHeapBroker* broker() const;
ObjectData* data() const;
ObjectData* data_; // Should be used only by object() getters.
private:
friend class FunctionTemplateInfoRef;
friend class JSArrayData;
friend class JSGlobalProxyRef;
friend class JSGlobalProxyData;
friend class JSObjectData;
friend class StringData;
friend std::ostream& operator<<(std::ostream& os, const ObjectRef& ref);
JSHeapBroker* broker_;
};
class ObjectRef;
std::ostream& operator<<(std::ostream& os, const ObjectRef& ref);
// Temporary class that carries information from a Map. We'd like to remove
// this class and use MapRef instead, but we can't as long as we support the
// kDisabled broker mode. That's because obtaining the MapRef via
// HeapObjectRef::map() requires a HandleScope when the broker is disabled.
// During OptimizeGraph we generally don't have a HandleScope, however. There
// are two places where we therefore use GetHeapObjectType() instead. Both that
// function and this class should eventually be removed.
class HeapObjectType {
public:
enum Flag : uint8_t { kUndetectable = 1 << 0, kCallable = 1 << 1 };
using Flags = base::Flags<Flag>;
HeapObjectType(InstanceType instance_type, Flags flags,
OddballType oddball_type)
: instance_type_(instance_type),
oddball_type_(oddball_type),
flags_(flags) {
DCHECK_EQ(instance_type == ODDBALL_TYPE,
oddball_type != OddballType::kNone);
}
OddballType oddball_type() const { return oddball_type_; }
InstanceType instance_type() const { return instance_type_; }
Flags flags() const { return flags_; }
bool is_callable() const { return flags_ & kCallable; }
bool is_undetectable() const { return flags_ & kUndetectable; }
private:
InstanceType const instance_type_;
OddballType const oddball_type_;
Flags const flags_;
};
class HeapObjectRef : public ObjectRef {
public:
using ObjectRef::ObjectRef;
Handle<HeapObject> object() const;
MapRef map() const;
// See the comment on the HeapObjectType class.
HeapObjectType GetHeapObjectType() const;
};
class PropertyCellRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<PropertyCell> object() const;
PropertyDetails property_details() const;
void Serialize();
ObjectRef value() const;
};
class JSObjectRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<JSObject> object() const;
uint64_t RawFastDoublePropertyAsBitsAt(FieldIndex index) const;
double RawFastDoublePropertyAt(FieldIndex index) const;
ObjectRef RawFastPropertyAt(FieldIndex index) const;
FixedArrayBaseRef elements() const;
void SerializeElements();
void EnsureElementsTenured();
ElementsKind GetElementsKind() const;
void SerializeObjectCreateMap();
base::Optional<MapRef> GetObjectCreateMap() const;
};
class JSDataViewRef : public JSObjectRef {
public:
using JSObjectRef::JSObjectRef;
Handle<JSDataView> object() const;
size_t byte_length() const;
size_t byte_offset() const;
};
class JSBoundFunctionRef : public JSObjectRef {
public:
using JSObjectRef::JSObjectRef;
Handle<JSBoundFunction> object() const;
void Serialize();
// The following are available only after calling Serialize().
ObjectRef bound_target_function() const;
ObjectRef bound_this() const;
FixedArrayRef bound_arguments() const;
};
class V8_EXPORT_PRIVATE JSFunctionRef : public JSObjectRef {
public:
using JSObjectRef::JSObjectRef;
Handle<JSFunction> object() const;
bool has_feedback_vector() const;
bool has_initial_map() const;
bool has_prototype() const;
bool PrototypeRequiresRuntimeLookup() const;
void Serialize();
bool serialized() const;
// The following are available only after calling Serialize().
ObjectRef prototype() const;
MapRef initial_map() const;
ContextRef context() const;
NativeContextRef native_context() const;
SharedFunctionInfoRef shared() const;
FeedbackVectorRef feedback_vector() const;
int InitialMapInstanceSizeWithMinSlack() const;
bool IsSerializedForCompilation() const;
};
class JSRegExpRef : public JSObjectRef {
public:
using JSObjectRef::JSObjectRef;
Handle<JSRegExp> object() const;
ObjectRef raw_properties_or_hash() const;
ObjectRef data() const;
ObjectRef source() const;
ObjectRef flags() const;
ObjectRef last_index() const;
};
class HeapNumberRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<HeapNumber> object() const;
double value() const;
};
class MutableHeapNumberRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<MutableHeapNumber> object() const;
double value() const;
};
class ContextRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<Context> object() const;
void SerializeContextChain();
// {previous} decrements n by 1 for each previous link successfully
// followed. If depth != 0 on function return, then it only got
// partway to the desired depth.
ContextRef previous(size_t* depth) const;
void SerializeSlot(int index);
base::Optional<ObjectRef> get(int index) const;
// We only serialize the ScopeInfo if certain Promise
// builtins are called.
void SerializeScopeInfo();
base::Optional<ScopeInfoRef> scope_info() const;
};
#define BROKER_COMPULSORY_NATIVE_CONTEXT_FIELDS(V) \
V(JSFunction, array_function) \
V(JSFunction, boolean_function) \
V(JSFunction, bigint_function) \
V(JSFunction, number_function) \
V(JSFunction, object_function) \
V(JSFunction, promise_function) \
V(JSFunction, promise_then) \
V(JSFunction, string_function) \
V(JSFunction, symbol_function) \
V(JSGlobalProxy, global_proxy_object) \
V(JSObject, promise_prototype) \
V(Map, bound_function_with_constructor_map) \
V(Map, bound_function_without_constructor_map) \
V(Map, fast_aliased_arguments_map) \
V(Map, initial_array_iterator_map) \
V(Map, initial_string_iterator_map) \
V(Map, iterator_result_map) \
V(Map, js_array_holey_double_elements_map) \
V(Map, js_array_holey_elements_map) \
V(Map, js_array_holey_smi_elements_map) \
V(Map, js_array_packed_double_elements_map) \
V(Map, js_array_packed_elements_map) \
V(Map, js_array_packed_smi_elements_map) \
V(Map, sloppy_arguments_map) \
V(Map, slow_object_with_null_prototype_map) \
V(Map, strict_arguments_map) \
V(ScriptContextTable, script_context_table) \
V(SharedFunctionInfo, promise_capability_default_reject_shared_fun) \
V(SharedFunctionInfo, promise_catch_finally_shared_fun) \
V(SharedFunctionInfo, promise_then_finally_shared_fun) \
V(SharedFunctionInfo, promise_capability_default_resolve_shared_fun)
// Those are set by Bootstrapper::ExportFromRuntime, which may not yet have
// happened when Turbofan is invoked via --always-opt.
#define BROKER_OPTIONAL_NATIVE_CONTEXT_FIELDS(V) \
V(Map, async_function_object_map) \
V(Map, map_key_iterator_map) \
V(Map, map_key_value_iterator_map) \
V(Map, map_value_iterator_map) \
V(Map, set_key_value_iterator_map) \
V(Map, set_value_iterator_map)
#define BROKER_NATIVE_CONTEXT_FIELDS(V) \
BROKER_COMPULSORY_NATIVE_CONTEXT_FIELDS(V) \
BROKER_OPTIONAL_NATIVE_CONTEXT_FIELDS(V)
class NativeContextRef : public ContextRef {
public:
using ContextRef::ContextRef;
Handle<NativeContext> object() const;
void Serialize();
#define DECL_ACCESSOR(type, name) type##Ref name() const;
BROKER_NATIVE_CONTEXT_FIELDS(DECL_ACCESSOR)
#undef DECL_ACCESSOR
ScopeInfoRef scope_info() const;
MapRef GetFunctionMapFromIndex(int index) const;
MapRef GetInitialJSArrayMap(ElementsKind kind) const;
base::Optional<JSFunctionRef> GetConstructorFunction(const MapRef& map) const;
};
class NameRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<Name> object() const;
bool IsUniqueName() const;
};
class ScriptContextTableRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<ScriptContextTable> object() const;
struct LookupResult {
ContextRef context;
bool immutable;
int index;
};
base::Optional<LookupResult> lookup(const NameRef& name) const;
};
class DescriptorArrayRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<DescriptorArray> object() const;
};
class FeedbackCellRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<FeedbackCell> object() const;
HeapObjectRef value() const;
};
class FeedbackVectorRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<FeedbackVector> object() const;
ObjectRef get(FeedbackSlot slot) const;
void SerializeSlots();
};
class CallHandlerInfoRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<CallHandlerInfo> object() const;
Address callback() const;
void Serialize();
ObjectRef data() const;
};
class AllocationSiteRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<AllocationSite> object() const;
bool PointsToLiteral() const;
AllocationType GetAllocationType() const;
ObjectRef nested_site() const;
// {IsFastLiteral} determines whether the given array or object literal
// boilerplate satisfies all limits to be considered for fast deep-copying
// and computes the total size of all objects that are part of the graph.
//
// If PointsToLiteral() is false, then IsFastLiteral() is also false.
bool IsFastLiteral() const;
// We only serialize boilerplate if IsFastLiteral is true.
base::Optional<JSObjectRef> boilerplate() const;
ElementsKind GetElementsKind() const;
bool CanInlineCall() const;
};
class V8_EXPORT_PRIVATE MapRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<Map> object() const;
int instance_size() const;
InstanceType instance_type() const;
int GetInObjectProperties() const;
int GetInObjectPropertiesStartInWords() const;
int NumberOfOwnDescriptors() const;
int GetInObjectPropertyOffset(int index) const;
int constructor_function_index() const;
int NextFreePropertyIndex() const;
int UnusedPropertyFields() const;
ElementsKind elements_kind() const;
bool is_stable() const;
bool is_extensible() const;
bool is_constructor() const;
bool has_prototype_slot() const;
bool is_access_check_needed() const;
bool is_deprecated() const;
bool CanBeDeprecated() const;
bool CanTransition() const;
bool IsInobjectSlackTrackingInProgress() const;
bool is_dictionary_map() const;
bool IsFixedCowArrayMap() const;
bool IsPrimitiveMap() const;
bool is_undetectable() const;
bool is_callable() const;
bool has_indexed_interceptor() const;
bool is_migration_target() const;
bool supports_fast_array_iteration() const;
bool supports_fast_array_resize() const;
bool IsMapOfCurrentGlobalProxy() const;
OddballType oddball_type() const;
#define DEF_TESTER(Type, ...) bool Is##Type##Map() const;
INSTANCE_TYPE_CHECKERS(DEF_TESTER)
#undef DEF_TESTER
void SerializeBackPointer();
HeapObjectRef GetBackPointer() const;
void SerializePrototype();
bool serialized_prototype() const;
HeapObjectRef prototype() const;
void SerializeForElementLoad();
void SerializeForElementStore();
bool HasOnlyStablePrototypesWithFastElements(
ZoneVector<MapRef>* prototype_maps);
// Concerning the underlying instance_descriptors:
void SerializeOwnDescriptors();
void SerializeOwnDescriptor(int descriptor_index);
MapRef FindFieldOwner(int descriptor_index) const;
PropertyDetails GetPropertyDetails(int descriptor_index) const;
NameRef GetPropertyKey(int descriptor_index) const;
FieldIndex GetFieldIndexFor(int descriptor_index) const;
ObjectRef GetFieldType(int descriptor_index) const;
bool IsUnboxedDoubleField(int descriptor_index) const;
// Available after calling JSFunctionRef::Serialize on a function that has
// this map as initial map.
ObjectRef GetConstructor() const;
base::Optional<MapRef> AsElementsKind(ElementsKind kind) const;
};
struct HolderLookupResult {
HolderLookupResult(CallOptimization::HolderLookup lookup_ =
CallOptimization::kHolderNotFound,
base::Optional<JSObjectRef> holder_ = base::nullopt)
: lookup(lookup_), holder(holder_) {}
CallOptimization::HolderLookup lookup;
base::Optional<JSObjectRef> holder;
};
class FunctionTemplateInfoRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<FunctionTemplateInfo> object() const;
bool is_signature_undefined() const;
bool accept_any_receiver() const;
// The following returns true if the CallHandlerInfo is present.
bool has_call_code() const;
void SerializeCallCode();
base::Optional<CallHandlerInfoRef> call_code() const;
HolderLookupResult LookupHolderOfExpectedType(MapRef receiver_map,
bool serialize);
};
class FixedArrayBaseRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<FixedArrayBase> object() const;
int length() const;
};
class FixedArrayRef : public FixedArrayBaseRef {
public:
using FixedArrayBaseRef::FixedArrayBaseRef;
Handle<FixedArray> object() const;
ObjectRef get(int i) const;
};
class FixedDoubleArrayRef : public FixedArrayBaseRef {
public:
using FixedArrayBaseRef::FixedArrayBaseRef;
Handle<FixedDoubleArray> object() const;
double get_scalar(int i) const;
bool is_the_hole(int i) const;
};
class BytecodeArrayRef : public FixedArrayBaseRef {
public:
using FixedArrayBaseRef::FixedArrayBaseRef;
Handle<BytecodeArray> object() const;
int register_count() const;
int parameter_count() const;
interpreter::Register incoming_new_target_or_generator_register() const;
// Bytecode access methods.
uint8_t get(int index) const;
Address GetFirstBytecodeAddress() const;
// Constant pool access.
Handle<Object> GetConstantAtIndex(int index) const;
bool IsConstantAtIndexSmi(int index) const;
Smi GetConstantAtIndexAsSmi(int index) const;
bool IsSerializedForCompilation() const;
void SerializeForCompilation();
};
class JSArrayRef : public JSObjectRef {
public:
using JSObjectRef::JSObjectRef;
Handle<JSArray> object() const;
ObjectRef length() const;
// Return the element at key {index} if the array has a copy-on-write elements
// storage and {index} is known to be an own data property.
base::Optional<ObjectRef> GetOwnCowElement(uint32_t index,
bool serialize = false) const;
};
class ScopeInfoRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<ScopeInfo> object() const;
int ContextLength() const;
};
#define BROKER_SFI_FIELDS(V) \
V(int, internal_formal_parameter_count) \
V(bool, has_duplicate_parameters) \
V(int, function_map_index) \
V(FunctionKind, kind) \
V(LanguageMode, language_mode) \
V(bool, native) \
V(bool, HasBreakInfo) \
V(bool, HasBuiltinId) \
V(bool, construct_as_builtin) \
V(bool, HasBytecodeArray) \
V(bool, is_safe_to_skip_arguments_adaptor) \
V(bool, IsInlineable) \
V(bool, is_compiled)
class V8_EXPORT_PRIVATE SharedFunctionInfoRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<SharedFunctionInfo> object() const;
int builtin_id() const;
BytecodeArrayRef GetBytecodeArray() const;
#define DECL_ACCESSOR(type, name) type name() const;
BROKER_SFI_FIELDS(DECL_ACCESSOR)
#undef DECL_ACCESSOR
bool IsSerializedForCompilation(FeedbackVectorRef feedback) const;
void SetSerializedForCompilation(FeedbackVectorRef feedback);
void SerializeFunctionTemplateInfo();
base::Optional<FunctionTemplateInfoRef> function_template_info() const;
};
class StringRef : public NameRef {
public:
using NameRef::NameRef;
Handle<String> object() const;
int length() const;
uint16_t GetFirstChar();
base::Optional<double> ToNumber();
bool IsSeqString() const;
bool IsExternalString() const;
};
class SymbolRef : public NameRef {
public:
using NameRef::NameRef;
Handle<Symbol> object() const;
};
class JSTypedArrayRef : public JSObjectRef {
public:
using JSObjectRef::JSObjectRef;
Handle<JSTypedArray> object() const;
bool is_on_heap() const;
size_t length() const;
void* external_pointer() const;
void Serialize();
bool serialized() const;
HeapObjectRef buffer() const;
};
class SourceTextModuleRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<SourceTextModule> object() const;
void Serialize();
CellRef GetCell(int cell_index) const;
};
class CellRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<Cell> object() const;
ObjectRef value() const;
};
class JSGlobalProxyRef : public JSObjectRef {
public:
using JSObjectRef::JSObjectRef;
Handle<JSGlobalProxy> object() const;
// If {serialize} is false:
// If the property is known to exist as a property cell (on the global
// object), return that property cell. Otherwise (not known to exist as a
// property cell or known not to exist as a property cell) return nothing.
// If {serialize} is true:
// Like above but potentially access the heap and serialize the necessary
// information.
base::Optional<PropertyCellRef> GetPropertyCell(NameRef const& name,
bool serialize = false) const;
};
class CodeRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
Handle<Code> object() const;
};
class InternalizedStringRef : public StringRef {
public:
using StringRef::StringRef;
Handle<InternalizedString> object() const;
};
class ElementAccessFeedback;
class NamedAccessFeedback;
class ProcessedFeedback : public ZoneObject {
public:
enum Kind { kInsufficient, kGlobalAccess, kNamedAccess, kElementAccess };
Kind kind() const { return kind_; }
ElementAccessFeedback const* AsElementAccess() const;
NamedAccessFeedback const* AsNamedAccess() const;
protected:
explicit ProcessedFeedback(Kind kind) : kind_(kind) {}
private:
Kind const kind_;
};
class InsufficientFeedback final : public ProcessedFeedback {
public:
InsufficientFeedback();
};
class GlobalAccessFeedback : public ProcessedFeedback {
public:
explicit GlobalAccessFeedback(PropertyCellRef cell);
GlobalAccessFeedback(ContextRef script_context, int slot_index,
bool immutable);
bool IsPropertyCell() const;
PropertyCellRef property_cell() const;
bool IsScriptContextSlot() const { return !IsPropertyCell(); }
ContextRef script_context() const;
int slot_index() const;
bool immutable() const;
base::Optional<ObjectRef> GetConstantHint() const;
private:
ObjectRef const cell_or_context_;
int const index_and_immutable_;
};
class KeyedAccessMode {
public:
static KeyedAccessMode FromNexus(FeedbackNexus const& nexus);
AccessMode access_mode() const;
bool IsLoad() const;
bool IsStore() const;
KeyedAccessLoadMode load_mode() const;
KeyedAccessStoreMode store_mode() const;
private:
AccessMode const access_mode_;
union LoadStoreMode {
LoadStoreMode(KeyedAccessLoadMode load_mode);
LoadStoreMode(KeyedAccessStoreMode store_mode);
KeyedAccessLoadMode load_mode;
KeyedAccessStoreMode store_mode;
} const load_store_mode_;
KeyedAccessMode(AccessMode access_mode, KeyedAccessLoadMode load_mode);
KeyedAccessMode(AccessMode access_mode, KeyedAccessStoreMode store_mode);
};
class ElementAccessFeedback : public ProcessedFeedback {
public:
ElementAccessFeedback(Zone* zone, KeyedAccessMode const& keyed_mode);
// No transition sources appear in {receiver_maps}.
// All transition targets appear in {receiver_maps}.
ZoneVector<Handle<Map>> receiver_maps;
ZoneVector<std::pair<Handle<Map>, Handle<Map>>> transitions;
KeyedAccessMode const keyed_mode;
class MapIterator {
public:
bool done() const;
void advance();
MapRef current() const;
private:
friend class ElementAccessFeedback;
explicit MapIterator(ElementAccessFeedback const& processed,
JSHeapBroker* broker);
ElementAccessFeedback const& processed_;
JSHeapBroker* const broker_;
size_t index_ = 0;
};
// Iterator over all maps: first {receiver_maps}, then transition sources.
MapIterator all_maps(JSHeapBroker* broker) const;
};
class NamedAccessFeedback : public ProcessedFeedback {
public:
NamedAccessFeedback(NameRef const& name,
ZoneVector<PropertyAccessInfo> const& access_infos);
NameRef const& name() const { return name_; }
ZoneVector<PropertyAccessInfo> const& access_infos() const {
return access_infos_;
}
private:
NameRef const name_;
ZoneVector<PropertyAccessInfo> const access_infos_;
};
struct FeedbackSource {
FeedbackSource(Handle<FeedbackVector> vector_, FeedbackSlot slot_)
: vector(vector_), slot(slot_) {}
......
......@@ -7,6 +7,7 @@
#include "src/codegen/optimized-compilation-info.h"
#include "src/compiler/common-operator.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/simplified-operator.h"
#include "src/objects/objects-inl.h"
......
......@@ -12,6 +12,7 @@
#include "src/compiler/common-operator.h"
#include "src/compiler/compiler-source-position-table.h"
#include "src/compiler/graph-reducer.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/js-operator.h"
#include "src/compiler/node-matchers.h"
#include "src/compiler/node-properties.h"
......
......@@ -2107,7 +2107,8 @@ JSNativeContextSpecialization::BuildPropertyLoad(
value = InlinePropertyGetterCall(receiver, context, frame_state, &effect,
&control, if_exceptions, access_info);
} 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 =
graph()->NewNode(simplified()->LoadField(AccessBuilder::ForCellValue()),
cell, effect, control);
......
......@@ -7,6 +7,7 @@
#include "src/base/flags.h"
#include "src/compiler/graph-reducer.h"
#include "src/compiler/js-heap-broker.h"
#include "src/deoptimizer/deoptimize-reason.h"
#include "src/objects/map.h"
......
......@@ -10,6 +10,7 @@
#include "src/compiler/access-builder.h"
#include "src/compiler/allocation-builder.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/linkage.h"
#include "src/compiler/node-matchers.h"
#include "src/compiler/node-properties.h"
......
......@@ -5,6 +5,7 @@
#include "src/compiler/node-properties.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/graph.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/js-operator.h"
#include "src/compiler/linkage.h"
#include "src/compiler/map-inference.h"
......
......@@ -5,6 +5,7 @@
#include "src/compiler/operation-typer.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/type-cache.h"
#include "src/compiler/types.h"
#include "src/execution/isolate.h"
......
......@@ -7,7 +7,7 @@
#include "src/base/compiler-specific.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/numbers/conversions.h"
#include "src/objects/objects.h"
......@@ -220,6 +220,7 @@ namespace compiler {
INTERNAL_BITSET_TYPE_LIST(V) \
PROPER_BITSET_TYPE_LIST(V)
class JSHeapBroker;
class HeapConstantType;
class OtherNumberConstantType;
class TupleType;
......
......@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler/access-info.h"
#include "src/compiler/compiler-source-position-table.h"
#include "src/compiler/js-context-specialization.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/js-operator.h"
#include "src/compiler/node-matchers.h"
#include "src/compiler/node-properties.h"
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler/access-info.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/js-typed-lowering.h"
#include "src/compiler/machine-operator.h"
#include "src/compiler/node-properties.h"
......
......@@ -4,7 +4,6 @@
#include <vector>
#include "src/compiler/access-info.h"
#include "src/compiler/types.h"
#include "src/execution/isolate.h"
#include "src/heap/factory-inl.h"
......
......@@ -29,6 +29,7 @@
#define V8_TEST_CCTEST_TYPES_H_
#include "src/base/utils/random-number-generator.h"
#include "src/compiler/js-heap-broker.h"
#include "src/execution/isolate.h"
#include "src/heap/factory.h"
#include "src/init/v8.h"
......
......@@ -4,7 +4,6 @@
#include "src/compiler/common-operator-reducer.h"
#include "src/codegen/machine-type.h"
#include "src/compiler/access-info.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/machine-operator.h"
#include "src/compiler/operator.h"
......
......@@ -5,7 +5,6 @@
#include "src/compiler/constant-folding-reducer.h"
#include "src/codegen/code-factory.h"
#include "src/compiler/access-builder.h"
#include "src/compiler/access-info.h"
#include "src/compiler/compilation-dependencies.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/js-operator.h"
......
......@@ -4,7 +4,6 @@
#include "test/unittests/compiler/graph-unittest.h"
#include "src/compiler/access-info.h"
#include "src/compiler/js-heap-copy-reducer.h"
#include "src/compiler/node-properties.h"
#include "src/heap/factory.h"
......
......@@ -8,6 +8,7 @@
#include "src/compiler/common-operator.h"
#include "src/compiler/compiler-source-position-table.h"
#include "src/compiler/graph.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/node-origin-table.h"
#include "src/compiler/typer.h"
#include "src/handles/handles.h"
......
......@@ -4,7 +4,6 @@
#include "src/compiler/simplified-operator-reducer.h"
#include "src/compiler/access-builder.h"
#include "src/compiler/access-info.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/node-properties.h"
#include "src/compiler/simplified-operator.h"
......
......@@ -5,7 +5,6 @@
#include <functional>
#include "src/base/overflowing-math.h"
#include "src/compiler/access-info.h"
#include "src/compiler/js-operator.h"
#include "src/compiler/node-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