Commit a25279df authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[turbofan] Canonicalize uses of DependOnProtector

This merges the check if a protector is intact with the recording of
the dependency on it, at least in many cases.

Also introduce convenience functions to avoid the heap broker clutter.

Change-Id: I35508c4685a2f0df77819bf81075dd14a30e7e4f
Reviewed-on: https://chromium-review.googlesource.com/c/1487491
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59924}
parent 9c5cd066
...@@ -12,8 +12,9 @@ namespace v8 { ...@@ -12,8 +12,9 @@ namespace v8 {
namespace internal { namespace internal {
namespace compiler { namespace compiler {
CompilationDependencies::CompilationDependencies(Isolate* isolate, Zone* zone) CompilationDependencies::CompilationDependencies(JSHeapBroker* broker,
: zone_(zone), dependencies_(zone), isolate_(isolate) {} Zone* zone)
: zone_(zone), broker_(broker), dependencies_(zone) {}
class CompilationDependencies::Dependency : public ZoneObject { class CompilationDependencies::Dependency : public ZoneObject {
public: public:
...@@ -423,8 +424,46 @@ void CompilationDependencies::DependOnGlobalProperty( ...@@ -423,8 +424,46 @@ void CompilationDependencies::DependOnGlobalProperty(
GlobalPropertyDependency(cell, type, read_only)); GlobalPropertyDependency(cell, type, read_only));
} }
void CompilationDependencies::DependOnProtector(const PropertyCellRef& cell) { bool CompilationDependencies::DependOnProtector(const PropertyCellRef& cell) {
if (cell.value().AsSmi() != Isolate::kProtectorValid) return false;
dependencies_.push_front(new (zone_) ProtectorDependency(cell)); dependencies_.push_front(new (zone_) ProtectorDependency(cell));
return true;
}
bool CompilationDependencies::DependOnArrayBufferDetachingProtector() {
return DependOnProtector(PropertyCellRef(
broker_,
broker_->isolate()->factory()->array_buffer_detaching_protector()));
}
bool CompilationDependencies::DependOnArrayIteratorProtector() {
return DependOnProtector(PropertyCellRef(
broker_, broker_->isolate()->factory()->array_iterator_protector()));
}
bool CompilationDependencies::DependOnArraySpeciesProtector() {
return DependOnProtector(PropertyCellRef(
broker_, broker_->isolate()->factory()->array_species_protector()));
}
bool CompilationDependencies::DependOnNoElementsProtector() {
return DependOnProtector(PropertyCellRef(
broker_, broker_->isolate()->factory()->no_elements_protector()));
}
bool CompilationDependencies::DependOnPromiseHookProtector() {
return DependOnProtector(PropertyCellRef(
broker_, broker_->isolate()->factory()->promise_hook_protector()));
}
bool CompilationDependencies::DependOnPromiseSpeciesProtector() {
return DependOnProtector(PropertyCellRef(
broker_, broker_->isolate()->factory()->promise_species_protector()));
}
bool CompilationDependencies::DependOnPromiseThenProtector() {
return DependOnProtector(PropertyCellRef(
broker_, broker_->isolate()->factory()->promise_then_protector()));
} }
void CompilationDependencies::DependOnElementsKind( void CompilationDependencies::DependOnElementsKind(
...@@ -474,7 +513,7 @@ bool CompilationDependencies::Commit(Handle<Code> code) { ...@@ -474,7 +513,7 @@ bool CompilationDependencies::Commit(Handle<Code> code) {
// these cases, because once the code gets executed it will do a stack check // these cases, because once the code gets executed it will do a stack check
// that triggers its deoptimization. // that triggers its deoptimization.
if (FLAG_stress_gc_during_compilation) { if (FLAG_stress_gc_during_compilation) {
isolate_->heap()->PreciseCollectAllGarbage( broker_->isolate()->heap()->PreciseCollectAllGarbage(
Heap::kNoGCFlags, GarbageCollectionReason::kTesting, Heap::kNoGCFlags, GarbageCollectionReason::kTesting,
kGCCallbackFlagForced); kGCCallbackFlagForced);
} }
...@@ -490,8 +529,7 @@ bool CompilationDependencies::Commit(Handle<Code> code) { ...@@ -490,8 +529,7 @@ bool CompilationDependencies::Commit(Handle<Code> code) {
namespace { namespace {
// This function expects to never see a JSProxy. // This function expects to never see a JSProxy.
void DependOnStablePrototypeChain(JSHeapBroker* broker, void DependOnStablePrototypeChain(CompilationDependencies* deps, MapRef map,
CompilationDependencies* deps, MapRef map,
const JSObjectRef& last_prototype) { const JSObjectRef& last_prototype) {
while (true) { while (true) {
map.SerializePrototype(); map.SerializePrototype();
...@@ -504,19 +542,18 @@ void DependOnStablePrototypeChain(JSHeapBroker* broker, ...@@ -504,19 +542,18 @@ void DependOnStablePrototypeChain(JSHeapBroker* broker,
} // namespace } // namespace
void CompilationDependencies::DependOnStablePrototypeChains( void CompilationDependencies::DependOnStablePrototypeChains(
JSHeapBroker* broker, std::vector<Handle<Map>> const& receiver_maps, std::vector<Handle<Map>> const& receiver_maps, const JSObjectRef& holder) {
const JSObjectRef& holder) {
// Determine actual holder and perform prototype chain checks. // Determine actual holder and perform prototype chain checks.
for (auto map : receiver_maps) { for (auto map : receiver_maps) {
MapRef receiver_map(broker, map); MapRef receiver_map(broker_, map);
if (receiver_map.IsPrimitiveMap()) { if (receiver_map.IsPrimitiveMap()) {
// Perform the implicit ToObject for primitives here. // Perform the implicit ToObject for primitives here.
// Implemented according to ES6 section 7.3.2 GetV (V, P). // Implemented according to ES6 section 7.3.2 GetV (V, P).
base::Optional<JSFunctionRef> constructor = base::Optional<JSFunctionRef> constructor =
broker->native_context().GetConstructorFunction(receiver_map); broker_->native_context().GetConstructorFunction(receiver_map);
if (constructor.has_value()) receiver_map = constructor->initial_map(); if (constructor.has_value()) receiver_map = constructor->initial_map();
} }
DependOnStablePrototypeChain(broker, this, receiver_map, holder); DependOnStablePrototypeChain(this, receiver_map, holder);
} }
} }
......
...@@ -28,7 +28,7 @@ class SlackTrackingPrediction { ...@@ -28,7 +28,7 @@ class SlackTrackingPrediction {
// Collects and installs dependencies of the code that is being generated. // Collects and installs dependencies of the code that is being generated.
class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject { class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject {
public: public:
CompilationDependencies(Isolate* isolate, Zone* zone); CompilationDependencies(JSHeapBroker* broker, Zone* zone);
V8_WARN_UNUSED_RESULT bool Commit(Handle<Code> code); V8_WARN_UNUSED_RESULT bool Commit(Handle<Code> code);
...@@ -68,8 +68,18 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject { ...@@ -68,8 +68,18 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject {
// {IsReadOnly()} flag of {cell}'s {PropertyDetails}. // {IsReadOnly()} flag of {cell}'s {PropertyDetails}.
void DependOnGlobalProperty(const PropertyCellRef& cell); void DependOnGlobalProperty(const PropertyCellRef& cell);
// Record the assumption that the protector remains valid. // Return the validity of the given protector and, if true, record the
void DependOnProtector(const PropertyCellRef& cell); // assumption that the protector remains valid.
bool DependOnProtector(const PropertyCellRef& cell);
// Convenience wrappers around {DependOnProtector}.
bool DependOnArrayBufferDetachingProtector();
bool DependOnArrayIteratorProtector();
bool DependOnArraySpeciesProtector();
bool DependOnNoElementsProtector();
bool DependOnPromiseHookProtector();
bool DependOnPromiseSpeciesProtector();
bool DependOnPromiseThenProtector();
// Record the assumption that {site}'s {ElementsKind} doesn't change. // Record the assumption that {site}'s {ElementsKind} doesn't change.
void DependOnElementsKind(const AllocationSiteRef& site); void DependOnElementsKind(const AllocationSiteRef& site);
...@@ -77,8 +87,7 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject { ...@@ -77,8 +87,7 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject {
// 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}.
void DependOnStablePrototypeChains( void DependOnStablePrototypeChains(
JSHeapBroker* broker, std::vector<Handle<Map>> const& receiver_maps, std::vector<Handle<Map>> const& receiver_maps, const JSObjectRef& holder);
const JSObjectRef& holder);
// Like DependOnElementsKind but also applies to all nested allocation sites. // Like DependOnElementsKind but also applies to all nested allocation sites.
void DependOnElementsKinds(const AllocationSiteRef& site); void DependOnElementsKinds(const AllocationSiteRef& site);
...@@ -98,9 +107,9 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject { ...@@ -98,9 +107,9 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject {
class Dependency; class Dependency;
private: private:
Zone* zone_; Zone* const zone_;
JSHeapBroker* const broker_;
ZoneForwardList<Dependency*> dependencies_; ZoneForwardList<Dependency*> dependencies_;
Isolate* isolate_;
}; };
} // namespace compiler } // namespace compiler
......
This diff is collapsed.
...@@ -219,11 +219,8 @@ Reduction JSNativeContextSpecialization::ReduceJSAsyncFunctionEnter( ...@@ -219,11 +219,8 @@ Reduction JSNativeContextSpecialization::ReduceJSAsyncFunctionEnter(
Node* frame_state = NodeProperties::GetFrameStateInput(node); Node* frame_state = NodeProperties::GetFrameStateInput(node);
Node* effect = NodeProperties::GetEffectInput(node); Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node); Node* control = NodeProperties::GetControlInput(node);
if (!isolate()->IsPromiseHookProtectorIntact()) return NoChange();
// Install a code dependency on the promise hook protector cell. if (!dependencies()->DependOnPromiseHookProtector()) return NoChange();
dependencies()->DependOnProtector(
PropertyCellRef(broker(), factory()->promise_hook_protector()));
// Create the promise for the async function. // Create the promise for the async function.
Node* promise = effect = Node* promise = effect =
...@@ -252,11 +249,8 @@ Reduction JSNativeContextSpecialization::ReduceJSAsyncFunctionReject( ...@@ -252,11 +249,8 @@ Reduction JSNativeContextSpecialization::ReduceJSAsyncFunctionReject(
Node* frame_state = NodeProperties::GetFrameStateInput(node); Node* frame_state = NodeProperties::GetFrameStateInput(node);
Node* effect = NodeProperties::GetEffectInput(node); Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node); Node* control = NodeProperties::GetControlInput(node);
if (!isolate()->IsPromiseHookProtectorIntact()) return NoChange();
// Install a code dependency on the promise hook protector cell. if (!dependencies()->DependOnPromiseHookProtector()) return NoChange();
dependencies()->DependOnProtector(
PropertyCellRef(broker(), factory()->promise_hook_protector()));
// Load the promise from the {async_function_object}. // Load the promise from the {async_function_object}.
Node* promise = effect = graph()->NewNode( Node* promise = effect = graph()->NewNode(
...@@ -291,11 +285,8 @@ Reduction JSNativeContextSpecialization::ReduceJSAsyncFunctionResolve( ...@@ -291,11 +285,8 @@ Reduction JSNativeContextSpecialization::ReduceJSAsyncFunctionResolve(
Node* frame_state = NodeProperties::GetFrameStateInput(node); Node* frame_state = NodeProperties::GetFrameStateInput(node);
Node* effect = NodeProperties::GetEffectInput(node); Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node); Node* control = NodeProperties::GetControlInput(node);
if (!isolate()->IsPromiseHookProtectorIntact()) return NoChange();
// Install a code dependency on the promise hook protector cell. if (!dependencies()->DependOnPromiseHookProtector()) return NoChange();
dependencies()->DependOnProtector(
PropertyCellRef(broker(), factory()->promise_hook_protector()));
// Load the promise from the {async_function_object}. // Load the promise from the {async_function_object}.
Node* promise = effect = graph()->NewNode( Node* promise = effect = graph()->NewNode(
...@@ -426,7 +417,7 @@ Reduction JSNativeContextSpecialization::ReduceJSInstanceOf(Node* node) { ...@@ -426,7 +417,7 @@ Reduction JSNativeContextSpecialization::ReduceJSInstanceOf(Node* node) {
Handle<JSObject> holder; Handle<JSObject> holder;
if (access_info.holder().ToHandle(&holder)) { if (access_info.holder().ToHandle(&holder)) {
dependencies()->DependOnStablePrototypeChains( dependencies()->DependOnStablePrototypeChains(
broker(), access_info.receiver_maps(), JSObjectRef(broker(), holder)); access_info.receiver_maps(), JSObjectRef(broker(), holder));
} }
// Monomorphic property access. // Monomorphic property access.
...@@ -481,7 +472,7 @@ Reduction JSNativeContextSpecialization::ReduceJSInstanceOf(Node* node) { ...@@ -481,7 +472,7 @@ Reduction JSNativeContextSpecialization::ReduceJSInstanceOf(Node* node) {
if (found_on_proto) { if (found_on_proto) {
dependencies()->DependOnStablePrototypeChains( dependencies()->DependOnStablePrototypeChains(
broker(), access_info.receiver_maps(), JSObjectRef(broker(), holder)); access_info.receiver_maps(), JSObjectRef(broker(), holder));
} }
DCHECK(constant->IsCallable()); DCHECK(constant->IsCallable());
...@@ -665,10 +656,6 @@ Reduction JSNativeContextSpecialization::ReduceJSPromiseResolve(Node* node) { ...@@ -665,10 +656,6 @@ Reduction JSNativeContextSpecialization::ReduceJSPromiseResolve(Node* node) {
Node* effect = NodeProperties::GetEffectInput(node); Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node); Node* control = NodeProperties::GetControlInput(node);
if (!isolate()->IsPromiseHookProtectorIntact()) {
return NoChange();
}
// Check if the {constructor} is the %Promise% function. // Check if the {constructor} is the %Promise% function.
HeapObjectMatcher m(constructor); HeapObjectMatcher m(constructor);
if (!m.HasValue() || if (!m.HasValue() ||
...@@ -688,9 +675,7 @@ Reduction JSNativeContextSpecialization::ReduceJSPromiseResolve(Node* node) { ...@@ -688,9 +675,7 @@ Reduction JSNativeContextSpecialization::ReduceJSPromiseResolve(Node* node) {
if (value_map->IsJSPromiseMap()) return NoChange(); if (value_map->IsJSPromiseMap()) return NoChange();
} }
// Install a code dependency on the promise hook protector cell. if (!dependencies()->DependOnPromiseHookProtector()) return NoChange();
dependencies()->DependOnProtector(
PropertyCellRef(broker(), factory()->promise_hook_protector()));
// Create a %Promise% instance and resolve it with {value}. // Create a %Promise% instance and resolve it with {value}.
Node* promise = effect = Node* promise = effect =
...@@ -745,7 +730,7 @@ Reduction JSNativeContextSpecialization::ReduceJSResolvePromise(Node* node) { ...@@ -745,7 +730,7 @@ Reduction JSNativeContextSpecialization::ReduceJSResolvePromise(Node* node) {
Handle<JSObject> holder; Handle<JSObject> holder;
if (access_info.holder().ToHandle(&holder)) { if (access_info.holder().ToHandle(&holder)) {
dependencies()->DependOnStablePrototypeChains( dependencies()->DependOnStablePrototypeChains(
broker(), access_info.receiver_maps(), JSObjectRef(broker(), holder)); access_info.receiver_maps(), JSObjectRef(broker(), holder));
} }
// Add stability dependencies on the {resolution_maps}. // Add stability dependencies on the {resolution_maps}.
...@@ -2159,7 +2144,7 @@ JSNativeContextSpecialization::BuildPropertyLoad( ...@@ -2159,7 +2144,7 @@ JSNativeContextSpecialization::BuildPropertyLoad(
PropertyAccessBuilder access_builder(jsgraph(), broker(), dependencies()); PropertyAccessBuilder access_builder(jsgraph(), broker(), dependencies());
if (access_info.holder().ToHandle(&holder)) { if (access_info.holder().ToHandle(&holder)) {
dependencies()->DependOnStablePrototypeChains( dependencies()->DependOnStablePrototypeChains(
broker(), access_info.receiver_maps(), JSObjectRef(broker(), holder)); access_info.receiver_maps(), JSObjectRef(broker(), holder));
} }
// Generate the actual property access. // Generate the actual property access.
...@@ -2218,7 +2203,7 @@ JSNativeContextSpecialization::BuildPropertyStore( ...@@ -2218,7 +2203,7 @@ JSNativeContextSpecialization::BuildPropertyStore(
if (access_info.holder().ToHandle(&holder)) { if (access_info.holder().ToHandle(&holder)) {
DCHECK_NE(AccessMode::kStoreInLiteral, access_mode); DCHECK_NE(AccessMode::kStoreInLiteral, access_mode);
dependencies()->DependOnStablePrototypeChains( dependencies()->DependOnStablePrototypeChains(
broker(), access_info.receiver_maps(), JSObjectRef(broker(), holder)); access_info.receiver_maps(), JSObjectRef(broker(), holder));
} }
DCHECK(!access_info.IsNotFound()); DCHECK(!access_info.IsNotFound());
...@@ -2636,12 +2621,7 @@ JSNativeContextSpecialization::BuildElementAccess( ...@@ -2636,12 +2621,7 @@ JSNativeContextSpecialization::BuildElementAccess(
} }
// See if we can skip the detaching check. // See if we can skip the detaching check.
if (isolate()->IsArrayBufferDetachingIntact()) { if (!dependencies()->DependOnArrayBufferDetachingProtector()) {
// Add a code dependency so we are deoptimized in case an ArrayBuffer
// gets detached.
dependencies()->DependOnProtector(PropertyCellRef(
broker(), factory()->array_buffer_detaching_protector()));
} else {
// Deopt if the {buffer} was detached. // Deopt if the {buffer} was detached.
// Note: A detached buffer leads to megamorphic feedback. // Note: A detached buffer leads to megamorphic feedback.
Node* buffer_bit_field = effect = graph()->NewNode( Node* buffer_bit_field = effect = graph()->NewNode(
...@@ -3050,10 +3030,7 @@ Node* JSNativeContextSpecialization::BuildIndexedStringLoad( ...@@ -3050,10 +3030,7 @@ Node* JSNativeContextSpecialization::BuildIndexedStringLoad(
Node* receiver, Node* index, Node* length, Node** effect, Node** control, Node* receiver, Node* index, Node* length, Node** effect, Node** control,
KeyedAccessLoadMode load_mode) { KeyedAccessLoadMode load_mode) {
if (load_mode == LOAD_IGNORE_OUT_OF_BOUNDS && if (load_mode == LOAD_IGNORE_OUT_OF_BOUNDS &&
isolate()->IsNoElementsProtectorIntact()) { dependencies()->DependOnNoElementsProtector()) {
dependencies()->DependOnProtector(
PropertyCellRef(broker(), factory()->no_elements_protector()));
// Ensure that the {index} is a valid String length. // Ensure that the {index} is a valid String length.
index = *effect = graph()->NewNode( index = *effect = graph()->NewNode(
simplified()->CheckBounds(VectorSlotPair()), index, simplified()->CheckBounds(VectorSlotPair()), index,
...@@ -3200,11 +3177,7 @@ bool JSNativeContextSpecialization::CanTreatHoleAsUndefined( ...@@ -3200,11 +3177,7 @@ bool JSNativeContextSpecialization::CanTreatHoleAsUndefined(
} }
// Check if the array prototype chain is intact. // Check if the array prototype chain is intact.
if (!isolate()->IsNoElementsProtectorIntact()) return false; return dependencies()->DependOnNoElementsProtector();
dependencies()->DependOnProtector(
PropertyCellRef(broker(), factory()->no_elements_protector()));
return true;
} }
namespace { namespace {
......
...@@ -136,7 +136,7 @@ class PipelineData { ...@@ -136,7 +136,7 @@ class PipelineData {
JSGraph(isolate_, graph_, common_, javascript_, simplified_, machine_); JSGraph(isolate_, graph_, common_, javascript_, simplified_, machine_);
broker_ = new (info_->zone()) JSHeapBroker(isolate_, info_->zone()); broker_ = new (info_->zone()) JSHeapBroker(isolate_, info_->zone());
dependencies_ = dependencies_ =
new (info_->zone()) CompilationDependencies(isolate_, info_->zone()); new (info_->zone()) CompilationDependencies(broker_, info_->zone());
} }
// For WebAssembly compile entry point. // For WebAssembly compile entry point.
......
...@@ -664,7 +664,7 @@ static void TestGeneralizeField(int detach_property_at_index, ...@@ -664,7 +664,7 @@ 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.
CanonicalHandleScope canonical(isolate); CanonicalHandleScope canonical(isolate);
JSHeapBroker broker(isolate, &zone); JSHeapBroker broker(isolate, &zone);
CompilationDependencies dependencies(isolate, &zone); CompilationDependencies dependencies(&broker, &zone);
MapRef map_ref(&broker, map); MapRef map_ref(&broker, map);
map_ref.SerializeOwnDescriptors(); map_ref.SerializeOwnDescriptors();
dependencies.DependOnFieldType(map_ref, property_index); dependencies.DependOnFieldType(map_ref, property_index);
...@@ -1041,7 +1041,7 @@ static void TestReconfigureDataFieldAttribute_GeneralizeField( ...@@ -1041,7 +1041,7 @@ static void TestReconfigureDataFieldAttribute_GeneralizeField(
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME);
CanonicalHandleScope canonical(isolate); CanonicalHandleScope canonical(isolate);
JSHeapBroker broker(isolate, &zone); JSHeapBroker broker(isolate, &zone);
CompilationDependencies dependencies(isolate, &zone); CompilationDependencies dependencies(&broker, &zone);
MapRef map_ref(&broker, map); MapRef map_ref(&broker, map);
map_ref.SerializeOwnDescriptors(); map_ref.SerializeOwnDescriptors();
dependencies.DependOnFieldType(map_ref, kSplitProp); dependencies.DependOnFieldType(map_ref, kSplitProp);
...@@ -1128,7 +1128,7 @@ static void TestReconfigureDataFieldAttribute_GeneralizeFieldTrivial( ...@@ -1128,7 +1128,7 @@ static void TestReconfigureDataFieldAttribute_GeneralizeFieldTrivial(
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME);
CanonicalHandleScope canonical(isolate); CanonicalHandleScope canonical(isolate);
JSHeapBroker broker(isolate, &zone); JSHeapBroker broker(isolate, &zone);
CompilationDependencies dependencies(isolate, &zone); CompilationDependencies dependencies(&broker, &zone);
MapRef map_ref(&broker, map); MapRef map_ref(&broker, map);
map_ref.SerializeOwnDescriptors(); map_ref.SerializeOwnDescriptors();
dependencies.DependOnFieldType(map_ref, kSplitProp); dependencies.DependOnFieldType(map_ref, kSplitProp);
...@@ -1813,7 +1813,7 @@ static void TestReconfigureElementsKind_GeneralizeField( ...@@ -1813,7 +1813,7 @@ static void TestReconfigureElementsKind_GeneralizeField(
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME);
CanonicalHandleScope canonical(isolate); CanonicalHandleScope canonical(isolate);
JSHeapBroker broker(isolate, &zone); JSHeapBroker broker(isolate, &zone);
CompilationDependencies dependencies(isolate, &zone); CompilationDependencies dependencies(&broker, &zone);
MapRef map_ref(&broker, map); MapRef map_ref(&broker, map);
map_ref.SerializeOwnDescriptors(); map_ref.SerializeOwnDescriptors();
dependencies.DependOnFieldType(map_ref, kDiffProp); dependencies.DependOnFieldType(map_ref, kDiffProp);
...@@ -1911,7 +1911,7 @@ static void TestReconfigureElementsKind_GeneralizeFieldTrivial( ...@@ -1911,7 +1911,7 @@ static void TestReconfigureElementsKind_GeneralizeFieldTrivial(
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME);
CanonicalHandleScope canonical(isolate); CanonicalHandleScope canonical(isolate);
JSHeapBroker broker(isolate, &zone); JSHeapBroker broker(isolate, &zone);
CompilationDependencies dependencies(isolate, &zone); CompilationDependencies dependencies(&broker, &zone);
MapRef map_ref(&broker, map); MapRef map_ref(&broker, map);
map_ref.SerializeOwnDescriptors(); map_ref.SerializeOwnDescriptors();
......
...@@ -65,7 +65,7 @@ class ConstantFoldingReducerTest : public TypedGraphTest { ...@@ -65,7 +65,7 @@ class ConstantFoldingReducerTest : public TypedGraphTest {
: TypedGraphTest(3), : TypedGraphTest(3),
broker_(isolate(), zone()), broker_(isolate(), zone()),
simplified_(zone()), simplified_(zone()),
deps_(isolate(), zone()) {} deps_(&broker_, zone()) {}
~ConstantFoldingReducerTest() override = default; ~ConstantFoldingReducerTest() override = default;
protected: protected:
......
...@@ -21,7 +21,7 @@ namespace compiler { ...@@ -21,7 +21,7 @@ namespace compiler {
class JSCallReducerTest : public TypedGraphTest { class JSCallReducerTest : public TypedGraphTest {
public: public:
JSCallReducerTest() JSCallReducerTest()
: TypedGraphTest(3), javascript_(zone()), deps_(isolate(), zone()) { : TypedGraphTest(3), javascript_(zone()), deps_(broker(), zone()) {
broker()->SerializeStandardObjects(); broker()->SerializeStandardObjects();
} }
~JSCallReducerTest() override = default; ~JSCallReducerTest() override = default;
......
...@@ -32,9 +32,8 @@ class JSCreateLoweringTest : public TypedGraphTest { ...@@ -32,9 +32,8 @@ class JSCreateLoweringTest : public TypedGraphTest {
JSCreateLoweringTest() JSCreateLoweringTest()
: TypedGraphTest(3), : TypedGraphTest(3),
javascript_(zone()), javascript_(zone()),
deps_(isolate(), zone()), deps_(broker(), zone()),
handle_scope_(isolate()) { handle_scope_(isolate()) {}
}
~JSCreateLoweringTest() override = default; ~JSCreateLoweringTest() override = default;
protected: protected:
......
...@@ -27,7 +27,7 @@ namespace typed_optimization_unittest { ...@@ -27,7 +27,7 @@ namespace typed_optimization_unittest {
class TypedOptimizationTest : public TypedGraphTest { class TypedOptimizationTest : public TypedGraphTest {
public: public:
TypedOptimizationTest() TypedOptimizationTest()
: TypedGraphTest(3), simplified_(zone()), deps_(isolate(), zone()) {} : TypedGraphTest(3), simplified_(zone()), deps_(broker(), zone()) {}
~TypedOptimizationTest() override = default; ~TypedOptimizationTest() override = default;
protected: protected:
......
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