Commit 73b3bb58 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[turbofan] Brokerize CompilationDependencies.

Bug: v8:7790
Change-Id: I747dccb8dcae74c5c0837c0cd7f3dd285a4bd9c0
Reviewed-on: https://chromium-review.googlesource.com/1140304Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54497}
parent 64517a23
...@@ -237,11 +237,11 @@ Handle<Cell> PropertyAccessInfo::export_cell() const { ...@@ -237,11 +237,11 @@ Handle<Cell> PropertyAccessInfo::export_cell() const {
return Handle<Cell>::cast(constant_); return Handle<Cell>::cast(constant_);
} }
AccessInfoFactory::AccessInfoFactory(CompilationDependencies* dependencies, AccessInfoFactory::AccessInfoFactory(const JSHeapBroker* js_heap_broker,
const JSHeapBroker* js_heap_broker, CompilationDependencies* dependencies,
Handle<Context> native_context, Zone* zone) Handle<Context> native_context, Zone* zone)
: dependencies_(dependencies), : js_heap_broker_(js_heap_broker),
js_heap_broker_(js_heap_broker), dependencies_(dependencies),
native_context_(native_context), native_context_(native_context),
isolate_(native_context->GetIsolate()), isolate_(native_context->GetIsolate()),
type_cache_(TypeCache::Get()), type_cache_(TypeCache::Get()),
...@@ -396,7 +396,8 @@ bool AccessInfoFactory::ComputePropertyAccessInfo( ...@@ -396,7 +396,8 @@ bool AccessInfoFactory::ComputePropertyAccessInfo(
// The field type was cleared by the GC, so we don't know anything // The field type was cleared by the GC, so we don't know anything
// about the contents now. // about the contents now.
} else if (descriptors_field_type->IsClass()) { } else if (descriptors_field_type->IsClass()) {
dependencies()->DependOnFieldType(map, number); dependencies()->DependOnFieldType(MapRef(js_heap_broker(), map),
number);
// Remember the field map, and try to infer a useful type. // Remember the field map, and try to infer a useful type.
field_type = Type::For(js_heap_broker(), field_type = Type::For(js_heap_broker(),
descriptors_field_type->AsClass()); descriptors_field_type->AsClass());
...@@ -699,14 +700,15 @@ bool AccessInfoFactory::LookupTransition(Handle<Map> map, Handle<Name> name, ...@@ -699,14 +700,15 @@ bool AccessInfoFactory::LookupTransition(Handle<Map> map, Handle<Name> name,
// Store is not safe if the field type was cleared. // Store is not safe if the field type was cleared.
return false; return false;
} else if (descriptors_field_type->IsClass()) { } else if (descriptors_field_type->IsClass()) {
dependencies()->DependOnFieldType(transition_map, number); dependencies()->DependOnFieldType(
MapRef(js_heap_broker(), transition_map), number);
// Remember the field map, and try to infer a useful type. // Remember the field map, and try to infer a useful type.
field_type = field_type =
Type::For(js_heap_broker(), descriptors_field_type->AsClass()); Type::For(js_heap_broker(), descriptors_field_type->AsClass());
field_map = descriptors_field_type->AsClass(); field_map = descriptors_field_type->AsClass();
} }
} }
dependencies()->DependOnTransition(transition_map); dependencies()->DependOnTransition(MapRef(js_heap_broker(), transition_map));
// Transitioning stores are never stores to constant fields. // Transitioning stores are never stores to constant fields.
*access_info = PropertyAccessInfo::DataField( *access_info = PropertyAccessInfo::DataField(
PropertyConstness::kMutable, MapHandles{map}, field_index, PropertyConstness::kMutable, MapHandles{map}, field_index,
......
...@@ -140,8 +140,9 @@ class PropertyAccessInfo final { ...@@ -140,8 +140,9 @@ class PropertyAccessInfo final {
// Factory class for {ElementAccessInfo}s and {PropertyAccessInfo}s. // Factory class for {ElementAccessInfo}s and {PropertyAccessInfo}s.
class AccessInfoFactory final { class AccessInfoFactory final {
public: public:
AccessInfoFactory(CompilationDependencies* dependencies, AccessInfoFactory(const JSHeapBroker* js_heap_broker,
const JSHeapBroker* js_heap_broker, CompilationDependencies* dependencies,
Handle<Context> native_context, Zone* zone); Handle<Context> native_context, Zone* zone);
bool ComputeElementAccessInfo(Handle<Map> map, AccessMode access_mode, bool ComputeElementAccessInfo(Handle<Map> map, AccessMode access_mode,
...@@ -174,8 +175,8 @@ class AccessInfoFactory final { ...@@ -174,8 +175,8 @@ class AccessInfoFactory final {
Handle<Context> native_context() const { return native_context_; } Handle<Context> native_context() const { return native_context_; }
Zone* zone() const { return zone_; } Zone* zone() const { return zone_; }
CompilationDependencies* const dependencies_;
const JSHeapBroker* const js_heap_broker_; const JSHeapBroker* const js_heap_broker_;
CompilationDependencies* const dependencies_;
Handle<Context> const native_context_; Handle<Context> const native_context_;
Isolate* const isolate_; Isolate* const isolate_;
TypeCache const& type_cache_; TypeCache const& type_cache_;
......
This diff is collapsed.
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef V8_COMPILER_COMPILATION_DEPENDENCIES_H_ #ifndef V8_COMPILER_COMPILATION_DEPENDENCIES_H_
#define V8_COMPILER_COMPILATION_DEPENDENCIES_H_ #define V8_COMPILER_COMPILATION_DEPENDENCIES_H_
#include "src/compiler/js-heap-broker.h"
#include "src/objects.h" #include "src/objects.h"
#include "src/zone/zone-containers.h" #include "src/zone/zone-containers.h"
...@@ -21,42 +22,42 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject { ...@@ -21,42 +22,42 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject {
// Return the initial map of {function} and record the assumption that it // Return the initial map of {function} and record the assumption that it
// stays the intial map. // stays the intial map.
Handle<Map> DependOnInitialMap(Handle<JSFunction> function); MapRef DependOnInitialMap(const JSFunctionRef& function);
// Record the assumption that {map} stays stable. // Record the assumption that {map} stays stable.
void DependOnStableMap(Handle<Map> map); void DependOnStableMap(const MapRef& map);
// Record the assumption that {target_map} can be transitioned to, i.e., that // Record the assumption that {target_map} can be transitioned to, i.e., that
// it does not become deprecated. // it does not become deprecated.
void DependOnTransition(Handle<Map> target_map); void DependOnTransition(const MapRef& target_map);
// Return the pretenure mode of {site} and record the assumption that it does // Return the pretenure mode of {site} and record the assumption that it does
// not change. // not change.
PretenureFlag DependOnPretenureMode(Handle<AllocationSite> site); PretenureFlag DependOnPretenureMode(const AllocationSiteRef& site);
// Record the assumption that the field type of a field does not change. The // Record the assumption that the field type of a field does not change. The
// field is identified by the argument(s). // field is identified by the arguments.
void DependOnFieldType(Handle<Map> map, int descriptor); void DependOnFieldType(const MapRef& map, int descriptor);
void DependOnFieldType(const LookupIterator* it);
// Record the assumption that neither {cell}'s {CellType} changes, nor the // Record the assumption that neither {cell}'s {CellType} changes, nor the
// {IsReadOnly()} flag of {cell}'s {PropertyDetails}. // {IsReadOnly()} flag of {cell}'s {PropertyDetails}.
void DependOnGlobalProperty(Handle<PropertyCell> cell); void DependOnGlobalProperty(const PropertyCellRef& cell);
// Record the assumption that the protector remains valid. // Record the assumption that the protector remains valid.
void DependOnProtector(Handle<PropertyCell> cell); void DependOnProtector(const PropertyCellRef& cell);
// Record the assumption that {site}'s {ElementsKind} doesn't change. // Record the assumption that {site}'s {ElementsKind} doesn't change.
void DependOnElementsKind(Handle<AllocationSite> site); void DependOnElementsKind(const AllocationSiteRef& site);
// Depend on the stability of (the maps of) all prototypes of every class in // Depend on the stability of (the maps of) all prototypes of every class in
// {receiver_type} up to (and including) the {holder}. // {receiver_type} up to (and including) the {holder}.
// TODO(neis): Fully brokerize!
void DependOnStablePrototypeChains( void DependOnStablePrototypeChains(
Handle<Context> native_context, const JSHeapBroker* broker, Handle<Context> native_context,
std::vector<Handle<Map>> const& receiver_maps, Handle<JSObject> holder); std::vector<Handle<Map>> const& receiver_maps, Handle<JSObject> holder);
// Like DependOnElementsKind but also applies to all nested allocation sites. // Like DependOnElementsKind but also applies to all nested allocation sites.
void DependOnElementsKinds(Handle<AllocationSite> site); void DependOnElementsKinds(const AllocationSiteRef& site);
// Exposed only for testing purposes. // Exposed only for testing purposes.
bool AreValid() const; bool AreValid() const;
...@@ -65,7 +66,6 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject { ...@@ -65,7 +66,6 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject {
class Dependency; class Dependency;
private: private:
Isolate* isolate_;
Zone* zone_; Zone* zone_;
ZoneForwardList<Dependency*> dependencies_; ZoneForwardList<Dependency*> dependencies_;
}; };
......
This diff is collapsed.
...@@ -139,7 +139,7 @@ Reduction JSCreateLowering::ReduceJSCreate(Node* node) { ...@@ -139,7 +139,7 @@ Reduction JSCreateLowering::ReduceJSCreate(Node* node) {
// Add a dependency on the {initial_map} to make sure that this code is // Add a dependency on the {initial_map} to make sure that this code is
// deoptimized whenever the {initial_map} changes. // deoptimized whenever the {initial_map} changes.
MapRef initial_map = original_constructor.DependOnInitialMap(dependencies()); MapRef initial_map = dependencies()->DependOnInitialMap(original_constructor);
// Force completion of inobject slack tracking before // Force completion of inobject slack tracking before
// generating code to finalize the instance size. // generating code to finalize the instance size.
...@@ -425,7 +425,7 @@ Reduction JSCreateLowering::ReduceJSCreateGeneratorObject(Node* node) { ...@@ -425,7 +425,7 @@ Reduction JSCreateLowering::ReduceJSCreateGeneratorObject(Node* node) {
// Add a dependency on the {initial_map} to make sure that this code is // Add a dependency on the {initial_map} to make sure that this code is
// deoptimized whenever the {initial_map} changes. // deoptimized whenever the {initial_map} changes.
MapRef initial_map = js_function.DependOnInitialMap(dependencies()); MapRef initial_map = dependencies()->DependOnInitialMap(js_function);
DCHECK(initial_map.instance_type() == JS_GENERATOR_OBJECT_TYPE || DCHECK(initial_map.instance_type() == JS_GENERATOR_OBJECT_TYPE ||
initial_map.instance_type() == JS_ASYNC_GENERATOR_OBJECT_TYPE); initial_map.instance_type() == JS_ASYNC_GENERATOR_OBJECT_TYPE);
...@@ -727,8 +727,8 @@ Reduction JSCreateLowering::ReduceJSCreateArray(Node* node) { ...@@ -727,8 +727,8 @@ Reduction JSCreateLowering::ReduceJSCreateArray(Node* node) {
// Add a dependency on the {initial_map} to make sure that this code is // Add a dependency on the {initial_map} to make sure that this code is
// deoptimized whenever the {initial_map} changes. // deoptimized whenever the {initial_map} changes.
Handle<Map> initial_map = MapRef initial_map = dependencies()->DependOnInitialMap(
dependencies()->DependOnInitialMap(original_constructor); JSFunctionRef(js_heap_broker(), original_constructor));
// Tells whether we are protected by either the {site} or a // Tells whether we are protected by either the {site} or a
// protector cell to do certain speculative optimizations. // protector cell to do certain speculative optimizations.
...@@ -737,13 +737,16 @@ Reduction JSCreateLowering::ReduceJSCreateArray(Node* node) { ...@@ -737,13 +737,16 @@ Reduction JSCreateLowering::ReduceJSCreateArray(Node* node) {
// Check if we have a feedback {site} on the {node}. // Check if we have a feedback {site} on the {node}.
if (!site.is_null()) { if (!site.is_null()) {
ElementsKind elements_kind = site->GetElementsKind(); ElementsKind elements_kind = site->GetElementsKind();
if (initial_map->elements_kind() != elements_kind) { if (initial_map.elements_kind() != elements_kind) {
initial_map = initial_map =
Map::AsElementsKind(isolate(), initial_map, elements_kind); MapRef(js_heap_broker(),
Map::AsElementsKind(isolate(), initial_map.object<Map>(),
elements_kind));
} }
can_inline_call = site->CanInlineCall(); can_inline_call = site->CanInlineCall();
pretenure = dependencies()->DependOnPretenureMode(site); auto site_ref = AllocationSiteRef(js_heap_broker(), site);
dependencies()->DependOnElementsKind(site); pretenure = dependencies()->DependOnPretenureMode(site_ref);
dependencies()->DependOnElementsKind(site_ref);
} else { } else {
can_inline_call = isolate()->IsArrayConstructorIntact(); can_inline_call = isolate()->IsArrayConstructorIntact();
} }
...@@ -751,31 +754,36 @@ Reduction JSCreateLowering::ReduceJSCreateArray(Node* node) { ...@@ -751,31 +754,36 @@ Reduction JSCreateLowering::ReduceJSCreateArray(Node* node) {
if (arity == 0) { if (arity == 0) {
Node* length = jsgraph()->ZeroConstant(); Node* length = jsgraph()->ZeroConstant();
int capacity = JSArray::kPreallocatedArrayElements; int capacity = JSArray::kPreallocatedArrayElements;
return ReduceNewArray(node, length, capacity, initial_map, pretenure); return ReduceNewArray(node, length, capacity, initial_map.object<Map>(),
pretenure);
} else if (arity == 1) { } else if (arity == 1) {
Node* length = NodeProperties::GetValueInput(node, 2); Node* length = NodeProperties::GetValueInput(node, 2);
Type length_type = NodeProperties::GetType(length); Type length_type = NodeProperties::GetType(length);
if (!length_type.Maybe(Type::Number())) { if (!length_type.Maybe(Type::Number())) {
// Handle the single argument case, where we know that the value // Handle the single argument case, where we know that the value
// cannot be a valid Array length. // cannot be a valid Array length.
ElementsKind elements_kind = initial_map->elements_kind(); ElementsKind elements_kind = initial_map.elements_kind();
elements_kind = GetMoreGeneralElementsKind( elements_kind = GetMoreGeneralElementsKind(
elements_kind, IsHoleyElementsKind(elements_kind) elements_kind, IsHoleyElementsKind(elements_kind)
? HOLEY_ELEMENTS ? HOLEY_ELEMENTS
: PACKED_ELEMENTS); : PACKED_ELEMENTS);
initial_map = initial_map =
Map::AsElementsKind(isolate(), initial_map, elements_kind); MapRef(js_heap_broker(),
return ReduceNewArray(node, std::vector<Node*>{length}, initial_map, Map::AsElementsKind(isolate(), initial_map.object<Map>(),
pretenure); elements_kind));
return ReduceNewArray(node, std::vector<Node*>{length},
initial_map.object<Map>(), pretenure);
} }
if (length_type.Is(Type::SignedSmall()) && length_type.Min() >= 0 && if (length_type.Is(Type::SignedSmall()) && length_type.Min() >= 0 &&
length_type.Max() <= kElementLoopUnrollLimit && length_type.Max() <= kElementLoopUnrollLimit &&
length_type.Min() == length_type.Max()) { length_type.Min() == length_type.Max()) {
int capacity = static_cast<int>(length_type.Max()); int capacity = static_cast<int>(length_type.Max());
return ReduceNewArray(node, length, capacity, initial_map, pretenure); return ReduceNewArray(node, length, capacity,
initial_map.object<Map>(), pretenure);
} }
if (length_type.Maybe(Type::UnsignedSmall()) && can_inline_call) { if (length_type.Maybe(Type::UnsignedSmall()) && can_inline_call) {
return ReduceNewArray(node, length, initial_map, pretenure); return ReduceNewArray(node, length, initial_map.object<Map>(),
pretenure);
} }
} else if (arity <= JSArray::kInitialMaxFastElementArray) { } else if (arity <= JSArray::kInitialMaxFastElementArray) {
// Gather the values to store into the newly created array. // Gather the values to store into the newly created array.
...@@ -799,7 +807,7 @@ Reduction JSCreateLowering::ReduceJSCreateArray(Node* node) { ...@@ -799,7 +807,7 @@ Reduction JSCreateLowering::ReduceJSCreateArray(Node* node) {
} }
// Try to figure out the ideal elements kind statically. // Try to figure out the ideal elements kind statically.
ElementsKind elements_kind = initial_map->elements_kind(); ElementsKind elements_kind = initial_map.elements_kind();
if (values_all_smis) { if (values_all_smis) {
// Smis can be stored with any elements kind. // Smis can be stored with any elements kind.
} else if (values_all_numbers) { } else if (values_all_numbers) {
...@@ -821,9 +829,12 @@ Reduction JSCreateLowering::ReduceJSCreateArray(Node* node) { ...@@ -821,9 +829,12 @@ Reduction JSCreateLowering::ReduceJSCreateArray(Node* node) {
return NoChange(); return NoChange();
} }
initial_map = initial_map =
Map::AsElementsKind(isolate(), initial_map, elements_kind); MapRef(js_heap_broker(),
Map::AsElementsKind(isolate(), initial_map.object<Map>(),
elements_kind));
return ReduceNewArray(node, values, initial_map, pretenure); return ReduceNewArray(node, values, initial_map.object<Map>(),
pretenure);
} }
} }
} }
...@@ -1151,10 +1162,9 @@ Reduction JSCreateLowering::ReduceJSCreateLiteralArrayOrObject(Node* node) { ...@@ -1151,10 +1162,9 @@ Reduction JSCreateLowering::ReduceJSCreateLiteralArrayOrObject(Node* node) {
if (site.IsFastLiteral()) { if (site.IsFastLiteral()) {
PretenureFlag pretenure = NOT_TENURED; PretenureFlag pretenure = NOT_TENURED;
if (FLAG_allocation_site_pretenuring) { if (FLAG_allocation_site_pretenuring) {
pretenure = dependencies()->DependOnPretenureMode( pretenure = dependencies()->DependOnPretenureMode(site);
site.object<AllocationSite>());
} }
dependencies()->DependOnElementsKinds(site.object<AllocationSite>()); dependencies()->DependOnElementsKinds(site);
JSObjectRef boilerplate = site.boilerplate(); JSObjectRef boilerplate = site.boilerplate();
Node* value = effect = Node* value = effect =
AllocateFastLiteral(effect, control, boilerplate, pretenure); AllocateFastLiteral(effect, control, boilerplate, pretenure);
...@@ -1176,8 +1186,10 @@ Reduction JSCreateLowering::ReduceJSCreateEmptyLiteralArray(Node* node) { ...@@ -1176,8 +1186,10 @@ Reduction JSCreateLowering::ReduceJSCreateEmptyLiteralArray(Node* node) {
Handle<Map> const initial_map( Handle<Map> const initial_map(
native_context()->GetInitialJSArrayMap(site->GetElementsKind()), native_context()->GetInitialJSArrayMap(site->GetElementsKind()),
isolate()); isolate());
PretenureFlag const pretenure = dependencies()->DependOnPretenureMode(site); auto site_ref = AllocationSiteRef(js_heap_broker(), site);
dependencies()->DependOnElementsKind(site); PretenureFlag const pretenure =
dependencies()->DependOnPretenureMode(site_ref);
dependencies()->DependOnElementsKind(site_ref);
Node* length = jsgraph()->ZeroConstant(); Node* length = jsgraph()->ZeroConstant();
return ReduceNewArray(node, length, 0, initial_map, pretenure); return ReduceNewArray(node, length, 0, initial_map, pretenure);
} }
......
...@@ -156,15 +156,6 @@ bool JSFunctionRef::IsConstructor() const { ...@@ -156,15 +156,6 @@ bool JSFunctionRef::IsConstructor() const {
return object<JSFunction>()->IsConstructor(); return object<JSFunction>()->IsConstructor();
} }
MapRef JSFunctionRef::DependOnInitialMap(
CompilationDependencies* dependencies) const {
AllowHandleAllocation handle_allocation;
AllowHandleDereference allow_handle_dereference;
Handle<Map> initial_map =
dependencies->DependOnInitialMap(object<JSFunction>());
return MapRef(broker(), initial_map);
}
void JSFunctionRef::EnsureHasInitialMap() const { void JSFunctionRef::EnsureHasInitialMap() const {
AllowHandleAllocation handle_allocation; AllowHandleAllocation handle_allocation;
AllowHandleDereference allow_handle_dereference; AllowHandleDereference allow_handle_dereference;
...@@ -175,13 +166,6 @@ void JSFunctionRef::EnsureHasInitialMap() const { ...@@ -175,13 +166,6 @@ void JSFunctionRef::EnsureHasInitialMap() const {
JSFunction::EnsureHasInitialMap(object<JSFunction>()); JSFunction::EnsureHasInitialMap(object<JSFunction>());
} }
// TODO(neis): Remove.
void MapRef::DependOnStableMap(CompilationDependencies* dependencies) const {
AllowHandleAllocation handle_allocation;
AllowHandleDereference allow_handle_dereference;
dependencies->DependOnStableMap(object<Map>());
}
SlackTrackingResult JSFunctionRef::FinishSlackTracking() const { SlackTrackingResult JSFunctionRef::FinishSlackTracking() const {
AllowHandleDereference allow_handle_dereference; AllowHandleDereference allow_handle_dereference;
AllowHandleAllocation handle_allocation; AllowHandleAllocation handle_allocation;
...@@ -265,6 +249,24 @@ JSObjectRef AllocationSiteRef::boilerplate() const { ...@@ -265,6 +249,24 @@ JSObjectRef AllocationSiteRef::boilerplate() const {
return JSObjectRef(broker(), value); return JSObjectRef(broker(), value);
} }
ObjectRef AllocationSiteRef::nested_site() const {
AllowHandleAllocation handle_allocation;
AllowHandleDereference handle_dereference;
Handle<Object> obj(object<AllocationSite>()->nested_site(),
broker()->isolate());
return ObjectRef(broker(), obj);
}
bool AllocationSiteRef::PointsToLiteral() const {
AllowHandleDereference handle_dereference;
return object<AllocationSite>()->PointsToLiteral();
}
ElementsKind AllocationSiteRef::GetElementsKind() const {
AllowHandleDereference handle_dereference;
return object<AllocationSite>()->GetElementsKind();
}
bool JSObjectRef::IsUnboxedDoubleField(FieldIndex index) const { bool JSObjectRef::IsUnboxedDoubleField(FieldIndex index) const {
AllowHandleDereference handle_dereference; AllowHandleDereference handle_dereference;
return object<JSObject>()->IsUnboxedDoubleField(index); return object<JSObject>()->IsUnboxedDoubleField(index);
...@@ -283,6 +285,11 @@ ObjectRef JSObjectRef::RawFastPropertyAt(FieldIndex index) const { ...@@ -283,6 +285,11 @@ ObjectRef JSObjectRef::RawFastPropertyAt(FieldIndex index) const {
broker()->isolate())); broker()->isolate()));
} }
ElementsKind JSObjectRef::GetElementsKind() {
AllowHandleDereference handle_dereference;
return object<JSObject>()->GetElementsKind();
}
FixedArrayBaseRef JSObjectRef::elements() const { FixedArrayBaseRef JSObjectRef::elements() const {
AllowHandleAllocation handle_allocation; AllowHandleAllocation handle_allocation;
AllowHandleDereference handle_dereference; AllowHandleDereference handle_dereference;
...@@ -405,6 +412,21 @@ void JSObjectRef::EnsureElementsTenured() { ...@@ -405,6 +412,21 @@ void JSObjectRef::EnsureElementsTenured() {
} }
} }
ElementsKind MapRef::elements_kind() const {
AllowHandleDereference allow_handle_dereference;
return object<Map>()->elements_kind();
}
bool MapRef::is_deprecated() const {
AllowHandleDereference allow_handle_dereference;
return object<Map>()->is_deprecated();
}
bool MapRef::CanBeDeprecated() const {
AllowHandleDereference allow_handle_dereference;
return object<Map>()->CanBeDeprecated();
}
int MapRef::GetInObjectProperties() const { int MapRef::GetInObjectProperties() const {
AllowHandleDereference allow_handle_dereference; AllowHandleDereference allow_handle_dereference;
return object<Map>()->GetInObjectProperties(); return object<Map>()->GetInObjectProperties();
...@@ -491,6 +513,24 @@ bool MapRef::CanTransition() const { ...@@ -491,6 +513,24 @@ bool MapRef::CanTransition() const {
return object<Map>()->CanTransition(); return object<Map>()->CanTransition();
} }
MapRef MapRef::FindFieldOwner(int descriptor) const {
AllowHandleAllocation handle_allocation;
AllowHandleDereference allow_handle_dereference;
Handle<Map> owner(
object<Map>()->FindFieldOwner(broker()->isolate(), descriptor),
broker()->isolate());
return MapRef(broker(), owner);
}
FieldTypeRef MapRef::GetFieldType(int descriptor) const {
AllowHandleAllocation handle_allocation;
AllowHandleDereference allow_handle_dereference;
Handle<FieldType> field_type(
object<Map>()->instance_descriptors()->GetFieldType(descriptor),
broker()->isolate());
return FieldTypeRef(broker(), field_type);
}
ElementsKind JSArrayRef::GetElementsKind() const { ElementsKind JSArrayRef::GetElementsKind() const {
AllowHandleDereference allow_handle_dereference; AllowHandleDereference allow_handle_dereference;
return object<JSArray>()->GetElementsKind(); return object<JSArray>()->GetElementsKind();
...@@ -791,6 +831,18 @@ CellRef ModuleRef::GetCell(int cell_index) { ...@@ -791,6 +831,18 @@ CellRef ModuleRef::GetCell(int cell_index) {
broker()->isolate())); broker()->isolate()));
} }
ObjectRef PropertyCellRef::value() const {
AllowHandleAllocation allow_handle_allocation;
AllowHandleDereference allow_handle_dereference;
return ObjectRef(
broker(), handle(object<PropertyCell>()->value(), broker()->isolate()));
}
PropertyDetails PropertyCellRef::property_details() const {
AllowHandleDereference allow_handle_dereference;
return object<PropertyCell>()->property_details();
}
} // namespace compiler } // namespace compiler
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
...@@ -81,6 +81,7 @@ class HeapObjectType { ...@@ -81,6 +81,7 @@ class HeapObjectType {
V(MutableHeapNumber) \ V(MutableHeapNumber) \
V(Name) \ V(Name) \
V(NativeContext) \ V(NativeContext) \
V(PropertyCell) \
V(ScopeInfo) \ V(ScopeInfo) \
V(ScriptContextTable) \ V(ScriptContextTable) \
V(SharedFunctionInfo) \ V(SharedFunctionInfo) \
...@@ -130,6 +131,11 @@ class ObjectRef { ...@@ -130,6 +131,11 @@ class ObjectRef {
Handle<Object> object_; Handle<Object> object_;
}; };
class FieldTypeRef : public ObjectRef {
public:
using ObjectRef::ObjectRef;
};
class HeapObjectRef : public ObjectRef { class HeapObjectRef : public ObjectRef {
public: public:
using ObjectRef::ObjectRef; using ObjectRef::ObjectRef;
...@@ -141,6 +147,14 @@ class HeapObjectRef : public ObjectRef { ...@@ -141,6 +147,14 @@ class HeapObjectRef : public ObjectRef {
bool IsExternalString() const; bool IsExternalString() const;
}; };
class PropertyCellRef : public HeapObjectRef {
public:
using HeapObjectRef::HeapObjectRef;
ObjectRef value() const;
PropertyDetails property_details() const;
};
class JSObjectRef : public HeapObjectRef { class JSObjectRef : public HeapObjectRef {
public: public:
using HeapObjectRef::HeapObjectRef; using HeapObjectRef::HeapObjectRef;
...@@ -151,6 +165,7 @@ class JSObjectRef : public HeapObjectRef { ...@@ -151,6 +165,7 @@ class JSObjectRef : public HeapObjectRef {
FixedArrayBaseRef elements() const; FixedArrayBaseRef elements() const;
void EnsureElementsTenured(); void EnsureElementsTenured();
ElementsKind GetElementsKind();
}; };
struct SlackTrackingResult { struct SlackTrackingResult {
...@@ -170,9 +185,6 @@ class JSFunctionRef : public JSObjectRef { ...@@ -170,9 +185,6 @@ class JSFunctionRef : public JSObjectRef {
bool IsConstructor() const; bool IsConstructor() const;
bool has_initial_map() const; bool has_initial_map() const;
MapRef initial_map() const; MapRef initial_map() const;
MapRef DependOnInitialMap(CompilationDependencies* dependencies) const;
JSGlobalProxyRef global_proxy() const; JSGlobalProxyRef global_proxy() const;
SlackTrackingResult FinishSlackTracking() const; SlackTrackingResult FinishSlackTracking() const;
SharedFunctionInfoRef shared() const; SharedFunctionInfoRef shared() const;
...@@ -267,6 +279,9 @@ class AllocationSiteRef : public HeapObjectRef { ...@@ -267,6 +279,9 @@ class AllocationSiteRef : public HeapObjectRef {
JSObjectRef boilerplate() const; JSObjectRef boilerplate() const;
PretenureFlag GetPretenureMode() const; PretenureFlag GetPretenureMode() const;
bool IsFastLiteral() const; bool IsFastLiteral() const;
ObjectRef nested_site() const;
bool PointsToLiteral() const;
ElementsKind GetElementsKind() const;
}; };
class MapRef : public HeapObjectRef { class MapRef : public HeapObjectRef {
...@@ -281,18 +296,21 @@ class MapRef : public HeapObjectRef { ...@@ -281,18 +296,21 @@ class MapRef : public HeapObjectRef {
NameRef GetPropertyKey(int i) const; NameRef GetPropertyKey(int i) const;
FieldIndex GetFieldIndexFor(int i) const; FieldIndex GetFieldIndexFor(int i) const;
int GetInObjectPropertyOffset(int index) const; int GetInObjectPropertyOffset(int index) const;
ElementsKind elements_kind() const;
ObjectRef constructor_or_backpointer() const; ObjectRef constructor_or_backpointer() const;
bool is_stable() const; bool is_stable() const;
bool has_prototype_slot() const; bool has_prototype_slot() const;
bool is_deprecated() const;
bool CanBeDeprecated() const;
bool CanTransition() const; bool CanTransition() const;
bool IsInobjectSlackTrackingInProgress() const; bool IsInobjectSlackTrackingInProgress() const;
MapRef FindFieldOwner(int descriptor) const;
bool is_dictionary_map() const; bool is_dictionary_map() const;
bool IsJSArrayMap() const; bool IsJSArrayMap() const;
bool IsFixedCowArrayMap() const; bool IsFixedCowArrayMap() const;
void DependOnStableMap(CompilationDependencies* dependencies) const; // Concerning the underlying instance_descriptors:
FieldTypeRef GetFieldType(int descriptor) const;
}; };
class FixedArrayBaseRef : public HeapObjectRef { class FixedArrayBaseRef : public HeapObjectRef {
......
...@@ -135,7 +135,7 @@ class PipelineData { ...@@ -135,7 +135,7 @@ class PipelineData {
javascript_ = new (graph_zone_) JSOperatorBuilder(graph_zone_); javascript_ = new (graph_zone_) JSOperatorBuilder(graph_zone_);
jsgraph_ = new (graph_zone_) jsgraph_ = new (graph_zone_)
JSGraph(isolate_, graph_, common_, javascript_, simplified_, machine_); JSGraph(isolate_, graph_, common_, javascript_, simplified_, machine_);
js_heap_broker_ = new (graph_zone_) JSHeapBroker(isolate_); js_heap_broker_ = new (codegen_zone_) JSHeapBroker(isolate_);
dependencies_ = dependencies_ =
new (codegen_zone_) CompilationDependencies(isolate_, codegen_zone_); new (codegen_zone_) CompilationDependencies(isolate_, codegen_zone_);
} }
...@@ -334,6 +334,7 @@ class PipelineData { ...@@ -334,6 +334,7 @@ class PipelineData {
codegen_zone_scope_.Destroy(); codegen_zone_scope_.Destroy();
codegen_zone_ = nullptr; codegen_zone_ = nullptr;
dependencies_ = nullptr; dependencies_ = nullptr;
js_heap_broker_ = nullptr;
frame_ = nullptr; frame_ = nullptr;
} }
...@@ -447,7 +448,6 @@ class PipelineData { ...@@ -447,7 +448,6 @@ class PipelineData {
JSGraph* jsgraph_ = nullptr; JSGraph* jsgraph_ = nullptr;
MachineGraph* mcgraph_ = nullptr; MachineGraph* mcgraph_ = nullptr;
Schedule* schedule_ = nullptr; Schedule* schedule_ = nullptr;
JSHeapBroker* js_heap_broker_ = nullptr;
// All objects in the following group of fields are allocated in // All objects in the following group of fields are allocated in
// instruction_zone_. They are all set to nullptr when the instruction_zone_ // instruction_zone_. They are all set to nullptr when the instruction_zone_
...@@ -462,6 +462,7 @@ class PipelineData { ...@@ -462,6 +462,7 @@ class PipelineData {
ZoneStats::Scope codegen_zone_scope_; ZoneStats::Scope codegen_zone_scope_;
Zone* codegen_zone_; Zone* codegen_zone_;
CompilationDependencies* dependencies_ = nullptr; CompilationDependencies* dependencies_ = nullptr;
JSHeapBroker* js_heap_broker_ = nullptr;
Frame* frame_ = nullptr; Frame* frame_ = nullptr;
// All objects in the following group of fields are allocated in // All objects in the following group of fields are allocated in
......
...@@ -136,7 +136,8 @@ void PropertyAccessBuilder::BuildCheckMaps( ...@@ -136,7 +136,8 @@ void PropertyAccessBuilder::BuildCheckMaps(
if (receiver_map->is_stable()) { if (receiver_map->is_stable()) {
for (Handle<Map> map : receiver_maps) { for (Handle<Map> map : receiver_maps) {
if (map.is_identical_to(receiver_map)) { if (map.is_identical_to(receiver_map)) {
dependencies()->DependOnStableMap(receiver_map); dependencies()->DependOnStableMap(
MapRef(js_heap_broker(), receiver_map));
return; return;
} }
} }
...@@ -206,7 +207,9 @@ Node* PropertyAccessBuilder::TryBuildLoadConstantDataField( ...@@ -206,7 +207,9 @@ Node* PropertyAccessBuilder::TryBuildLoadConstantDataField(
// the field. // the field.
DCHECK(access_info.IsDataConstantField()); DCHECK(access_info.IsDataConstantField());
DCHECK(!it.is_dictionary_holder()); DCHECK(!it.is_dictionary_holder());
dependencies()->DependOnFieldType(&it); MapRef map(js_heap_broker(),
handle(it.GetHolder<HeapObject>()->map(), isolate()));
dependencies()->DependOnFieldType(map, it.GetFieldDescriptorIndex());
} }
return value; return value;
} }
...@@ -264,7 +267,7 @@ Node* PropertyAccessBuilder::BuildLoadDataField( ...@@ -264,7 +267,7 @@ Node* PropertyAccessBuilder::BuildLoadDataField(
Handle<Map> field_map; Handle<Map> field_map;
if (access_info.field_map().ToHandle(&field_map)) { if (access_info.field_map().ToHandle(&field_map)) {
if (field_map->is_stable()) { if (field_map->is_stable()) {
dependencies()->DependOnStableMap(field_map); dependencies()->DependOnStableMap(MapRef(js_heap_broker(), field_map));
field_access.map = field_map; field_access.map = field_map;
} }
} }
......
...@@ -19,14 +19,18 @@ class CommonOperatorBuilder; ...@@ -19,14 +19,18 @@ class CommonOperatorBuilder;
class CompilationDependencies; class CompilationDependencies;
class Graph; class Graph;
class JSGraph; class JSGraph;
class JSHeapBroker;
class Node; class Node;
class PropertyAccessInfo; class PropertyAccessInfo;
class SimplifiedOperatorBuilder; class SimplifiedOperatorBuilder;
class PropertyAccessBuilder { class PropertyAccessBuilder {
public: public:
PropertyAccessBuilder(JSGraph* jsgraph, CompilationDependencies* dependencies) PropertyAccessBuilder(JSGraph* jsgraph, const JSHeapBroker* js_heap_broker,
: jsgraph_(jsgraph), dependencies_(dependencies) {} CompilationDependencies* dependencies)
: jsgraph_(jsgraph),
js_heap_broker_(js_heap_broker),
dependencies_(dependencies) {}
// Builds the appropriate string check if the maps are only string // Builds the appropriate string check if the maps are only string
// maps. // maps.
...@@ -50,6 +54,7 @@ class PropertyAccessBuilder { ...@@ -50,6 +54,7 @@ class PropertyAccessBuilder {
private: private:
JSGraph* jsgraph() const { return jsgraph_; } JSGraph* jsgraph() const { return jsgraph_; }
const JSHeapBroker* js_heap_broker() const { return js_heap_broker_; }
CompilationDependencies* dependencies() const { return dependencies_; } CompilationDependencies* dependencies() const { return dependencies_; }
Graph* graph() const; Graph* graph() const;
Isolate* isolate() const; Isolate* isolate() const;
...@@ -64,6 +69,7 @@ class PropertyAccessBuilder { ...@@ -64,6 +69,7 @@ class PropertyAccessBuilder {
Node* ResolveHolder(PropertyAccessInfo const& access_info, Node* receiver); Node* ResolveHolder(PropertyAccessInfo const& access_info, Node* receiver);
JSGraph* jsgraph_; JSGraph* jsgraph_;
const JSHeapBroker* js_heap_broker_;
CompilationDependencies* dependencies_; CompilationDependencies* dependencies_;
}; };
......
...@@ -153,7 +153,7 @@ Reduction TypedOptimization::ReduceCheckMaps(Node* node) { ...@@ -153,7 +153,7 @@ Reduction TypedOptimization::ReduceCheckMaps(Node* node) {
if (map_type.IsHeapConstant() && if (map_type.IsHeapConstant() &&
map_type.AsHeapConstant()->Ref().equals(*object_map)) { map_type.AsHeapConstant()->Ref().equals(*object_map)) {
if (object_map->CanTransition()) { if (object_map->CanTransition()) {
object_map->DependOnStableMap(dependencies()); dependencies()->DependOnStableMap(*object_map);
} }
return Replace(effect); return Replace(effect);
} }
...@@ -218,9 +218,7 @@ Reduction TypedOptimization::ReduceLoadField(Node* node) { ...@@ -218,9 +218,7 @@ Reduction TypedOptimization::ReduceLoadField(Node* node) {
base::Optional<MapRef> object_map = base::Optional<MapRef> object_map =
GetStableMapFromObjectType(js_heap_broker(), object_type); GetStableMapFromObjectType(js_heap_broker(), object_type);
if (object_map.has_value()) { if (object_map.has_value()) {
if (object_map->CanTransition()) { dependencies()->DependOnStableMap(*object_map);
object_map->DependOnStableMap(dependencies());
}
Node* const value = jsgraph()->Constant(*object_map); Node* const value = jsgraph()->Constant(*object_map);
ReplaceWithValue(node, value); ReplaceWithValue(node, value);
return Replace(value); return Replace(value);
......
...@@ -1456,7 +1456,7 @@ ACCESSORS(PropertyCell, name, Name, kNameOffset) ...@@ -1456,7 +1456,7 @@ ACCESSORS(PropertyCell, name, Name, kNameOffset)
ACCESSORS(PropertyCell, value, Object, kValueOffset) ACCESSORS(PropertyCell, value, Object, kValueOffset)
ACCESSORS(PropertyCell, property_details_raw, Object, kDetailsOffset) ACCESSORS(PropertyCell, property_details_raw, Object, kDetailsOffset)
PropertyDetails PropertyCell::property_details() { PropertyDetails PropertyCell::property_details() const {
return PropertyDetails(Smi::cast(property_details_raw())); return PropertyDetails(Smi::cast(property_details_raw()));
} }
......
...@@ -3909,7 +3909,7 @@ class PropertyCell : public HeapObject { ...@@ -3909,7 +3909,7 @@ class PropertyCell : public HeapObject {
// property. // property.
DECL_ACCESSORS(dependent_code, DependentCode) DECL_ACCESSORS(dependent_code, DependentCode)
inline PropertyDetails property_details(); inline PropertyDetails property_details() const;
inline void set_property_details(PropertyDetails details); inline void set_property_details(PropertyDetails details);
PropertyCellConstantType GetConstantType(); PropertyCellConstantType GetConstantType();
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "src/compilation-cache.h" #include "src/compilation-cache.h"
#include "src/compiler/compilation-dependencies.h" #include "src/compiler/compilation-dependencies.h"
#include "src/compiler/js-heap-broker.h"
#include "src/execution.h" #include "src/execution.h"
#include "src/field-type.h" #include "src/field-type.h"
#include "src/global-handles.h" #include "src/global-handles.h"
...@@ -608,6 +609,7 @@ static void TestGeneralizeField(int detach_property_at_index, ...@@ -608,6 +609,7 @@ static void TestGeneralizeField(int detach_property_at_index,
bool expected_deprecation, bool expected_deprecation,
bool expected_field_type_dependency) { bool expected_field_type_dependency) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
JSHeapBroker broker(isolate);
Handle<FieldType> any_type = FieldType::Any(isolate); Handle<FieldType> any_type = FieldType::Any(isolate);
CHECK(detach_property_at_index >= -1 && CHECK(detach_property_at_index >= -1 &&
...@@ -653,11 +655,12 @@ static void TestGeneralizeField(int detach_property_at_index, ...@@ -653,11 +655,12 @@ static void TestGeneralizeField(int detach_property_at_index,
} }
// Create new maps by generalizing representation of propX field. // Create new maps by generalizing representation of propX field.
Handle<Map> field_owner(map->FindFieldOwner(isolate, property_index), CanonicalHandleScope canonical(isolate);
isolate);
CompilationDependencies dependencies(isolate, &zone); CompilationDependencies dependencies(isolate, &zone);
dependencies.DependOnFieldType(map, property_index); dependencies.DependOnFieldType(MapRef(&broker, map), property_index);
Handle<Map> field_owner(map->FindFieldOwner(isolate, property_index),
isolate);
Handle<Map> new_map = Map::ReconfigureProperty( Handle<Map> new_map = Map::ReconfigureProperty(
isolate, map, property_index, kData, NONE, to.representation, to.type); isolate, map, property_index, kData, NONE, to.representation, to.type);
...@@ -986,6 +989,7 @@ TEST(GeneralizeFieldWithAccessorProperties) { ...@@ -986,6 +989,7 @@ TEST(GeneralizeFieldWithAccessorProperties) {
static void TestReconfigureDataFieldAttribute_GeneralizeField( static void TestReconfigureDataFieldAttribute_GeneralizeField(
const CRFTData& from, const CRFTData& to, const CRFTData& expected) { const CRFTData& from, const CRFTData& to, const CRFTData& expected) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
JSHeapBroker broker(isolate);
Expectations expectations(isolate); Expectations expectations(isolate);
...@@ -1023,8 +1027,9 @@ static void TestReconfigureDataFieldAttribute_GeneralizeField( ...@@ -1023,8 +1027,9 @@ static void TestReconfigureDataFieldAttribute_GeneralizeField(
CHECK(expectations2.Check(*map2)); CHECK(expectations2.Check(*map2));
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME);
CanonicalHandleScope canonical(isolate);
CompilationDependencies dependencies(isolate, &zone); CompilationDependencies dependencies(isolate, &zone);
dependencies.DependOnFieldType(map, kSplitProp); dependencies.DependOnFieldType(MapRef(&broker, map), kSplitProp);
// Reconfigure attributes of property |kSplitProp| of |map2| to NONE, which // Reconfigure attributes of property |kSplitProp| of |map2| to NONE, which
// should generalize representations in |map1|. // should generalize representations in |map1|.
...@@ -1068,6 +1073,7 @@ static void TestReconfigureDataFieldAttribute_GeneralizeFieldTrivial( ...@@ -1068,6 +1073,7 @@ static void TestReconfigureDataFieldAttribute_GeneralizeFieldTrivial(
const CRFTData& from, const CRFTData& to, const CRFTData& expected, const CRFTData& from, const CRFTData& to, const CRFTData& expected,
bool expected_field_type_dependency = true) { bool expected_field_type_dependency = true) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
JSHeapBroker broker(isolate);
Expectations expectations(isolate); Expectations expectations(isolate);
...@@ -1105,8 +1111,9 @@ static void TestReconfigureDataFieldAttribute_GeneralizeFieldTrivial( ...@@ -1105,8 +1111,9 @@ static void TestReconfigureDataFieldAttribute_GeneralizeFieldTrivial(
CHECK(expectations2.Check(*map2)); CHECK(expectations2.Check(*map2));
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME);
CanonicalHandleScope canonical(isolate);
CompilationDependencies dependencies(isolate, &zone); CompilationDependencies dependencies(isolate, &zone);
dependencies.DependOnFieldType(map, kSplitProp); dependencies.DependOnFieldType(MapRef(&broker, map), kSplitProp);
// Reconfigure attributes of property |kSplitProp| of |map2| to NONE, which // Reconfigure attributes of property |kSplitProp| of |map2| to NONE, which
// should generalize representations in |map1|. // should generalize representations in |map1|.
...@@ -1746,6 +1753,7 @@ TEST(ReconfigureDataFieldAttribute_AccConstantToDataFieldAfterTargetMap) { ...@@ -1746,6 +1753,7 @@ TEST(ReconfigureDataFieldAttribute_AccConstantToDataFieldAfterTargetMap) {
static void TestReconfigureElementsKind_GeneralizeField( static void TestReconfigureElementsKind_GeneralizeField(
const CRFTData& from, const CRFTData& to, const CRFTData& expected) { const CRFTData& from, const CRFTData& to, const CRFTData& expected) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
JSHeapBroker broker(isolate);
Expectations expectations(isolate, PACKED_SMI_ELEMENTS); Expectations expectations(isolate, PACKED_SMI_ELEMENTS);
...@@ -1784,8 +1792,9 @@ static void TestReconfigureElementsKind_GeneralizeField( ...@@ -1784,8 +1792,9 @@ static void TestReconfigureElementsKind_GeneralizeField(
CHECK(expectations2.Check(*map2)); CHECK(expectations2.Check(*map2));
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME);
CanonicalHandleScope canonical(isolate);
CompilationDependencies dependencies(isolate, &zone); CompilationDependencies dependencies(isolate, &zone);
dependencies.DependOnFieldType(map, kDiffProp); dependencies.DependOnFieldType(MapRef(&broker, map), kDiffProp);
// Reconfigure elements kinds of |map2|, which should generalize // Reconfigure elements kinds of |map2|, which should generalize
// representations in |map|. // representations in |map|.
...@@ -1839,6 +1848,7 @@ static void TestReconfigureElementsKind_GeneralizeField( ...@@ -1839,6 +1848,7 @@ static void TestReconfigureElementsKind_GeneralizeField(
static void TestReconfigureElementsKind_GeneralizeFieldTrivial( static void TestReconfigureElementsKind_GeneralizeFieldTrivial(
const CRFTData& from, const CRFTData& to, const CRFTData& expected) { const CRFTData& from, const CRFTData& to, const CRFTData& expected) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
JSHeapBroker broker(isolate);
Expectations expectations(isolate, PACKED_SMI_ELEMENTS); Expectations expectations(isolate, PACKED_SMI_ELEMENTS);
...@@ -1877,8 +1887,9 @@ static void TestReconfigureElementsKind_GeneralizeFieldTrivial( ...@@ -1877,8 +1887,9 @@ static void TestReconfigureElementsKind_GeneralizeFieldTrivial(
CHECK(expectations2.Check(*map2)); CHECK(expectations2.Check(*map2));
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME);
CanonicalHandleScope canonical(isolate);
CompilationDependencies dependencies(isolate, &zone); CompilationDependencies dependencies(isolate, &zone);
dependencies.DependOnFieldType(map, kDiffProp); dependencies.DependOnFieldType(MapRef(&broker, map), kDiffProp);
// Reconfigure elements kinds of |map2|, which should generalize // Reconfigure elements kinds of |map2|, which should generalize
// representations in |map|. // representations in |map|.
......
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