Index: src/compilation-dependencies.cc |
diff --git a/src/compilation-dependencies.cc b/src/compilation-dependencies.cc |
index c9c194f19ff056cd1c279f13befede4d67ff377b..96b3859e9ab4b73eb22a7e41db3568ed59f30f52 100644 |
--- a/src/compilation-dependencies.cc |
+++ b/src/compilation-dependencies.cc |
@@ -124,6 +124,20 @@ void CompilationDependencies::AssumeMapStable(Handle<Map> map) { |
} |
+void CompilationDependencies::AssumePrototypeMapsStable( |
+ Handle<Map> map, MaybeHandle<JSReceiver> prototype) { |
+ for (PrototypeIterator i(map); !i.IsAtEnd(); i.Advance()) { |
+ Handle<JSReceiver> const current = |
+ PrototypeIterator::GetCurrent<JSReceiver>(i); |
+ AssumeMapStable(handle(current->map())); |
+ Handle<JSReceiver> last; |
+ if (prototype.ToHandle(&last) && last.is_identical_to(current)) { |
+ break; |
+ } |
+ } |
+} |
+ |
+ |
void CompilationDependencies::AssumeTransitionStable( |
Handle<AllocationSite> site) { |
// Do nothing if the object doesn't have any useful element transitions left. |
@@ -135,5 +149,6 @@ void CompilationDependencies::AssumeTransitionStable( |
Insert(DependentCode::kAllocationSiteTransitionChangedGroup, site); |
} |
} |
+ |
} // namespace internal |
} // namespace v8 |